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
.
Is name
a coerction from some function space to functiosn?
Equations
- One or more equations did not get rendered due to their size.
Instances For
Is e
a coerction from some function space to functiosn?
Equations
- One or more equations did not get rendered due to their size.
Instances For
Is e
morphism application?
Equations
- One or more equations did not get rendered due to their size.
Instances For
Weak normal head form of an expression involving morphism applications. Additionally, pred
can specify which when to unfold definitions.
For example calling this on coe (f a) b
will put f
in weak normal head form instead of coe
.
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
.
Equations
- Mathlib.Meta.FunProp.Mor.whnf e cfg = Mathlib.Meta.FunProp.Mor.whnfPred e (fun (x : Lean.Expr) => pure false) cfg
Instances For
Equations
- Mathlib.Meta.FunProp.Mor.instInhabitedArg = { default := { expr := default, coe := default } }
Morphism application
Equations
- Mathlib.Meta.FunProp.Mor.app f arg = match arg.coe with | none => Lean.Expr.app f arg.expr | some coe => Lean.Expr.app (Lean.Expr.app coe f) arg.expr
Instances For
Given e = f a₁ a₂ ... aₙ
, returns k f #[a₁, ..., aₙ]
where f
can be bundled morphism.
Equations
Instances For
If the given expression is a sequence of morphism applications f a₁ .. aₙ
, return f
.
Otherwise return the input expression.
Equations
- One or more equations did not get rendered due to their size.
- Mathlib.Meta.FunProp.Mor.getAppFn (Lean.Expr.mdata data b) = Mathlib.Meta.FunProp.Mor.getAppFn b
- Mathlib.Meta.FunProp.Mor.getAppFn (Lean.Expr.app f arg) = Mathlib.Meta.FunProp.Mor.getAppFn f
- Mathlib.Meta.FunProp.Mor.getAppFn e = pure e
Instances For
Given f a₁ a₂ ... aₙ
, returns #[a₁, ..., aₙ]
where f
can be bundled morphism.
Equations
- Mathlib.Meta.FunProp.Mor.getAppArgs e = Mathlib.Meta.FunProp.Mor.withApp e fun (x : Lean.Expr) (xs : Array Mathlib.Meta.FunProp.Mor.Arg) => pure xs
Instances For
mkAppN f #[a₀, ..., aₙ]
==> f a₀ a₁ .. aₙ
where f
can be bundled morphism.
Equations
- One or more equations did not get rendered due to their size.