The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V01. The language of Mathlib

Mathlib.Util.Export

54 declarations and 3 deprecated aliases. Mathlib docs · Source

A rudimentary export format

Adapted from https://github.com/leanprover-community/lean/blob/master/doc/export_format.md with support for Lean 4 kernel primitives.

References

theorem Lean.Export.Alloc.mk.injEq E0 #

∀ {α : Type u_1} [inst : BEq α] [inst_1 : Hashable α] (map : Std.HashMap α ℕ) (next : ℕ) (map_1 : Std.HashMap α ℕ)
  (next_1 : ℕ), ({ map := map, next := next } = { map := map_1, next := next_1 }) = (map = map_1 ∧ next = next_1)

def Lean.Export.instInhabitedAlloc.default E1 #

{α : Type u_1} → {inst : BEq α} → {inst_1 : Hashable α} → Lean.Export.Alloc α

def Lean.Export.Alloc.ctorIdx E1 #

{α : Type u_1} → {inst : BEq α} → {inst_1 : Hashable α} → Lean.Export.Alloc α → ℕ

abbrev Lean.Export.Entry.ctorElimType E1 #

{motive : Lean.Export.Entry → Sort u} → ℕ → Sort (max 1 u)

theorem Lean.Export.Entry.level.inj E1 #

∀ {n n_1 : Lean.Level}, Lean.Export.Entry.level n = Lean.Export.Entry.level n_1 → n = n_1

def Lean.Export.State.ctorIdx E1 #

Lean.Export.State → ℕ

def Lean.Export.instInhabitedState.default E1 #

Lean.Export.State

theorem Lean.Export.Entry.name.injEq E0 #

∀ (n n_1 : Lean.Name), (Lean.Export.Entry.name n = Lean.Export.Entry.name n_1) = (n = n_1)

def Lean.Export.instInhabitedEntry.default E1 #

Lean.Export.Entry

theorem Lean.Export.Entry.defn.injEq E0 #

∀ (n n_1 : Lean.Name), (Lean.Export.Entry.defn n = Lean.Export.Entry.defn n_1) = (n = n_1)

def Lean.Export.Entry.ctorIdx E1 #

Lean.Export.Entry → ℕ

theorem Lean.Export.State.mk.injEq E0 #

∀ (names : Lean.Export.Alloc Lean.Name) (levels : Lean.Export.Alloc Lean.Level) (exprs : Lean.Export.Alloc Lean.Expr)
  (defs : Std.HashSet Lean.Name) (stk : Array (Bool × Lean.Export.Entry)) (names_1 : Lean.Export.Alloc Lean.Name)
  (levels_1 : Lean.Export.Alloc Lean.Level) (exprs_1 : Lean.Export.Alloc Lean.Expr) (defs_1 : Std.HashSet Lean.Name)
  (stk_1 : Array (Bool × Lean.Export.Entry)),
  ({ names := names, levels := levels, exprs := exprs, defs := defs, stk := stk } =
      { names := names_1, levels := levels_1, exprs := exprs_1, defs := defs_1, stk := stk_1 }) =
    (names = names_1 ∧ levels = levels_1 ∧ exprs = exprs_1 ∧ defs = defs_1 ∧ stk = stk_1)

theorem Lean.Export.Entry.expr.inj E1 #

∀ {n n_1 : Lean.Expr}, Lean.Export.Entry.expr n = Lean.Export.Entry.expr n_1 → n = n_1

theorem Lean.Export.Entry.defn.inj E1 #

∀ {n n_1 : Lean.Name}, Lean.Export.Entry.defn n = Lean.Export.Entry.defn n_1 → n = n_1

theorem Lean.Export.Entry.expr.injEq E0 #

∀ (n n_1 : Lean.Expr), (Lean.Export.Entry.expr n = Lean.Export.Entry.expr n_1) = (n = n_1)

theorem Lean.Export.State.mk.inj E1 #

∀ {names : Lean.Export.Alloc Lean.Name} {levels : Lean.Export.Alloc Lean.Level} {exprs : Lean.Export.Alloc Lean.Expr}
  {defs : Std.HashSet Lean.Name} {stk : Array (Bool × Lean.Export.Entry)} {names_1 : Lean.Export.Alloc Lean.Name}
  {levels_1 : Lean.Export.Alloc Lean.Level} {exprs_1 : Lean.Export.Alloc Lean.Expr} {defs_1 : Std.HashSet Lean.Name}
  {stk_1 : Array (Bool × Lean.Export.Entry)},
  { names := names, levels := levels, exprs := exprs, defs := defs, stk := stk } =
      { names := names_1, levels := levels_1, exprs := exprs_1, defs := defs_1, stk := stk_1 } →
    names = names_1 ∧ levels = levels_1 ∧ exprs = exprs_1 ∧ defs = defs_1 ∧ stk = stk_1

theorem Lean.Export.Entry.name.inj E1 #

∀ {n n_1 : Lean.Name}, Lean.Export.Entry.name n = Lean.Export.Entry.name n_1 → n = n_1

def Lean.Export.OfState.ctorIdx E1 #

{α : Type} → {inst : BEq α} → {inst_1 : Hashable α} → Lean.Export.OfState α → ℕ

theorem Lean.Export.Entry.level.injEq E0 #

∀ (n n_1 : Lean.Level), (Lean.Export.Entry.level n = Lean.Export.Entry.level n_1) = (n = n_1)

theorem Lean.Export.Alloc.mk.inj E1 #

∀ {α : Type u_1} {inst : BEq α} {inst_1 : Hashable α} {map : Std.HashMap α ℕ} {next : ℕ} {map_1 : Std.HashMap α ℕ}
  {next_1 : ℕ}, { map := map, next := next } = { map := map_1, next := next_1 } → map = map_1 ∧ next = next_1

inductive Lean.Export.Entry E1 #

Type

ctor Lean.Export.Entry.name E0 #

Lean.Name → Lean.Export.Entry

ctor Lean.Export.Entry.level E0 #

Lean.Level → Lean.Export.Entry

ctor Lean.Export.Entry.expr E0 #

Lean.Expr → Lean.Export.Entry

ctor Lean.Export.Entry.defn E0 #

Lean.Name → Lean.Export.Entry

instance Lean.Export.instInhabitedEntry E0 #

Inhabited Lean.Export.Entry

instance Lean.Export.instCoeNameEntry E0 #

Coe Lean.Name Lean.Export.Entry

instance Lean.Export.instCoeLevelEntry E0 #

Coe Lean.Level Lean.Export.Entry

instance Lean.Export.instCoeExprEntry E0 #

Coe Lean.Expr Lean.Export.Entry

structure Lean.Export.Alloc E1 #

(α : Type u_1) → [BEq α] → [Hashable α] → Type u_1

ctor Lean.Export.Alloc.mk E0 #

{α : Type u_1} → [inst : BEq α] → [inst_1 : Hashable α] → Std.HashMap α ℕ → ℕ → Lean.Export.Alloc α

abbrev Lean.Export.Alloc.map E1 #

{α : Type u_1} → [inst : BEq α] → [inst_1 : Hashable α] → Lean.Export.Alloc α → Std.HashMap α ℕ

abbrev Lean.Export.Alloc.next E1 #

{α : Type u_1} → [inst : BEq α] → [inst_1 : Hashable α] → Lean.Export.Alloc α → ℕ

instance Lean.Export.instInhabitedAlloc E0 #

{a : Type u_1} → {a_1 : BEq a} → {a_2 : Hashable a} → Inhabited (Lean.Export.Alloc a)

ctor Lean.Export.State.mk E0 #

Lean.Export.Alloc Lean.Name →
  Lean.Export.Alloc Lean.Level →
    Lean.Export.Alloc Lean.Expr → Std.HashSet Lean.Name → Array (Bool × Lean.Export.Entry) → Lean.Export.State

structure Lean.Export.State E1 #

Type

abbrev Lean.Export.State.names E1 #

Lean.Export.State → Lean.Export.Alloc Lean.Name

abbrev Lean.Export.State.levels E1 #

Lean.Export.State → Lean.Export.Alloc Lean.Level

abbrev Lean.Export.State.exprs E1 #

Lean.Export.State → Lean.Export.Alloc Lean.Expr

abbrev Lean.Export.State.defs E1 #

Lean.Export.State → Std.HashSet Lean.Name

abbrev Lean.Export.State.stk E1 #

Lean.Export.State → Array (Bool × Lean.Export.Entry)

instance Lean.Export.instInhabitedState E0 #

Inhabited Lean.Export.State

class Lean.Export.OfState E1 #

(α : Type) → [BEq α] → [Hashable α] → Type

ctor Lean.Export.OfState.mk E0 #

{α : Type} →
  [inst : BEq α] →
    [inst_1 : Hashable α] →
      (Lean.Export.State → Lean.Export.Alloc α) →
        ((Lean.Export.Alloc α → Lean.Export.Alloc α) → Lean.Export.State → Lean.Export.State) → Lean.Export.OfState α

abbrev Lean.Export.OfState.get E1 #

{α : Type} →
  {inst : BEq α} → {inst_1 : Hashable α} → [self : Lean.Export.OfState α] → Lean.Export.State → Lean.Export.Alloc α

abbrev Lean.Export.OfState.modify E1 #

{α : Type} →
  {inst : BEq α} →
    {inst_1 : Hashable α} →
      [self : Lean.Export.OfState α] →
        (Lean.Export.Alloc α → Lean.Export.Alloc α) → Lean.Export.State → Lean.Export.State

instance Lean.Export.instOfStateName E0 #

Lean.Export.OfState Lean.Name

instance Lean.Export.instOfStateLevel E0 #

Lean.Export.OfState Lean.Level

instance Lean.Export.instOfStateExpr E0 #

Lean.Export.OfState Lean.Expr

abbrev Lean.ExportM E1 #

Type → Type

def Lean.Export.alloc E1 #

{α : Type} → [inst : BEq α] → [inst_1 : Hashable α] → [Lean.Export.OfState α] → α → Lean.ExportM ℕ

def Lean.Export.exportName E1 #

Lean.Name → Lean.ExportM ℕ

def Lean.Export.exportLevel E1 #

Lean.Level → Lean.ExportM ℕ

def Lean.Export.biStr E1 #

Lean.BinderInfo → String

Deprecated aliases

NameNew nameSince
Lean.Export.exportDef2026-10-27
Lean.Export.exportExpr2026-10-27
Lean.Export.runExportM2026-10-27