ProblemExtraction/Core.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned compfiles documentation, Pinned compfiles corpus index

19 declarations, 0 contain sorry, 0 declared as axioms

Core data structures and extraction functions used by the problem-extraction commands.

Imports (7)
Imported by 1 file
  1. structure ProblemExtraction.Replacement line 21 source

    no axioms what this means

  2. inductive ProblemExtraction.EntryVariant line 27 source

    no axioms what this means

  3. structure ProblemExtraction.Entry An entry in the state of the Problem Extraction environment extension line 38 source

    Source documentation

    An entry in the state of the Problem Extraction environment extension

    no axioms what this means

    structure Entry where
    …
  4. abbrev ProblemExtraction.ExtractionExtension line 44 source

    no axioms what this means

    Proof uses: Lean.SimplePersistentEnvExtension, ProblemExtraction.Entry, Array

  5. abbrev ProblemExtraction.DetermineDeclsExtension line 60 source

    no axioms what this means

    Proof uses: Lean.SimplePersistentEnvExtension, Lean.Name, Array

  6. inductive ProblemExtraction.ProblemTag line 69 source

    no axioms what this means

  7. def ProblemExtraction.ProblemTag.toNat line 77 source

    no axioms what this means

    Statement uses: ProblemExtraction.ProblemTag, Nat

    Proof uses: ProblemExtraction.ProblemTag.toNat.match_1, Unit, OfNat.ofNat

    1 instances, coercions and auxiliary constants left out.

  8. instance ProblemExtraction.(instance at line 84) line 84 source
  9. structure ProblemExtraction.ProblemFileMetadata line 92 source

    no axioms what this means

  10. structure ProblemExtraction.ProblemMetadataEntry line 115 source

    no axioms what this means

  11. abbrev ProblemExtraction.ProblemMetadataExtension line 119 source

    no axioms what this means

    Proof uses: Lean.SimplePersistentEnvExtension, ProblemExtraction.ProblemMetadataEntry, Array

  12. def ProblemExtraction.parseAuthors line 129 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: String, List

    Proof uses: Option.getD, Option.map, String.Slice, String.splitToList, String.Slice.toString, Char, Decidable.decide, Eq, Char.ofNat, Std.Iter.findSome?, Std.Iterators.Types.Map, String.Slice.SplitIterator, String.Slice.Pattern.ForwardSliceSearcher, String.toSlice, String.Slice.Subslice, Id, MonadLiftT.monadLift, Pure.pure, Std.Iterators.PostconditionT, String.Slice.Subslice.toSlice and 3 more

    13 instances, coercions and auxiliary constants left out.

  13. def ProblemExtraction.parseCopyrightHeader line 135 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: String

    Proof uses: String.join, List.map, String.append, List.takeWhile, Bool.not, Bool.or, String.startsWith, String.splitOn

    1 instances, coercions and auxiliary constants left out.

  14. def ProblemExtraction.findModuleImports Helper function for extractFromExt line 144 source

    Source documentation

    Helper function for extractFromExt.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Monad, Lean.MonadError, Lean.Environment, Lean.Name, Array, Lean.Import

    Proof uses: ProblemExtraction.findModuleImports.match_1, Option, Lean.ModuleIdx, Lean.Environment.getModuleIdx?, Pure.pure, Lean.ModuleData.imports, GetElem?.getElem!, Lean.ModuleData, LT.lt, Nat, Lean.ModuleIdx.toNat, Array.size, Lean.EnvironmentHeader.moduleData, Lean.Environment.header, Unit, Lean.throwError, Function.comp, String, Std.Format, Lean.MessageData and 4 more

    10 instances, coercions and auxiliary constants left out.

    def findModuleImports
        {m : Type → Type} [Monad m] [MonadError m] (env : Environment) (md : Name) :
        m (Array Import) :=
    …
  15. def ProblemExtraction.getDeclsInPackage Gets the declarations that originate in modules beneath package line 152 source

    Source documentation

    Gets the declarations that originate in modules beneath package.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Lean.Name, Lean.Core.CoreM, Array

    Proof uses: Bind.bind, Lean.Environment, Lean.MonadEnv.getEnv, Prod, Lean.ConstantInfo, Lean.PersistentHashMap.toArray, Lean.SMap.map₂, Lean.Environment.constants, Bool, Array.map, Lean.Name.isPrefixOf, Lean.EnvironmentHeader.moduleNames, Lean.Environment.header, Pure.pure, Lean.Core.Context, StateRefT', IO.RealWorld, Lean.Core.State, EIO, Lean.Exception and 14 more

    17 instances, coercions and auxiliary constants left out.

    def getDeclsInPackage (package : Name) : CoreM (Array Name) := do
    …
  16. def ProblemExtraction.extractFromExt line 158 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Monad, Lean.MonadEnv, Lean.MonadError, ProblemExtraction.ExtractionExtension, Lean.NameMap, String

    Proof uses: Bind.bind, Lean.Environment, Lean.MonadEnv.getEnv, Array, ProblemExtraction.Entry, Lean.SimplePersistentEnvExtension.getState, Lean.EnvExtension.asyncMode, Lean.PersistentEnvExtensionState, Prod, List, Lean.PersistentEnvExtension.toEnvExtension, Lean.Name.anonymous, String.Pos.Raw, Lean.mkNameMap, ForIn.forIn, inferInstance, Membership, ProblemExtraction.extractFromExt.match_3, ForInStep, Lean.Name and 28 more

    16 instances, coercions and auxiliary constants left out.

  17. def ProblemExtraction.extractProblems Using the data in the problem extraction environment extension, constructs a map from module name to problem source code line 203 source

    Source documentation

    Using the data in the problem extraction environment extension, constructs a map from module name to problem source code.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Monad, Lean.MonadEnv, Lean.MonadError, Lean.NameMap, String

    Proof uses: ProblemExtraction.extractFromExt, ProblemExtraction.problemExtractionExtension

    def extractProblems {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] :
        m (NameMap String) :=
    …
  18. def ProblemExtraction.extractSolutions Using the data in the solution extraction environment extension, constructs a map from module name to solution source code line 211 source

    Source documentation

    Using the data in the solution extraction environment extension, constructs a map from module name to solution source code.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Monad, Lean.MonadEnv, Lean.MonadError, Lean.NameMap, String

    Proof uses: ProblemExtraction.extractFromExt, ProblemExtraction.solutionExtractionExtension

    def extractSolutions {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] :
        m (NameMap String) :=
    …
  19. def ProblemExtraction.extractMetadata Using the data in the solution extraction environment extension, constructs a map from module name to problem metadata line 219 source

    Source documentation

    Using the data in the solution extraction environment extension, constructs a map from module name to problem metadata

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Monad, Lean.MonadEnv, Lean.MonadError, Lean.NameMap, ProblemExtraction.ProblemFileMetadata

    Proof uses: Bind.bind, Lean.Environment, Lean.MonadEnv.getEnv, Array, ProblemExtraction.ProblemMetadataEntry, Lean.SimplePersistentEnvExtension.getState, ProblemExtraction.problemMetadataExtension, Lean.EnvExtension.asyncMode, Lean.PersistentEnvExtensionState, Prod, List, Lean.PersistentEnvExtension.toEnvExtension, Lean.Name.anonymous, Lean.mkNameMap, ForIn.forIn, inferInstance, Membership, ProblemExtraction.extractMetadata.match_1, ForInStep, Lean.Name and 3 more

    7 instances, coercions and auxiliary constants left out.

    def extractMetadata {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] :
        m (NameMap ProblemFileMetadata) := do
    …

    Mentions: ProblemExtraction.ProblemFileMetadata