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 / V34. The tactics of Mathlib

Mathlib.Tactic.FunProp.Mor

28 declarations. Mathlib docs · Source

funProp Meta programming functions like in Lean.Expr.* but for working with bundled morphisms.

Function application in normal lean expression looks like .app f x but when we work with bundled morphism f it looks like .app (.app coe f) x where f. In mathlib coe is usually DFunLike.coe but it can be any coercion that is registered with the coe attribute.

The main difference when working with expression involving morphisms is that the notion the head of expression changes. For example in:

  coe (f a) b

the head of expression is considered to be f and not coe.

theorem Mathlib.Meta.FunProp.Mor.Arg.mk.inj E1 #

∀ {expr : Lean.Expr} {coe : Option Lean.Expr} {expr_1 : Lean.Expr} {coe_1 : Option Lean.Expr},
  { expr := expr, coe := coe } = { expr := expr_1, coe := coe_1 } → expr = expr_1 ∧ coe = coe_1

def Mathlib.Meta.FunProp.Mor.App.ctorIdx E1 #

Mathlib.Meta.FunProp.Mor.App → ℕ

theorem Mathlib.Meta.FunProp.Mor.App.mk.inj E1 #

∀ {coe fn arg coe_1 fn_1 arg_1 : Lean.Expr},
  { coe := coe, fn := fn, arg := arg } = { coe := coe_1, fn := fn_1, arg := arg_1 } →
    coe = coe_1 ∧ fn = fn_1 ∧ arg = arg_1

theorem Mathlib.Meta.FunProp.Mor.App.mk.injEq E0 #

∀ (coe fn arg coe_1 fn_1 arg_1 : Lean.Expr),
  ({ coe := coe, fn := fn, arg := arg } = { coe := coe_1, fn := fn_1, arg := arg_1 }) =
    (coe = coe_1 ∧ fn = fn_1 ∧ arg = arg_1)

theorem Mathlib.Meta.FunProp.Mor.Arg.mk.injEq E0 #

∀ (expr : Lean.Expr) (coe : Option Lean.Expr) (expr_1 : Lean.Expr) (coe_1 : Option Lean.Expr),
  ({ expr := expr, coe := coe } = { expr := expr_1, coe := coe_1 }) = (expr = expr_1 ∧ coe = coe_1)

def Mathlib.Meta.FunProp.Mor.Arg.ctorIdx E1 #

Mathlib.Meta.FunProp.Mor.Arg → ℕ

def Mathlib.Meta.FunProp.Mor.instInhabitedArg.default E1 #

Mathlib.Meta.FunProp.Mor.Arg

abbrev Mathlib.Meta.FunProp.Forall E1 #

{α : Sort u_1} → (α → Sort u_2) → Sort (imax u_1 u_2)

An abbreviation of ∀ x, p x. It is used by fun_prop to represent Pi types as function applications and should not occur in any place other than the implementation of fun_prop.

def Mathlib.Meta.FunProp.Mor.isCoeFunName E1 #

Lean.Name → Lean.CoreM Bool

Is name a coercion from some function space to functions?

def Mathlib.Meta.FunProp.Mor.isCoeFun E1 #

Lean.Expr → Lean.MetaM Bool

Is e a coercion from some function space to functions?

structure Mathlib.Meta.FunProp.Mor.App E1 #

Type

Morphism application

ctor Mathlib.Meta.FunProp.Mor.App.mk E0 #

Lean.Expr → Lean.Expr → Lean.Expr → Mathlib.Meta.FunProp.Mor.App

abbrev Mathlib.Meta.FunProp.Mor.App.coe E1 #

Mathlib.Meta.FunProp.Mor.App → Lean.Expr

morphism coercion

abbrev Mathlib.Meta.FunProp.Mor.App.fn E1 #

Mathlib.Meta.FunProp.Mor.App → Lean.Expr

bundled morphism

abbrev Mathlib.Meta.FunProp.Mor.App.arg E1 #

Mathlib.Meta.FunProp.Mor.App → Lean.Expr

morphism argument

def Mathlib.Meta.FunProp.Mor.isMorApp? E1 #

Lean.Expr → Lean.MetaM (Option Mathlib.Meta.FunProp.Mor.App)

Is e morphism application?

opaque Mathlib.Meta.FunProp.Mor.fun_prop.projDefaultTransparency E1 #

Lean.Option Bool

Previously, fun_prop incorrectly switched to default transparency when reducing an expression if a projection was applied to it. Setting this option to true restores this behavior.

Note that this option is only for backward compatibility and will be removed in the future.

opaque Mathlib.Meta.FunProp.Mor.whnf E1 #

Lean.Expr → Lean.MetaM Lean.Expr

Weak normal head form of an expression involving morphism applications.

For example calling this on coe (f a) b will put f in weak normal head form instead of coe.

structure Mathlib.Meta.FunProp.Mor.Arg E1 #

Type

Argument of morphism application that stores corresponding coercion if necessary

ctor Mathlib.Meta.FunProp.Mor.Arg.mk E0 #

Lean.Expr → Option Lean.Expr → Mathlib.Meta.FunProp.Mor.Arg

abbrev Mathlib.Meta.FunProp.Mor.Arg.expr E1 #

Mathlib.Meta.FunProp.Mor.Arg → Lean.Expr

argument of type α

abbrev Mathlib.Meta.FunProp.Mor.Arg.coe E1 #

Mathlib.Meta.FunProp.Mor.Arg → Option Lean.Expr

coercion F → α → β

instance Mathlib.Meta.FunProp.Mor.instInhabitedArg E0 #

Inhabited Mathlib.Meta.FunProp.Mor.Arg

def Mathlib.Meta.FunProp.Mor.app E1 #

Lean.Expr → Mathlib.Meta.FunProp.Mor.Arg → Lean.Expr

Morphism application

def Mathlib.Meta.FunProp.Mor.withApp E1 #

{α : Type} → Lean.Expr → (Lean.Expr → Array Mathlib.Meta.FunProp.Mor.Arg → Lean.MetaM α) → Lean.MetaM α

Given e = f a₁ a₂ ... aₙ, returns k f #[a₁, ..., aₙ] where f can be bundled morphism.

∀ x, p x is represented as Forall p.

def Mathlib.Meta.FunProp.Mor.getAppFn E1 #

Lean.Expr → Lean.MetaM Lean.Expr

If the given expression is a sequence of morphism applications f a₁ .. aₙ, return f. Otherwise return the input expression.

def Mathlib.Meta.FunProp.Mor.getAppArgs E1 #

Lean.Expr → Lean.MetaM (Array Mathlib.Meta.FunProp.Mor.Arg)

Given f a₁ a₂ ... aₙ, returns #[a₁, ..., aₙ] where f can be bundled morphism.

def Mathlib.Meta.FunProp.Mor.mkAppN E1 #

Lean.Expr → Array Mathlib.Meta.FunProp.Mor.Arg → Lean.Expr

mkAppN f #[a₀, ..., aₙ] ==> f a₀ a₁ .. aₙ where f can be bundled morphism.