Documentation

LeanMirror.Core

← Mathematical handbook

A small, typed language for mathematical statements #

The syntax tree, rather than a separately written LaTeX string, is the source of both the proposition and its presentation. Subject-specific vocabulary is supplied by applications. Named base types and typed symbols are supplied by an application.

inductive LeanMirror.Ty :
Instances For
    def LeanMirror.instDecidableEqTy.decEq (x✝ x✝¹ : Ty) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      @[instance_reducible]
      Equations
      Equations
      Instances For
        inductive LeanMirror.Var :
        List Ty → Ty → Type
        Instances For
          @[reducible, inline]
          abbrev LeanMirror.Context (base : String → Type) :
          Equations
          Instances For
            def LeanMirror.Var.get {base : String → Type} {Γ : List Ty} {a : Ty} :
            Var Γ a → Context base Γ → Ty.denote base a
            Equations
            Instances For
              inductive LeanMirror.Expr (Symbol : Ty → Type) :
              List Ty → Ty → Type

              Bound variables are typed de Bruijn indices. Binder names affect printing only.

              Instances For
                @[reducible, inline]
                abbrev LeanMirror.Expr.withContextSize {Symbol : Ty → Type} {Γ : List Ty} {a : Ty} (size : ℕ) :
                Γ.length = size → (expr : Expr Symbol Γ a) → Expr Symbol Γ a

                Prevent the quotation's external names from silently disagreeing with its typed context.

                Equations
                Instances For
                  structure LeanMirror.Model (Symbol : Ty → Type) :
                  Instances For
                    noncomputable def LeanMirror.Expr.eval {Symbol : Ty → Type} (M : Model Symbol) {Γ : List Ty} {a : Ty} :
                    Expr Symbol Γ a → Context M.base Γ → Ty.denote M.base a
                    Equations
                    Instances For
                      structure LeanMirror.Certificate {Symbol : Ty → Type} (M : Model Symbol) (statement : Expr Symbol [] Ty.prop) (target : Prop) :

                      A correspondence and a proof of the target imply the companion's proposition.

                      • correspondence : Expr.eval M statement () ↔ target
                      • established : target
                      Instances For
                        theorem LeanMirror.Certificate.proved {Symbol : Ty → Type} {M : Model Symbol} {statement : Expr Symbol [] Ty.prop} {target : Prop} (certificate : Certificate M statement target) :
                        Expr.eval M statement ()
                        def LeanMirror.Expr.symbols {Symbol : Ty → Type} (key : {a : Ty} → Symbol a → String) {Γ : List Ty} {a : Ty} :
                        Expr Symbol Γ a → List String

                        Bindings used by an expression, excluding proof dependencies.

                        Equations
                        Instances For