The areas / V34. The tactics of Mathlib
Mathlib.Tactic.CategoryTheory.ToApp
7 declarations. Mathlib docs · Source
The to_app attribute
Adding @[to_app] to a lemma named F of shape ∀ .., η = θ, where η θ : f ⟶ g are 2-morphisms
in some bicategory, create a new lemma named F_app. This lemma is obtained by first specializing
the bicategory in which the equality is taking place to Cat, then applying toNatTrans_congr and
NatTrans.congr_app to obtain a proof of
∀ ... (X : Cat), η.toNatTrans.app X = θ.toNatTrans.app X, and finally simplifying the conclusion
using some basic lemmas in the bicategory Cat: Cat.whiskerLeft_app, Cat.whiskerRight_app,
Cat.id_app, Cat.comp_app and Cat.eqToHom_app
So, for example, if the conclusion of F is f ◁ η = θ then the conclusion of F_app will be
η.toNatTrans.app (f.obj X) = θ.toNatTrans.app X.
This is useful for automatically generating lemmas that can be applied to expressions of 1-morphisms
in Cat which contain components of 2-morphisms.
There is also a term elaborator to_app_of% t for use within proofs.
def Mathlib.Tactic.CategoryTheory.ToApp.catAppSimp E1 #
Lean.Expr → Lean.MetaM Lean.Meta.Simp.Result
Simplify an expression in Cat using basic properties of NatTrans.app.
def Mathlib.Tactic.CategoryTheory.ToApp.toCatExpr E1 #
Lean.Expr → Lean.MetaM Lean.Expr
Given a term of type ∀ ..., η = θ, where η θ : f ⟶ g are 2-morphisms in some bicategory
B, which is bound by the ∀ binder, get the corresponding equation in the bicategory Cat.
It is important here that the levels in the term are level metavariables, as otherwise these will
not be reassignable to the corresponding levels of Cat.
theorem Mathlib.Tactic.CategoryTheory.ToApp.toNatTrans_congr E1 #
∀ {C D : CategoryTheory.Cat} {F G : C ⟶ D} {η θ : F ⟶ G}, η = θ → η.toNatTrans = θ.toNatTrans
def Mathlib.Tactic.CategoryTheory.ToApp.toNatTransExpr E1 #
Lean.Expr → Lean.MetaM Lean.Expr
Given morphisms f g : C ⟶ D in the bicategory Cat, and an equation η = θ between 2-morphisms
(possibly after a ∀ binder), produce the equation η.toNatTrans = θ.toNatTrans
def Mathlib.Tactic.CategoryTheory.ToApp.toAppExpr E1 #
Lean.Expr → Lean.MetaM Lean.Expr
Given functors F G : C ⥤ D, and an equation η = θ between natural transformations
(possibly after a ∀ binder), produce the equation ∀ (X : C), η.app X = θ.app X, and simplify
it using basic lemmas about NatTrans.app.
def Mathlib.Tactic.CategoryTheory.ToApp.to_app E1 #
Lean.ParserDescr
Adding @[to_app] to a lemma named F of shape ∀ .., η = θ, where η θ : f ⟶ g are 2-morphisms
in some bicategory, create a new lemma named F_app. This lemma is obtained by first specializing
the bicategory in which the equality is taking place to Cat, then applying toNatTrans_congr and
NatTrans.congr_app to obtain a proof of ∀ ... (X : Cat), η.app X = θ.app X, and finally
simplifying the conclusion using some basic lemmas in the bicategory Cat (see catAppSimp for
the list of these).
So, for example, if the conclusion of F is f ◁ η = θ then the conclusion of F_app will be
η.app (f.obj X) = θ.app X.
This is useful for automatically generating lemmas that can be applied to expressions of 1-morphisms
in Cat which contain components of 2-morphisms.
Note that if you want both the lemma and the new lemma to be simp lemmas, you should tag the lemma
@[to_app (attr := simp)]. The variant @[simp, to_app] on a lemma F will tag F with
@[simp], but not F_app (this is sometimes useful).
def Mathlib.Tactic.CategoryTheory.ToApp.«termTo_app_of%_» E1 #
Lean.ParserDescr
Given an equation t of the form η = θ between 2-morphisms f ⟶ g with f g : C ⟶ D in the
bicategory Cat (possibly after a ∀ binder), to_app_of% t produces the equation
∀ (X : C), η.app X = θ.app X (where X is an object in the domain of f and g), and simplifies
it suitably using basic lemmas about NatTrans.app.