@@ -17,13 +17,18 @@ does not make sense when the domain and/or codomain of `φ` and `f` are not defi
1717
1818## Main definition
1919
20- Given morphism `φ : a ⟶ b` in `𝒳` and `f : R ⟶ S` in `𝒮`, `p.IsHomLift f φ` is a class, defined
21- using the auxiliary inductive type `IsHomLiftAux` which expresses the fact that `f = p(φ)`.
20+ Given morphism `φ : a ⟶ b` in `𝒳` and `f : R ⟶ S` in `𝒮`, `p.IsHomLift f φ` is a class
21+ which expresses the fact that `f = p(φ)`.
2222
2323We also define a macro `subst_hom_lift p f φ` which can be used to substitute `f` with `p(φ)` in a
24- goal, this tactic is just short for `obtain ⟨⟩ := Functor.IsHomLift.cond (p:=p) (f:=f) (φ:= φ)`, and
24+ goal, this tactic is just short for `obtain ⟨⟩ := inferInstanceAs (p.IsHomLift f φ)`, and
2525it is used to make the code more readable.
2626
27+ ## Implementation
28+ The class `IsHomLift` is defined as an inductive with the single constructor
29+ `.map (φ : a ⟶ b) : IsHomLift p (p.map φ) φ`, similar to how `Eq a b` has the single constructor
30+ `.rfl (a : α) : Eq a a`.
31+
2732-/
2833
2934universe u₁ v₁ u₂ v₂
@@ -34,10 +39,6 @@ variable {𝒮 : Type u₁} {𝒳 : Type u₂} [Category.{v₁} 𝒳] [Category.
3439
3540namespace CategoryTheory
3641
37- /-- Helper-type for defining `IsHomLift`. -/
38- inductive IsHomLiftAux : ∀ {R S : 𝒮} {a b : 𝒳} (_ : R ⟶ S) (_ : a ⟶ b), Prop
39- | map {a b : 𝒳} (φ : a ⟶ b) : IsHomLiftAux (p.map φ) φ
40-
4142/-- Given a functor `p : 𝒳 ⥤ 𝒮`, an arrow `φ : a ⟶ b` in `𝒳` and an arrow `f : R ⟶ S` in `𝒮`,
4243`p.IsHomLift f φ` expresses the fact that `φ` lifts `f` through `p`.
4344This is often drawn as:
@@ -48,19 +49,18 @@ This is often drawn as:
4849 v v
4950 R --f--> S
5051``` -/
51- class Functor.IsHomLift {R S : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) : Prop where
52- cond : IsHomLiftAux p f φ
52+ class inductive Functor.IsHomLift : ∀ {R S : 𝒮} {a b : 𝒳} (_ : R ⟶ S) (_ : a ⟶ b), Prop
53+ | map {a b : 𝒳} (φ : a ⟶ b) : IsHomLift (p.map φ) φ
5354
5455/-- `subst_hom_lift p f φ` tries to substitute `f` with `p(φ)` by using `p.IsHomLift f φ` -/
5556macro "subst_hom_lift" p:term:max f:term:max φ:term:max : tactic =>
56- `(tactic| obtain ⟨⟩ := Functor.IsHomLift.cond (p := $p) (f := $f) (φ := $φ))
57+ `(tactic| obtain ⟨⟩ := inferInstanceAs ( Functor.IsHomLift $p $f $φ))
5758
5859namespace IsHomLift
5960
6061/-- For any arrow `φ : a ⟶ b` in `𝒳`, `φ` lifts the arrow `p.map φ` in the base `𝒮`. -/
6162@[simp]
62- instance map {a b : 𝒳} (φ : a ⟶ b) : p.IsHomLift (p.map φ) φ where
63- cond := by constructor
63+ instance map {a b : 𝒳} (φ : a ⟶ b) : p.IsHomLift (p.map φ) φ := .map φ
6464
6565@[simp]
6666instance (a : 𝒳) : p.IsHomLift (𝟙 (p.obj a)) (𝟙 a) := by
0 commit comments