Documentation

LeanMirror.Document

← Mathematical handbook

A proof document is a scoped syntax tree. Valid checks every node; sound derives its conclusion. Presentation never supplies a mathematical premise.

def LeanMirror.Expr.liftRen {Γ Δ : List Ty} {a b : Ty} (ρ : {t : Ty} → Var Γ t → Var Δ t) :
Var (a :: Γ) b → Var (a :: Δ) b
Equations
Instances For
    def LeanMirror.Expr.rename {S : Ty → Type} {Γ Δ : List Ty} {a : Ty} (ρ : {t : Ty} → Var Γ t → Var Δ t) :
    Expr S Γ a → Expr S Δ a
    Equations
    Instances For
      def LeanMirror.Expr.weaken {S : Ty → Type} {Γ : List Ty} {a b : Ty} (e : Expr S Γ a) :
      Expr S (b :: Γ) a
      Equations
      Instances For
        theorem LeanMirror.Expr.eval_rename {S : Ty → Type} (M : Model S) {Γ Δ : List Ty} {a : Ty} (e : Expr S Γ a) (ρ : {t : Ty} → Var Γ t → Var Δ t) (env : Context M.base Γ) (env' : Context M.base Δ) (h : ∀ {t : Ty} (v : Var Γ t), (ρ v).get env' = v.get env) :
        eval M (rename (fun {t : Ty} => ρ) e) env' = eval M e env
        @[simp]
        theorem LeanMirror.Expr.eval_weaken {S : Ty → Type} (M : Model S) {Γ : List Ty} {a b : Ty} (e : Expr S Γ a) (env : Context M.base Γ) (x : Ty.denote M.base b) :
        eval M e.weaken (x, env) = eval M e env
        inductive LeanMirror.Argument (S : Ty → Type) :

        Each constructor has fixed logical meaning and fixed controlled prose. Arbitrary source prose is kept separately and cannot certify a node.

        Instances For
          def LeanMirror.Argument.goal {S : Ty → Type} {Γ : List Ty} :
          Argument S Γ → Expr S Γ Ty.prop

          The conclusion is computed from the proof structure, never a separate caption.

          Equations
          Instances For
            noncomputable def LeanMirror.Argument.Valid {S : Ty → Type} (M : Model S) {Γ : List Ty} (H : Context M.base Γ → Prop) :
            Argument S Γ → Prop

            Verification checks each assertion under exactly the assumptions available at that point. Choices require existence. Fresh variables cannot escape scope.

            Equations
            Instances For
              theorem LeanMirror.Argument.sound {S : Ty → Type} (M : Model S) {Γ : List Ty} (doc : Argument S Γ) (H : Context M.base Γ → Prop) (valid : Valid M H doc) (env : Context M.base Γ) :
              H env → Expr.eval M doc.goal env

              The generic proof-document soundness theorem, checked by Lean's kernel.

              @[irreducible]
              def LeanMirror.Expr.toDocumentJson {S : Ty → Type} (v : Vocabulary S) {Γ : List Ty} (vars : List String) (e : Expr S Γ Ty.prop) :

              Structured formulas support prose and calculation layout without reparsing TeX.

              Equations
              Instances For
                def LeanMirror.Argument.toJson {S : Ty → Type} (v : Vocabulary S) {Γ : List Ty} (vars : List String) :

                Deterministic view of the checked tree; scope nesting is retained.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Data view. Use checked_document% to obtain this from an audited certificate.

                  Equations
                  Instances For

                    Select the document directly from the type of an audited, closed validity theorem. Its noncomputable mathematical model stays in the proof, not in runtime output.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For