Article III: Examples of categories
1. The category 𝑺↻ of endomaps of sets
The category 𝑺↻ of endomaps of sets is described on pp. 136–137. We implement this category in Lean in a similar way to the category of algebraic objects that we developed in the solution to Session 4, Exercise 1, except we use types instead of sets for clarity of presentation going forward. Our Lean implementation follows closely the definition of category given on p. 21, so we reproduce that definition here, interspersed with our comments (italicised) and the corresponding Lean code.
A category consists of the DATA:
(1) OBJECTS
An object in the category 𝑺↻ is a type equipped with an endomap.
structure SetWithEndomap where
carrier : Type
toEnd : carrier ⟶ carrier
(2) MAPS
A map in the category 𝑺↻ is one which respects the given structure — i.e., a morphism which commutes. Note that we use a Lean subtype here instead of a Lean structure.
def SetWithEndomapHom (X Y : SetWithEndomap) := {
f : X.carrier ⟶ Y.carrier //
f ⊚ X.toEnd = Y.toEnd ⊚ f -- commutes
}
(3) For each map f, one object as DOMAIN of f and one object as CODOMAIN of f
As given above, a SetWithEndomapHom is a subtype of morphisms between the underlying types of two SetWithEndomap objects, so the domain and codomain are already specified.
(4) For each object A an IDENTITY MAP, which has domain A and codomain A
We define the identity map within the SetWithEndomapHom namespace to facilitate code re-use in some closely related category instances that follow shortly.
def SetWithEndomapHom.id (X : SetWithEndomap)
: SetWithEndomapHom X X := ⟨𝟙 X.carrier, rfl⟩
(5) For each pair of maps {A \xrightarrow{f} B \xrightarrow{g} C}, a COMPOSITE MAP map {A \xrightarrow{g \;\mathrm{following}\; f} C}
We likewise define composition of maps within the SetWithEndomapHom namespace.
def SetWithEndomapHom.comp {X Y Z : SetWithEndomap}
(f : SetWithEndomapHom X Y) (g : SetWithEndomapHom Y Z)
: SetWithEndomapHom X Z := ⟨
g.val ⊚ f.val,
X:SetWithEndomapY:SetWithEndomapZ:SetWithEndomapf:SetWithEndomapHom X Yg:SetWithEndomapHom Y Z⊢ (↑g ⊚ ↑f) ⊚ X.toEnd = Z.toEnd ⊚ ↑g ⊚ ↑f
X:SetWithEndomapY:SetWithEndomapZ:SetWithEndomapf:SetWithEndomapHom X Yg:SetWithEndomapHom Y Zhf_comm:↑f ⊚ X.toEnd = Y.toEnd ⊚ ↑f⊢ (↑g ⊚ ↑f) ⊚ X.toEnd = Z.toEnd ⊚ ↑g ⊚ ↑f
X:SetWithEndomapY:SetWithEndomapZ:SetWithEndomapf:SetWithEndomapHom X Yg:SetWithEndomapHom Y Zhf_comm:↑f ⊚ X.toEnd = Y.toEnd ⊚ ↑fhg_comm:↑g ⊚ Y.toEnd = Z.toEnd ⊚ ↑g⊢ (↑g ⊚ ↑f) ⊚ X.toEnd = Z.toEnd ⊚ ↑g ⊚ ↑f
All goals completed! 🐙
⟩
We can now instantiate the category 𝑺↻.
instance instCatSetWithEndomap : Category SetWithEndomap where
Hom := SetWithEndomapHom
id := SetWithEndomapHom.id
comp := SetWithEndomapHom.comp
satisfying the following RULES:
(i) IDENTITY LAWS: If {A \xrightarrow{f} B}, then {1_B \circ f = f} and {f \circ 1_A = f}
The identity laws are given by the methods Category.comp_id and Category.id_comp, respectively, which Lean is able to discharge automatically using tactics.
(ii) ASSOCIATIVE LAW: If {A \xrightarrow{f} B \xrightarrow{g} C \xrightarrow{h} D}, then {(h \circ g) \circ f = h \circ (g \circ f)}
The associative law is given by the method Category.assoc, which Lean is likewise able to discharge automatically.
For good measure, we make the category 𝑺↻ a concrete category.
instance {X Y : SetWithEndomap}
: FunLike (instCatSetWithEndomap.Hom X Y) X.carrier
Y.carrier where
coe f := f.val
coe_injective := fun _ _ h ↦ Subtype.ext (by X:SetWithEndomapY:SetWithEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝⊢ ↑x✝¹ = ↑x✝
ext x X:SetWithEndomapY:SetWithEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝x:X.carrier⊢ (ConcreteCategory.hom ↑x✝¹).toFun x = (ConcreteCategory.hom ↑x✝).toFun x
exact congrFun h x All goals completed! 🐙
)
instance
: ConcreteCategory SetWithEndomap instCatSetWithEndomap.Hom where
hom f := f
ofHom f := f
Show that if both
X^{↻\alpha} \xrightarrow{f} Y^{↻\beta}
...and also
Y^{↻\beta} \xrightarrow{g} Z^{↻\gamma}
are maps in 𝑺↻, then the composite {g \circ f} in 𝑺 actually defines another map in 𝑺↻. Hint: What should the domain and the codomain (in the sense of 𝑺↻) of this third map be? Transfer the definition (given for the case f) to the cases g and {g \circ f}; then calculate that the equations satisfied by g and f imply the desired equation for {g \circ f}.
Solution: Exercise 1
Using only the category Type, we have
example {X Y Z : Type}
(α : X ⟶ X) (β : Y ⟶ Y) (γ : Z ⟶ Z)
(f : X ⟶ Y) (hf_comm : f ⊚ α = β ⊚ f)
(g : Y ⟶ Z) (hg_comm : g ⊚ β = γ ⊚ g)
: (g ⊚ f) ⊚ α = γ ⊚ (g ⊚ f) := by X:TypeY:TypeZ:Typeα:X ⟶ Xβ:Y ⟶ Yγ:Z ⟶ Zf:X ⟶ Yhf_comm:f ⊚ α = β ⊚ fg:Y ⟶ Zhg_comm:g ⊚ β = γ ⊚ g⊢ (g ⊚ f) ⊚ α = γ ⊚ g ⊚ f
-- cf. SetWithEndomapHom.comp above
rw [← Category.assoc, X:TypeY:TypeZ:Typeα:X ⟶ Xβ:Y ⟶ Yγ:Z ⟶ Zf:X ⟶ Yhf_comm:f ⊚ α = β ⊚ fg:Y ⟶ Zhg_comm:g ⊚ β = γ ⊚ g⊢ g ⊚ f ⊚ α = γ ⊚ g ⊚ f hf_comm, X:TypeY:TypeZ:Typeα:X ⟶ Xβ:Y ⟶ Yγ:Z ⟶ Zf:X ⟶ Yhf_comm:f ⊚ α = β ⊚ fg:Y ⟶ Zhg_comm:g ⊚ β = γ ⊚ g⊢ g ⊚ β ⊚ f = γ ⊚ g ⊚ f Category.assoc, X:TypeY:TypeZ:Typeα:X ⟶ Xβ:Y ⟶ Yγ:Z ⟶ Zf:X ⟶ Yhf_comm:f ⊚ α = β ⊚ fg:Y ⟶ Zhg_comm:g ⊚ β = γ ⊚ g⊢ (g ⊚ β) ⊚ f = γ ⊚ g ⊚ f hg_comm, X:TypeY:TypeZ:Typeα:X ⟶ Xβ:Y ⟶ Yγ:Z ⟶ Zf:X ⟶ Yhf_comm:f ⊚ α = β ⊚ fg:Y ⟶ Zhg_comm:g ⊚ β = γ ⊚ g⊢ (γ ⊚ g) ⊚ f = γ ⊚ g ⊚ f
← Category.assoc X:TypeY:TypeZ:Typeα:X ⟶ Xβ:Y ⟶ Yγ:Z ⟶ Zf:X ⟶ Yhf_comm:f ⊚ α = β ⊚ fg:Y ⟶ Zhg_comm:g ⊚ β = γ ⊚ g⊢ γ ⊚ g ⊚ f = γ ⊚ g ⊚ f] All goals completed! 🐙
Using instead our implementation of the category 𝑺↻ of endomaps of sets gives
example {X Y Z : SetWithEndomap} (f : X ⟶ Y) (g : Y ⟶ Z) : X ⟶ Z :=
g ⊚ f
3. Two subcategories of 𝑺↻
We implement the category 𝑺ᵉ of idempotent endomaps of sets, described on p. 138. We re-use code from our earlier implementation of the category 𝑺↻.
structure SetWithIdemEndomap extends SetWithEndomap where
idem : toEnd ⊚ toEnd = toEnd
instance instCatSetWithIdemEndomap : Category SetWithIdemEndomap where
Hom X Y := SetWithEndomapHom X.toSetWithEndomap Y.toSetWithEndomap
id X := SetWithEndomapHom.id X.toSetWithEndomap
comp := SetWithEndomapHom.comp
instance {X Y : SetWithIdemEndomap}
: FunLike (instCatSetWithIdemEndomap.Hom X Y) X.carrier
Y.carrier where
coe f := f.val
coe_injective := fun _ _ h ↦ Subtype.ext (by X:SetWithIdemEndomapY:SetWithIdemEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝⊢ ↑x✝¹ = ↑x✝
ext x X:SetWithIdemEndomapY:SetWithIdemEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝x:X.carrier⊢ (ConcreteCategory.hom ↑x✝¹).toFun x = (ConcreteCategory.hom ↑x✝).toFun x
exact congrFun h x All goals completed! 🐙
)
instance
: ConcreteCategory SetWithIdemEndomap instCatSetWithIdemEndomap.Hom
where
hom f := f
ofHom f := f
We implement the category 𝑺◯ of invertible endomaps of sets (automorphisms of sets, permutations), described on p. 138.
structure SetWithInvEndomap extends SetWithEndomap where
inv : ∃ inv, inv ⊚ toEnd = 𝟙 carrier ∧ toEnd ⊚ inv = 𝟙 carrier
instance instCatSetWithInvEndomap : Category SetWithInvEndomap where
Hom X Y := SetWithEndomapHom X.toSetWithEndomap Y.toSetWithEndomap
id X := SetWithEndomapHom.id X.toSetWithEndomap
comp := SetWithEndomapHom.comp
instance {X Y : SetWithInvEndomap}
: FunLike (instCatSetWithInvEndomap.Hom X Y) X.carrier
Y.carrier where
coe f := f.val
coe_injective := fun _ _ h ↦ Subtype.ext (by X:SetWithInvEndomapY:SetWithInvEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝⊢ ↑x✝¹ = ↑x✝
ext x X:SetWithInvEndomapY:SetWithInvEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝x:X.carrier⊢ (ConcreteCategory.hom ↑x✝¹).toFun x = (ConcreteCategory.hom ↑x✝).toFun x
exact congrFun h x All goals completed! 🐙
)
instance
: ConcreteCategory SetWithInvEndomap instCatSetWithInvEndomap.Hom
where
hom f := f
ofHom f := f
4. Categories of endomaps
The category 𝑪↻ of endomaps is described on pp. 138–139. Since we have implemented 𝑺↻ using types instead of sets, 𝑪↻ and 𝑺↻ are equivalent.
abbrev Endomap := SetWithEndomap
The category 𝑪ᵉ of idempotents, described on pp. 138–139, is likewise equivalent to 𝑺ᵉ.
abbrev IdemEndomap := SetWithIdemEndomap
The category 𝑪◯ of isomorphic endomaps (automorphisms), described on pp. 138–139, is equivalent to 𝑺◯.
abbrev InvEndomap := SetWithInvEndomap
We implement the category 𝑪ᶿ of involutions, described on pp. 138–139.
structure InvolEndomap extends SetWithInvEndomap where
invol : toEnd ⊚ toEnd = 𝟙 carrier
instance instCatInvolEndomap : Category InvolEndomap where
Hom X Y := SetWithEndomapHom X.toSetWithEndomap Y.toSetWithEndomap
id X := SetWithEndomapHom.id X.toSetWithEndomap
comp := SetWithEndomapHom.comp
instance {X Y : InvolEndomap}
: FunLike (instCatInvolEndomap.Hom X Y) X.carrier Y.carrier where
coe f := f.val
coe_injective := fun _ _ h ↦ Subtype.ext (by X:InvolEndomapY:InvolEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝⊢ ↑x✝¹ = ↑x✝
ext x X:InvolEndomapY:InvolEndomapx✝¹:X ⟶ Yx✝:X ⟶ Yh:(fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝¹ = (fun f ↦ ⇑(ConcreteCategory.hom ↑f)) x✝x:X.carrier⊢ (ConcreteCategory.hom ↑x✝¹).toFun x = (ConcreteCategory.hom ↑x✝).toFun x
exact congrFun h x All goals completed! 🐙
)
instance : ConcreteCategory InvolEndomap instCatInvolEndomap.Hom where
hom f := f
ofHom f := f
What can you prove about an idempotent which has a retraction?
Solution: Exercise 2
We can prove that the only idempotent which has a retraction is the identity.
example {𝒞 : Type u} [Category.{v, u} 𝒞] {A : 𝒞} {α β : A ⟶ A}
(h_idem : α ⊚ α = α) (h_retraction : β ⊚ α = 𝟙 A)
: α = 𝟙 A := by 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ α = 𝟙 A
calc
α = 𝟙 A ⊚ α := by 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ α = 𝟙 A ⊚ α rw [Category.comp_id 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ α = α] All goals completed! 🐙
_ = (β ⊚ α) ⊚ α := by 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ 𝟙 A ⊚ α = (β ⊚ α) ⊚ α rw [h_retraction 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ 𝟙 A ⊚ α = 𝟙 A ⊚ α] All goals completed! 🐙
_ = β ⊚ α ⊚ α := by 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ (β ⊚ α) ⊚ α = β ⊚ α ⊚ α rw [Category.assoc 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ (β ⊚ α) ⊚ α = (β ⊚ α) ⊚ α] All goals completed! 🐙
_ = β ⊚ α := by 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ β ⊚ α ⊚ α = β ⊚ α rw [h_idem 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ β ⊚ α = β ⊚ α] All goals completed! 🐙
_ = 𝟙 A := by 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ β ⊚ α = 𝟙 A rw [h_retraction 𝒞:Type uinst✝:Category.{v, u} 𝒞A:𝒞α:A ⟶ Aβ:A ⟶ Ah_idem:α ⊚ α = αh_retraction:β ⊚ α = 𝟙 A⊢ 𝟙 A = 𝟙 A] All goals completed! 🐙
A finite set A has an even number of elements iff (i.e. if and only if) there is an involution on A with no fixed points; A has an odd number of elements iff there is an involution on A with just one fixed point. Here we rely on known ideas about numbers — but these properties can be used as a definition of oddness or evenness that can be verified without counting if the structure of a real situation suggests an involution. The map 'mate of' in a group A of socks is an obvious example.
Solution: Exercise 3
TODO Exercise III.3
In Exercises 4–7 that follow, we use the type \mathbb{Z} instead of the set \mathbb{Z} (and hence the concrete category Type instead of the category 𝑺 of sets).
If {\alpha(x) = -x} is considered as an endomap of \mathbb{Z}, is \alpha an involution or an idempotent? What are its fixed points?
Solution: Exercise 4
Define the endomap {\alpha(x) = -x} on \mathbb{Z}.
def α : ℤ ⟶ ℤ := ↾fun x ↦ -x
\alpha is not an idempotent.
open ConcreteCategory in
example : ¬(IsIdempotent α) := by ⊢ ¬IsIdempotent α
by_contra h h:IsIdempotent α⊢ False
have h_contra : (α ⊚ α) 1 = α 1 := congr_hom h.idem 1 h:IsIdempotent αh_contra:(hom (α ⊚ α)) 1 = (hom α) 1⊢ False
dsimp [α] at h_contra h:IsIdempotent αh_contra:1 = -1⊢ False
contradiction All goals completed! 🐙
\alpha is an involution.
example : IsInvolution α := {
invol := by ⊢ α ⊚ α = 𝟙 ℤ
ext x x:ℤ⊢ (ConcreteCategory.hom (α ⊚ α)).toFun x = (ConcreteCategory.hom (𝟙 ℤ)).toFun x
change -(-x) = x x:ℤ⊢ - -x = x
ring All goals completed! 🐙
}
The only fixed point of \alpha is 0.
example {x : ℤ} : Function.IsFixedPt α x ↔ x = 0 := by x:ℤ⊢ Function.IsFixedPt (⇑(ConcreteCategory.hom α)) x ↔ x = 0
dsimp [Function.IsFixedPt, α] x:ℤ⊢ -x = x ↔ x = 0
constructor mp x:ℤ⊢ -x = x → x = 0mpr x:ℤ⊢ x = 0 → -x = x
· mp x:ℤ⊢ -x = x → x = 0 exact eq_zero_of_neg_eq All goals completed! 🐙
· mpr x:ℤ⊢ x = 0 → -x = x intro hx mpr x:ℤhx:x = 0⊢ -x = x
rw [hx mpr x:ℤhx:x = 0⊢ -0 = 0] mpr x:ℤhx:x = 0⊢ -0 = 0
exact neg_zero All goals completed! 🐙
Note that since the converse of eq_zero_of_neg_eq is true, we can also state the following:
theorem _root_.eq_zero_iff_neg_eq {α : Type u}
[AddCommGroup α] [LinearOrder α] [IsOrderedAddMonoid α]
{a : α} : -a = a ↔ a = 0 := by α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:α⊢ -a = a ↔ a = 0
constructor mp α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:α⊢ -a = a → a = 0mpr α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:α⊢ a = 0 → -a = a
· mp α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:α⊢ -a = a → a = 0 exact eq_zero_of_neg_eq All goals completed! 🐙
· mpr α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:α⊢ a = 0 → -a = a intro h mpr α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:αh:a = 0⊢ -a = a
rw [h mpr α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:αh:a = 0⊢ -0 = 0] mpr α:Type uinst✝²:AddCommGroup αinst✝¹:LinearOrder αinst✝:IsOrderedAddMonoid αa:αh:a = 0⊢ -0 = 0
exact neg_zero All goals completed! 🐙
We can then use this new lemma to simplify the proof in the previous example.
example {x : ℤ} : Function.IsFixedPt α x ↔ x = 0 := eq_zero_iff_neg_eq
Same questions as above, if instead {\alpha(x) = |x|}, the absolute value.
Solution: Exercise 5
Define the endomap {\alpha(x) = |x|} on \mathbb{Z}.
def α : ℤ ⟶ ℤ := ↾fun x ↦ |x|
\alpha is an idempotent.
example : IsIdempotent α := {
idem := by ⊢ α ⊚ α = α
ext x x:ℤ⊢ (ConcreteCategory.hom (α ⊚ α)).toFun x = (ConcreteCategory.hom α).toFun x
change |(|x|)| = |x| x:ℤ⊢ |(|x|)| = |x|
rw [abs_abs x:ℤ⊢ |x| = |x|] All goals completed! 🐙
}
\alpha is not an involution.
open ConcreteCategory in
example : ¬(IsInvolution α) := by ⊢ ¬IsInvolution α
by_contra h h:IsInvolution α⊢ False
have h_contra : (α ⊚ α) (-1) = (𝟙 ℤ) (-1) :=
congr_hom h.invol (-1) h:IsInvolution αh_contra:(hom (α ⊚ α)) (-1) = (hom (𝟙 ℤ)) (-1)⊢ False
dsimp [α] at h_contra h:IsInvolution αh_contra:|(|(-1)|)| = -1⊢ False
contradiction All goals completed! 🐙
The fixed points of \alpha are all the points greater than or equal to 0.
example {x : ℤ} : Function.IsFixedPt α x ↔ 0 ≤ x := by x:ℤ⊢ Function.IsFixedPt (⇑(ConcreteCategory.hom α)) x ↔ 0 ≤ x
dsimp [Function.IsFixedPt, α] x:ℤ⊢ |x| = x ↔ 0 ≤ x
constructor mp x:ℤ⊢ |x| = x → 0 ≤ xmpr x:ℤ⊢ 0 ≤ x → |x| = x
· mp x:ℤ⊢ |x| = x → 0 ≤ x intro hx mp x:ℤhx:|x| = x⊢ 0 ≤ x
rw [← hx mp x:ℤhx:|x| = x⊢ 0 ≤ |x|] mp x:ℤhx:|x| = x⊢ 0 ≤ |x|
exact abs_nonneg x All goals completed! 🐙
· mpr x:ℤ⊢ 0 ≤ x → |x| = x exact abs_of_nonneg All goals completed! 🐙
Note that since the converse of abs_of_nonneg is true with the additional assumption [AddRightMono α], we can state the following:
theorem _root_.abs_iff_nonneg {α : Type u_1}
[Lattice α] [AddGroup α]
{a : α} [AddLeftMono α] [AddRightMono α] : 0 ≤ a ↔ |a| = a := by α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono α⊢ 0 ≤ a ↔ |a| = a
constructor mp α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono α⊢ 0 ≤ a → |a| = ampr α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono α⊢ |a| = a → 0 ≤ a
· mp α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono α⊢ 0 ≤ a → |a| = a exact abs_of_nonneg All goals completed! 🐙
· mpr α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono α⊢ |a| = a → 0 ≤ a intro h mpr α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono αh:|a| = a⊢ 0 ≤ a
rw [← h mpr α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono αh:|a| = a⊢ 0 ≤ |a|] mpr α:Type u_1inst✝³:Lattice αinst✝²:AddGroup αa:αinst✝¹:AddLeftMono αinst✝:AddRightMono αh:|a| = a⊢ 0 ≤ |a|
exact abs_nonneg a All goals completed! 🐙
We can then use this new lemma to simplify the proof in the previous example.
example {x : ℤ} : Function.IsFixedPt α x ↔ 0 ≤ x := abs_iff_nonneg.symm
If \alpha is the endomap of \mathbb{Z}, defined by the formula {\alpha(x) = x + 3}, is \alpha an automorphism? If so, write the formula for its inverse.
Solution: Exercise 6
Define the endomap {\alpha(x) = x + 3} on \mathbb{Z}.
def α : ℤ ⟶ ℤ := ↾fun x ↦ x + 3
\alpha is an automorphism, with inverse {\alpha^{-1}(x) = x - 3}.
example : IsIso α := by ⊢ IsIso α
let αinv : ℤ ⟶ ℤ := ↾fun x ↦ x - 3 αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ IsIso α
exact {
out := by αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ ∃ inv, inv ⊚ α = 𝟙 ℤ ∧ α ⊚ inv = 𝟙 ℤ
use αinv h αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ αinv ⊚ α = 𝟙 ℤ ∧ α ⊚ αinv = 𝟙 ℤ
constructor h.left αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ αinv ⊚ α = 𝟙 ℤh.right αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ α ⊚ αinv = 𝟙 ℤ
· h.left αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ αinv ⊚ α = 𝟙 ℤ ext x h.left αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3x:ℤ⊢ (ConcreteCategory.hom (αinv ⊚ α)).toFun x = (ConcreteCategory.hom (𝟙 ℤ)).toFun x
change (x + 3) - 3 = x h.left αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3x:ℤ⊢ x + 3 - 3 = x
ring All goals completed! 🐙
· h.right αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3⊢ α ⊚ αinv = 𝟙 ℤ ext x h.right αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3x:ℤ⊢ (ConcreteCategory.hom (α ⊚ αinv)).toFun x = (ConcreteCategory.hom (𝟙 ℤ)).toFun x
change (x - 3) + 3 = x h.right αinv:ℤ ⟶ ℤ := ↾fun x ↦ x - 3x:ℤ⊢ x - 3 + 3 = x
ring All goals completed! 🐙
}
Same questions for {\alpha(x) = 5x}.
Solution: Exercise 7
Define the endomap {\alpha(x) = 5x} on \mathbb{Z}.
def α : ℤ ⟶ ℤ := ↾fun x ↦ 5 * x
\alpha is not an automorphism.
open ConcreteCategory in
example : ¬(IsIso α) := by ⊢ ¬IsIso α
by_contra h h:IsIso α⊢ False
obtain ⟨αinv, _, h_right_inv⟩ := h.out h:IsIso ααinv:ℤ ⟶ ℤleft✝:αinv ⊚ α = 𝟙 ℤh_right_inv:α ⊚ αinv = 𝟙 ℤ⊢ False
have h_contra₁ : (α ⊚ αinv) 1 = (𝟙 ℤ) 1 := congr_hom h_right_inv 1 h:IsIso ααinv:ℤ ⟶ ℤleft✝:αinv ⊚ α = 𝟙 ℤh_right_inv:α ⊚ αinv = 𝟙 ℤh_contra₁:(hom (α ⊚ αinv)) 1 = (hom (𝟙 ℤ)) 1⊢ False
have h_contra₂ : (5 : ℤ) ∣ 1 := by ⊢ ¬IsIso α
use αinv 1 h h:IsIso ααinv:ℤ ⟶ ℤleft✝:αinv ⊚ α = 𝟙 ℤh_right_inv:α ⊚ αinv = 𝟙 ℤh_contra₁:(hom (α ⊚ αinv)) 1 = (hom (𝟙 ℤ)) 1⊢ 1 = 5 * (hom αinv) 1
exact h_contra₁.symm h:IsIso ααinv:ℤ ⟶ ℤleft✝:αinv ⊚ α = 𝟙 ℤh_right_inv:α ⊚ αinv = 𝟙 ℤh_contra₁:(hom (α ⊚ αinv)) 1 = (hom (𝟙 ℤ)) 1h_contra₂:5 ∣ 1⊢ False
contradiction All goals completed! 🐙
Show that both 𝑪ᵉ, 𝑪ᶿ are subcategories of the category [whose objects are all the endomaps \alpha in 𝑪 which satisfy {\alpha \circ \alpha \circ \alpha = \alpha}], i.e. that either an idempotent or an involution will satisfy {\alpha^3 = \alpha}.
Solution: Exercise 8
We show that the category 𝑪ᵉ of idempotents is a subcategory of the category given in the question.
example {α : IdemEndomap}
: α.toEnd ⊚ α.toEnd ⊚ α.toEnd = α.toEnd := by α:IdemEndomap⊢ α.toEnd ⊚ α.toEnd ⊚ α.toEnd = α.toEnd
repeat rw [α.idem α:IdemEndomap⊢ α.toEnd ⊚ α.toEnd = α.toEnd] All goals completed! 🐙
Or, more generally, that an idempotent will satisfy {\alpha^3 = \alpha}.
example {𝒞 : Type u} [Category.{v, u} 𝒞] {A : 𝒞}
(α : A ⟶ A) [IsIdempotent α] : α ⊚ α ⊚ α = α := by 𝒞:Type uinst✝¹:Category.{v, u} 𝒞A:𝒞α:A ⟶ Ainst✝:IsIdempotent α⊢ α ⊚ α ⊚ α = α
repeat rw [IsIdempotent.idem 𝒞:Type uinst✝¹:Category.{v, u} 𝒞A:𝒞α:A ⟶ Ainst✝:IsIdempotent α⊢ α ⊚ α = α] All goals completed! 🐙
We show that the category 𝑪ᶿ of involutions is a subcategory of the category given in the question.
example {α : InvolEndomap}
: α.toEnd ⊚ α.toEnd ⊚ α.toEnd = α.toEnd := by α:InvolEndomap⊢ α.toEnd ⊚ α.toEnd ⊚ α.toEnd = α.toEnd
rw [α.invol, α:InvolEndomap⊢ α.toEnd ⊚ 𝟙 α.carrier = α.toEnd Category.id_comp α:InvolEndomap⊢ α.toEnd = α.toEnd] All goals completed! 🐙
Or, more generally, that an involution will satisfy {\alpha^3 = \alpha}.
example {𝒞 : Type u} [Category.{v, u} 𝒞] {A : 𝒞}
(α : A ⟶ A) [IsInvolution α] : α ⊚ α ⊚ α = α := by 𝒞:Type uinst✝¹:Category.{v, u} 𝒞A:𝒞α:A ⟶ Ainst✝:IsInvolution α⊢ α ⊚ α ⊚ α = α
rw [IsInvolution.invol, 𝒞:Type uinst✝¹:Category.{v, u} 𝒞A:𝒞α:A ⟶ Ainst✝:IsInvolution α⊢ α ⊚ 𝟙 A = α Category.id_comp 𝒞:Type uinst✝¹:Category.{v, u} 𝒞A:𝒞α:A ⟶ Ainst✝:IsInvolution α⊢ α = α] All goals completed! 🐙
In [the category Type], consider the endomap \alpha of a three-element [type A] defined by...
inductive A
| a₁ | a₂ | a₃
def α : A ⟶ A := ↾fun
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂
Show that it satisfies {\alpha^3 = \alpha}, but that it is not idempotent and that it is not an involution.
Solution: Exercise 9
We show that \alpha satisfies {\alpha^3 = \alpha}.
example : α ⊚ α ⊚ α = α := by ⊢ α ⊚ α ⊚ α = α
ext x x:A⊢ (ConcreteCategory.hom (α ⊚ α ⊚ α)).toFun x = (ConcreteCategory.hom α).toFun x
dsimp [CategoryStruct.comp, α] x:A⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
x =
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂
cases x a₁ ⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
A.a₁ =
match A.a₁ with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂a₂ ⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
A.a₂ =
match A.a₂ with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂a₃ ⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
A.a₃ =
match A.a₃ with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂ <;> a₁ ⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
A.a₁ =
match A.a₁ with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂a₂ ⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
A.a₂ =
match A.a₂ with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂a₃ ⊢ (ConcreteCategory.hom
{
hom' :=
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
((↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom'.comp
(↾fun x ↦
match x with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂).hom') })
A.a₃ =
match A.a₃ with
| A.a₁ => A.a₂
| A.a₂ => A.a₃
| A.a₃ => A.a₂ rfl All goals completed! 🐙
But \alpha is not idempotent.
open ConcreteCategory in
example : ¬(IsIdempotent α) := by ⊢ ¬IsIdempotent α
by_contra h h:IsIdempotent α⊢ False
have h_contra : (α ⊚ α) A.a₁ = α A.a₁ := congr_hom h.idem A.a₁ h:IsIdempotent αh_contra:(hom (α ⊚ α)) A.a₁ = (hom α) A.a₁⊢ False
dsimp [α] at h_contra h:IsIdempotent αh_contra:A.a₃ = A.a₂⊢ False
contradiction All goals completed! 🐙
And \alpha is not an involution.
open ConcreteCategory in
example : ¬(IsInvolution α) := by ⊢ ¬IsInvolution α
by_contra h h:IsInvolution α⊢ False
have h_contra : (α ⊚ α) A.a₁ = (𝟙 A) A.a₁ :=
congr_hom h.invol A.a₁ h:IsInvolution αh_contra:(hom (α ⊚ α)) A.a₁ = (hom (𝟙 A)) A.a₁⊢ False
dsimp [α] at h_contra h:IsInvolution αh_contra:A.a₃ = A.a₁⊢ False
contradiction All goals completed! 🐙
5. Irreflexive graphs
Complete the specification of the two maps
X \xrightarrow{s} P \quad\text{and}\quad X \xrightarrow{t} P
which express the source and target relations of the [given graph]. Is there any element of X at which s and t take the same value in P? Is there any element to which t assigns the value k?
Solution: Exercise 10
The full specification of the two maps s and t is as follows:
inductive X
| a | b | c | d | e
inductive P
| k | m | n | p | q | r
def s : X ⟶ P := ↾fun
| X.a => P.k
| X.b => P.m
| X.c => P.k
| X.d => P.p
| X.e => P.m
def t : X ⟶ P := ↾fun
| X.a => P.m
| X.b => P.m
| X.c => P.m
| X.d => P.q
| X.e => P.r
s and t take the same value in P at the element b of X.
example : s X.b = t X.b := rfl
There is no element to which t assigns the value k.
example : ¬(∃ x : X, t x = P.k) := by ⊢ ¬∃ x, (ConcreteCategory.hom t) x = P.k
push Not ⊢ ∀ (x : X), (ConcreteCategory.hom t) x ≠ P.k
intro x x:X⊢ (ConcreteCategory.hom t) x ≠ P.k
cases x a ⊢ (ConcreteCategory.hom t) X.a ≠ P.kb ⊢ (ConcreteCategory.hom t) X.b ≠ P.kc ⊢ (ConcreteCategory.hom t) X.c ≠ P.kd ⊢ (ConcreteCategory.hom t) X.d ≠ P.ke ⊢ (ConcreteCategory.hom t) X.e ≠ P.k <;> a ⊢ (ConcreteCategory.hom t) X.a ≠ P.kb ⊢ (ConcreteCategory.hom t) X.b ≠ P.kc ⊢ (ConcreteCategory.hom t) X.c ≠ P.kd ⊢ (ConcreteCategory.hom t) X.d ≠ P.ke ⊢ (ConcreteCategory.hom t) X.e ≠ P.k simp [t] All goals completed! 🐙
The category 𝑺⇊ of (irreflexive directed multi-) graphs is described on pp. 141–142. We implement the category 𝑺⇊ below (again using types instead of sets).
structure IrreflexiveGraph where
carrierA : Type
carrierD : Type
toSrc : carrierA ⟶ carrierD
toTgt : carrierA ⟶ carrierD
instance instCategoryIrreflexiveGraph : Category IrreflexiveGraph where
Hom X Y := {
f : (X.carrierA ⟶ Y.carrierA) × (X.carrierD ⟶ Y.carrierD) //
f.2 ⊚ X.toSrc = Y.toSrc ⊚ f.1 -- source commutes
∧ f.2 ⊚ X.toTgt = Y.toTgt ⊚ f.1 -- target commutes
}
id X := ⟨(𝟙 X.carrierA, 𝟙 X.carrierD), ⟨rfl, rfl⟩⟩
comp := by ⊢ {X Y Z : IrreflexiveGraph} →
{ f // f.2 ⊚ X.toSrc = Y.toSrc ⊚ f.1 ∧ f.2 ⊚ X.toTgt = Y.toTgt ⊚ f.1 } →
{ f // f.2 ⊚ Y.toSrc = Z.toSrc ⊚ f.1 ∧ f.2 ⊚ Y.toTgt = Z.toTgt ⊚ f.1 } →
{ f // f.2 ⊚ X.toSrc = Z.toSrc ⊚ f.1 ∧ f.2 ⊚ X.toTgt = Z.toTgt ⊚ f.1 }
rintro _ _ _ ⟨f, hf⟩ ⟨g, hg⟩ X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1 ∧ f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1 ∧ g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ { f // f.2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ f.1 ∧ f.2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ f.1 }
exact ⟨
(g.1 ⊚ f.1, g.2 ⊚ f.2),
by X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1 ∧ f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1 ∧ g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
obtain ⟨hfSrc_comm, hfTgt_comm⟩ := hf X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1 ∧ g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
obtain ⟨hgSrc_comm, hgTgt_comm⟩ := hg X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
constructor left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
· left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 rw [← Category.assoc, left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ g.2 ⊚ f.2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfSrc_comm, left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ g.2 ⊚ Y✝.toSrc ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.2 ⊚ Y✝.toSrc) ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgSrc_comm, left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (Z✝.toSrc ⊚ g.1) ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc left X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ Z✝.toSrc ⊚ g.1 ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
· right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 rw [← Category.assoc, right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ g.2 ⊚ f.2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfTgt_comm, right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ g.2 ⊚ Y✝.toTgt ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (g.2 ⊚ Y✝.toTgt) ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgTgt_comm, right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ (Z✝.toTgt ⊚ g.1) ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc right X✝:IrreflexiveGraphY✝:IrreflexiveGraphZ✝:IrreflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1⊢ Z✝.toTgt ⊚ g.1 ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
⟩
@[ext]
lemma IrreflexiveGraph.hom_ext {X Y : IrreflexiveGraph}
(f g : X ⟶ Y) (hA : f.val.1 = g.val.1) (hD : f.val.2 = g.val.2)
: f = g :=
Subtype.ext (Prod.ext hA hD)
If f is [the map of graphs]
X \xrightarrow{f_A} Y,\; P \xrightarrow{f_D} Q
and if
Y \xrightarrow{g_A} Z,\; Q \xrightarrow{g_D} R
is another map of graphs, show that the pair {g_A \circ f_A,\; g_D \circ f_D} of 𝑺-composites is also an 𝑺⇊-map.
Solution: Exercise 11
variable (X P Y Q Z R : Type)
(s t : X ⟶ P) (s' t' : Y ⟶ Q) (s'' t'' : Z ⟶ R)
example (fA : X ⟶ Y) (fD : P ⟶ Q) (gA : Y ⟶ Z) (gD : Q ⟶ R)
(hfSrc_comm : fD ⊚ s = s' ⊚ fA)
(hfTgt_comm : fD ⊚ t = t' ⊚ fA)
(hgSrc_comm : gD ⊚ s' = s'' ⊚ gA)
(hgTgt_comm : gD ⊚ t' = t'' ⊚ gA)
: (gD ⊚ fD) ⊚ s = s'' ⊚ (gA ⊚ fA)
∧ (gD ⊚ fD) ⊚ t = t'' ⊚ (gA ⊚ fA)
:= by X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ fD) ⊚ s = s'' ⊚ gA ⊚ fA ∧ (gD ⊚ fD) ⊚ t = t'' ⊚ gA ⊚ fA
constructor left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ fD) ⊚ s = s'' ⊚ gA ⊚ fAright X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ fD) ⊚ t = t'' ⊚ gA ⊚ fA
-- cf. instCategoryIrreflexiveGraph.comp above
· left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ fD) ⊚ s = s'' ⊚ gA ⊚ fA rw [← Category.assoc, left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ gD ⊚ fD ⊚ s = s'' ⊚ gA ⊚ fA hfSrc_comm, left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ gD ⊚ s' ⊚ fA = s'' ⊚ gA ⊚ fA Category.assoc, left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ s') ⊚ fA = s'' ⊚ gA ⊚ fA
hgSrc_comm, left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (s'' ⊚ gA) ⊚ fA = s'' ⊚ gA ⊚ fA ← Category.assoc left X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ s'' ⊚ gA ⊚ fA = s'' ⊚ gA ⊚ fA] All goals completed! 🐙
· right X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ fD) ⊚ t = t'' ⊚ gA ⊚ fA rw [← Category.assoc, right X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ gD ⊚ fD ⊚ t = t'' ⊚ gA ⊚ fA hfTgt_comm, right X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ gD ⊚ t' ⊚ fA = t'' ⊚ gA ⊚ fA Category.assoc, right X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (gD ⊚ t') ⊚ fA = t'' ⊚ gA ⊚ fA
hgTgt_comm, right X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ (t'' ⊚ gA) ⊚ fA = t'' ⊚ gA ⊚ fA ← Category.assoc right X:TypeP:TypeY:TypeQ:TypeZ:TypeR:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ Qs'':Z ⟶ Rt'':Z ⟶ RfA:X ⟶ YfD:P ⟶ QgA:Y ⟶ ZgD:Q ⟶ RhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAhgSrc_comm:gD ⊚ s' = s'' ⊚ gAhgTgt_comm:gD ⊚ t' = t'' ⊚ gA⊢ t'' ⊚ gA ⊚ fA = t'' ⊚ gA ⊚ fA] All goals completed! 🐙
Equivalently, we can use our implementation of the category 𝑺⇊ of graphs.
def graph (A D : Type) (src tgt : A ⟶ D) : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := src
toTgt := tgt
}
example (f : graph X P s t ⟶ graph Y Q s' t')
(g : graph Y Q s' t' ⟶ graph Z R s'' t'')
: graph X P s t ⟶ graph Z R s'' t'' := g ⊚ f
6. Endomaps as special graphs
If we denote the result of the [insertion] process by I(f), then {I(g \circ f) = I(g) \circ I(f)} so that our insertion I preserves the fundamental operation of categories.
Solution: Exercise 12
The insertion I maps endomaps of sets to irreflexive graphs and maps morphisms between endomaps of sets to morphisms between irreflexive graphs — in other words, I is a functor. We again use our implementation of the category 𝑺⇊ of graphs.
def functorSetWithEndomapToIrreflexiveGraph
: Functor SetWithEndomap IrreflexiveGraph := {
obj (X : SetWithEndomap) := {
carrierA := X.carrier
carrierD := X.carrier
toSrc := 𝟙 X.carrier
toTgt := X.toEnd
}
map {X Y : SetWithEndomap} (f : X ⟶ Y) := {
val := (f.val, f.val)
property := by X:SetWithEndomapY:SetWithEndomapf:X ⟶ Y⊢ (↑f, ↑f).2 ⊚ { carrierA := X.carrier, carrierD := X.carrier, toSrc := 𝟙 X.carrier, toTgt := X.toEnd }.toSrc =
{ carrierA := Y.carrier, carrierD := Y.carrier, toSrc := 𝟙 Y.carrier, toTgt := Y.toEnd }.toSrc ⊚ (↑f, ↑f).1 ∧
(↑f, ↑f).2 ⊚ { carrierA := X.carrier, carrierD := X.carrier, toSrc := 𝟙 X.carrier, toTgt := X.toEnd }.toTgt =
{ carrierA := Y.carrier, carrierD := Y.carrier, toSrc := 𝟙 Y.carrier, toTgt := Y.toEnd }.toTgt ⊚ (↑f, ↑f).1
obtain ⟨carrierX, toEndX⟩ := X Y:SetWithEndomapcarrierX:TypetoEndX:carrierX ⟶ carrierXf:{ carrier := carrierX, toEnd := toEndX } ⟶ Y⊢ (↑f, ↑f).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toSrc =
{ carrierA := Y.carrier, carrierD := Y.carrier, toSrc := 𝟙 Y.carrier, toTgt := Y.toEnd }.toSrc ⊚ (↑f, ↑f).1 ∧
(↑f, ↑f).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toTgt =
{ carrierA := Y.carrier, carrierD := Y.carrier, toSrc := 𝟙 Y.carrier, toTgt := Y.toEnd }.toTgt ⊚ (↑f, ↑f).1
obtain ⟨carrierY, toEndY⟩ := Y carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:{ carrier := carrierX, toEnd := toEndX } ⟶ { carrier := carrierY, toEnd := toEndY }⊢ (↑f, ↑f).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toSrc =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toSrc ⊚
(↑f, ↑f).1 ∧
(↑f, ↑f).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toTgt =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toTgt ⊚
(↑f, ↑f).1
obtain ⟨f, hf_comm⟩ := f carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:{ carrier := carrierX, toEnd := toEndX }.carrier ⟶ { carrier := carrierY, toEnd := toEndY }.carrierhf_comm:f ⊚ { carrier := carrierX, toEnd := toEndX }.toEnd = { carrier := carrierY, toEnd := toEndY }.toEnd ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toSrc =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toSrc ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1 ∧
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toTgt =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toTgt ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1
dsimp at f hf_comm carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:carrierX ⟶ carrierYhf_comm:f ⊚ toEndX = toEndY ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toSrc =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toSrc ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1 ∧
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toTgt =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toTgt ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1
constructor left carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:carrierX ⟶ carrierYhf_comm:f ⊚ toEndX = toEndY ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toSrc =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toSrc ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1right carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:carrierX ⟶ carrierYhf_comm:f ⊚ toEndX = toEndY ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toTgt =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toTgt ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1 <;> left carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:carrierX ⟶ carrierYhf_comm:f ⊚ toEndX = toEndY ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toSrc =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toSrc ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1right carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:carrierX ⟶ carrierYhf_comm:f ⊚ toEndX = toEndY ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚
{ carrierA := { carrier := carrierX, toEnd := toEndX }.carrier,
carrierD := { carrier := carrierX, toEnd := toEndX }.carrier,
toSrc := 𝟙 { carrier := carrierX, toEnd := toEndX }.carrier,
toTgt := { carrier := carrierX, toEnd := toEndX }.toEnd }.toTgt =
{ carrierA := { carrier := carrierY, toEnd := toEndY }.carrier,
carrierD := { carrier := carrierY, toEnd := toEndY }.carrier,
toSrc := 𝟙 { carrier := carrierY, toEnd := toEndY }.carrier,
toTgt := { carrier := carrierY, toEnd := toEndY }.toEnd }.toTgt ⊚
(↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1 (dsimp right carrierX:TypetoEndX:carrierX ⟶ carrierXcarrierY:TypetoEndY:carrierY ⟶ carrierYf:carrierX ⟶ carrierYhf_comm:f ⊚ toEndX = toEndY ⊚ f⊢ f ⊚ toEndX = toEndY ⊚ f; trivial All goals completed! 🐙)
}
}
-- Helper function to align to the notation in the book
def I {X Y : SetWithEndomap} (f : X ⟶ Y) :=
functorSetWithEndomapToIrreflexiveGraph.map f
example {X Y Z : SetWithEndomap}
(f : X ⟶ Y) (g : Y ⟶ Z) : I (g ⊚ f) = I g ⊚ I f := rfl
(Fullness) Show that if we are given any 𝑺⇊-morphism
X \xrightarrow{f_A} Y,\; X \xrightarrow{f_D} Y
between the special graphs that come via I from endomaps of sets, then it follows that {f_A = f_D}, so that the map itself comes via I from a map in 𝑺↻.
Solution: Exercise 13
variable (X' Y' : SetWithEndomap)
Using Category IrreflexiveGraph, we have
def graph₁ (S : SetWithEndomap) : IrreflexiveGraph := {
carrierA := S.carrier
carrierD := S.carrier
toSrc := 𝟙 S.carrier
toTgt := S.toEnd
}
variable (f₁ : graph₁ X' ⟶ graph₁ Y')
-- Align to the notation in the book: fA is f₁.val.1, fD is f₁.val.2
set_option quotPrecheck false
local notation "fA₁" => f₁.val.1
local notation "fD₁" => f₁.val.2
set_option quotPrecheck true
example : fA₁ = fD₁ := by X':SetWithEndomapY':SetWithEndomapf₁:graph₁ X' ⟶ graph₁ Y'⊢ (↑f₁).1 = (↑f₁).2
obtain ⟨hfSrc_comm, _⟩ := f₁.property X':SetWithEndomapY':SetWithEndomapf₁:graph₁ X' ⟶ graph₁ Y'hfSrc_comm:(↑f₁).2 ⊚ (graph₁ X').toSrc = (graph₁ Y').toSrc ⊚ (↑f₁).1right✝:(↑f₁).2 ⊚ (graph₁ X').toTgt = (graph₁ Y').toTgt ⊚ (↑f₁).1⊢ (↑f₁).1 = (↑f₁).2
dsimp [graph₁] at hfSrc_comm X':SetWithEndomapY':SetWithEndomapf₁:graph₁ X' ⟶ graph₁ Y'hfSrc_comm:(↑f₁).2 ⊚ 𝟙 X'.carrier = 𝟙 Y'.carrier ⊚ (↑f₁).1right✝:(↑f₁).2 ⊚ (graph₁ X').toTgt = (graph₁ Y').toTgt ⊚ (↑f₁).1⊢ (↑f₁).1 = (↑f₁).2
exact hfSrc_comm.symm All goals completed! 🐙
Alternatively, using functorSetWithEndomapToIrreflexiveGraph, we have
def graph₂ (S : SetWithEndomap) : IrreflexiveGraph :=
functorSetWithEndomapToIrreflexiveGraph.obj S
variable (f₂ : graph₂ X' ⟶ graph₂ Y')
set_option quotPrecheck false
local notation "fA₂" => f₂.val.1
local notation "fD₂" => f₂.val.2
set_option quotPrecheck true
example : fA₂ = fD₂ := by X':SetWithEndomapY':SetWithEndomapf₁:graph₁ X' ⟶ graph₁ Y'f₂:graph₂ X' ⟶ graph₂ Y'⊢ (↑f₂).1 = (↑f₂).2
obtain ⟨hfSrc_comm, _⟩ := f₂.property X':SetWithEndomapY':SetWithEndomapf₁:graph₁ X' ⟶ graph₁ Y'f₂:graph₂ X' ⟶ graph₂ Y'hfSrc_comm:(↑f₂).2 ⊚ (graph₂ X').toSrc = (graph₂ Y').toSrc ⊚ (↑f₂).1right✝:(↑f₂).2 ⊚ (graph₂ X').toTgt = (graph₂ Y').toTgt ⊚ (↑f₂).1⊢ (↑f₂).1 = (↑f₂).2
dsimp [graph₂, functorSetWithEndomapToIrreflexiveGraph]
at hfSrc_comm X':SetWithEndomapY':SetWithEndomapf₁:graph₁ X' ⟶ graph₁ Y'f₂:graph₂ X' ⟶ graph₂ Y'hfSrc_comm:(↑f₂).2 ⊚ 𝟙 X'.carrier = 𝟙 Y'.carrier ⊚ (↑f₂).1right✝:(↑f₂).2 ⊚ (graph₂ X').toTgt = (graph₂ Y').toTgt ⊚ (↑f₂).1⊢ (↑f₂).1 = (↑f₂).2
exact hfSrc_comm.symm All goals completed! 🐙
7. The simpler category 𝑺↓: Objects are just maps of sets
The category 𝑺↓ of simple directed graphs is described on pp. 144–145. We implement the category 𝑺↓ below (using types instead of sets).
structure SimpleGraph where
carrierA : Type
carrierD : Type
toFun : carrierA ⟶ carrierD
instance : Category SimpleGraph where
Hom X Y := {
f : (X.carrierA ⟶ Y.carrierA) × (X.carrierD ⟶ Y.carrierD) //
f.2 ⊚ X.toFun = Y.toFun ⊚ f.1 -- commutes
}
id X := ⟨(𝟙 X.carrierA, 𝟙 X.carrierD), rfl⟩
comp := by ⊢ {X Y Z : SimpleGraph} →
{ f // f.2 ⊚ X.toFun = Y.toFun ⊚ f.1 } →
{ f // f.2 ⊚ Y.toFun = Z.toFun ⊚ f.1 } → { f // f.2 ⊚ X.toFun = Z.toFun ⊚ f.1 }
rintro _ _ _ ⟨f, hf⟩ ⟨g, hg⟩ X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ { f // f.2 ⊚ X✝.toFun = Z✝.toFun ⊚ f.1 }
exact ⟨
(g.1 ⊚ f.1, g.2 ⊚ f.2),
by X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toFun = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
have hfSrc_comm := hf X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toFun = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
have hgSrc_comm := hg X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toFun = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
rw [← Category.assoc, X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ g.2 ⊚ f.2 ⊚ X✝.toFun = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfSrc_comm, X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ g.2 ⊚ Y✝.toFun ⊚ f.1 = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ (g.2 ⊚ Y✝.toFun) ⊚ f.1 = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgSrc_comm, X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ (Z✝.toFun ⊚ g.1) ⊚ f.1 = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc X✝:SimpleGraphY✝:SimpleGraphZ✝:SimpleGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1hfSrc_comm:f.2 ⊚ X✝.toFun = Y✝.toFun ⊚ f.1hgSrc_comm:g.2 ⊚ Y✝.toFun = Z✝.toFun ⊚ g.1⊢ Z✝.toFun ⊚ g.1 ⊚ f.1 = Z✝.toFun ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
⟩
@[ext]
lemma SimpleGraph.hom_ext {X Y : SimpleGraph}
(f g : X ⟶ Y) (hA : f.val.1 = g.val.1) (hD : f.val.2 = g.val.2)
: f = g :=
Subtype.ext (Prod.ext hA hD)
The insertion J is a functor from 𝑺↻ to 𝑺↓.
def functorSetWithEndomapToSimpleGraph
: Functor SetWithEndomap SimpleGraph := {
obj (X : SetWithEndomap) := {
carrierA := X.carrier
carrierD := X.carrier
toFun := X.toEnd
}
map {X Y : SetWithEndomap} (f : X ⟶ Y) := {
val := (f.val, f.val)
property := by X:SetWithEndomapY:SetWithEndomapf:X ⟶ Y⊢ (↑f, ↑f).2 ⊚ { carrierA := X.carrier, carrierD := X.carrier, toFun := X.toEnd }.toFun =
{ carrierA := Y.carrier, carrierD := Y.carrier, toFun := Y.toEnd }.toFun ⊚ (↑f, ↑f).1
obtain ⟨f, hf_comm⟩ := f X:SetWithEndomapY:SetWithEndomapf:X.carrier ⟶ Y.carrierhf_comm:f ⊚ X.toEnd = Y.toEnd ⊚ f⊢ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).2 ⊚ { carrierA := X.carrier, carrierD := X.carrier, toFun := X.toEnd }.toFun =
{ carrierA := Y.carrier, carrierD := Y.carrier, toFun := Y.toEnd }.toFun ⊚ (↑⟨f, hf_comm⟩, ↑⟨f, hf_comm⟩).1
trivial All goals completed! 🐙
}
}
-- Helper function to align to the notation in the book
def J {X Y : SetWithEndomap} (f : X ⟶ Y) :=
functorSetWithEndomapToSimpleGraph.map f
example {X Y Z : SetWithEndomap}
(f : X ⟶ Y) (g : Y ⟶ Z) : J (g ⊚ f) = J g ⊚ J f := rfl
Give an example of 𝑺 of two endomaps and two maps as in
X \xrightarrow{f_A} Y,\; X \xrightarrow{f_D} Y,\; X \xrightarrow{\alpha} X,\; Y \xrightarrow{\beta} Y
which satisfy the equation {f_D \circ \alpha = \beta \circ f_A}, but for which {f_A \ne f_D}.
Solution: Exercise 14
We give X, Y, \alpha, \beta, f_A, f_D as follows:
inductive X
| x₁ | x₂
inductive Y
| y₁ | y₂
def α : X ⟶ X := ↾fun
| X.x₁ => X.x₁
| X.x₂ => X.x₁
def β : Y ⟶ Y := ↾fun
| Y.y₁ => Y.y₁
| Y.y₂ => Y.y₁
def fA : X ⟶ Y := ↾fun
| X.x₁ => Y.y₁
| X.x₂ => Y.y₂
def fD : X ⟶ Y := ↾fun
| X.x₁ => Y.y₁
| X.x₂ => Y.y₁
We show that our example satisfies the required properties.
open ConcreteCategory in
example : fD ⊚ α = β ⊚ fA ∧ fA ≠ fD := by ⊢ fD ⊚ α = β ⊚ fA ∧ fA ≠ fD
constructor left ⊢ fD ⊚ α = β ⊚ fAright ⊢ fA ≠ fD
· left ⊢ fD ⊚ α = β ⊚ fA ext x left x:X⊢ (hom (fD ⊚ α)).toFun x = (hom (β ⊚ fA)).toFun x
cases x left.x₁ ⊢ (hom (fD ⊚ α)).toFun X.x₁ = (hom (β ⊚ fA)).toFun X.x₁left.x₂ ⊢ (hom (fD ⊚ α)).toFun X.x₂ = (hom (β ⊚ fA)).toFun X.x₂ <;> left.x₁ ⊢ (hom (fD ⊚ α)).toFun X.x₁ = (hom (β ⊚ fA)).toFun X.x₁left.x₂ ⊢ (hom (fD ⊚ α)).toFun X.x₂ = (hom (β ⊚ fA)).toFun X.x₂ rfl All goals completed! 🐙
· right ⊢ fA ≠ fD by_contra h right h:fA = fD⊢ False
have h_contra : fA X.x₂ = fD X.x₂ := congr_hom h X.x₂ right h:fA = fDh_contra:(hom fA) X.x₂ = (hom fD) X.x₂⊢ False
dsimp [fA, fD] at h_contra right h:fA = fDh_contra:Y.y₂ = Y.y₁⊢ False
contradiction All goals completed! 🐙
8. Reflexive graphs
The category of reflexive graphs is described on p. 145. We implement this category below (using types instead of sets).
structure ReflexiveGraph extends IrreflexiveGraph where
toCommonSection : carrierD ⟶ carrierA
section_src : toSrc ⊚ toCommonSection = 𝟙 carrierD
section_tgt : toTgt ⊚ toCommonSection = 𝟙 carrierD
instance : Category ReflexiveGraph where
Hom X Y := {
f : (X.carrierA ⟶ Y.carrierA) × (X.carrierD ⟶ Y.carrierD) //
f.2 ⊚ X.toSrc = Y.toSrc ⊚ f.1 -- source commutes
∧ f.2 ⊚ X.toTgt = Y.toTgt ⊚ f.1 -- target commutes
∧ f.1 ⊚ X.toCommonSection = Y.toCommonSection ⊚ f.2
}
id X := ⟨
(𝟙 X.carrierA, 𝟙 X.carrierD),
by X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).2 ⊚ X.toSrc = X.toSrc ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).1 ∧
(𝟙 X.carrierA, 𝟙 X.carrierD).2 ⊚ X.toTgt = X.toTgt ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).1 ∧
(𝟙 X.carrierA, 𝟙 X.carrierD).1 ⊚ X.toCommonSection = X.toCommonSection ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).2
split_ands refine_1 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).2 ⊚ X.toSrc = X.toSrc ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).1refine_2.refine_1 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).2 ⊚ X.toTgt = X.toTgt ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).1refine_2.refine_2 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).1 ⊚ X.toCommonSection = X.toCommonSection ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).2 <;> refine_1 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).2 ⊚ X.toSrc = X.toSrc ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).1refine_2.refine_1 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).2 ⊚ X.toTgt = X.toTgt ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).1refine_2.refine_2 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).1 ⊚ X.toCommonSection = X.toCommonSection ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).2 first | exact fun _ hx ↦ hx refine_2.refine_2 X:ReflexiveGraph⊢ (𝟙 X.carrierA, 𝟙 X.carrierD).1 ⊚ X.toCommonSection = X.toCommonSection ⊚ (𝟙 X.carrierA, 𝟙 X.carrierD).2 | rfl All goals completed! 🐙
⟩
comp := by ⊢ {X Y Z : ReflexiveGraph} →
{ f //
f.2 ⊚ X.toSrc = Y.toSrc ⊚ f.1 ∧
f.2 ⊚ X.toTgt = Y.toTgt ⊚ f.1 ∧ f.1 ⊚ X.toCommonSection = Y.toCommonSection ⊚ f.2 } →
{ f //
f.2 ⊚ Y.toSrc = Z.toSrc ⊚ f.1 ∧
f.2 ⊚ Y.toTgt = Z.toTgt ⊚ f.1 ∧ f.1 ⊚ Y.toCommonSection = Z.toCommonSection ⊚ f.2 } →
{ f //
f.2 ⊚ X.toSrc = Z.toSrc ⊚ f.1 ∧
f.2 ⊚ X.toTgt = Z.toTgt ⊚ f.1 ∧ f.1 ⊚ X.toCommonSection = Z.toCommonSection ⊚ f.2 }
rintro _ _ _ ⟨f, hf⟩ ⟨g, hg⟩ X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1 ∧ f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1 ∧ f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1 ∧ g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1 ∧ g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ { f //
f.2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ f.1 ∧
f.2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ f.1 ∧ f.1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ f.2 }
exact ⟨
(g.1 ⊚ f.1, g.2 ⊚ f.2),
by X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)hf:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1 ∧ f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1 ∧ f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1 ∧ g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1 ∧ g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
obtain ⟨hfSrc_comm, hfTgt_comm, hfCommonSection_comm⟩ := hf X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hg:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1 ∧ g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1 ∧ g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
obtain ⟨hgSrc_comm, hgTgt_comm, hgCommonSection_comm⟩ := hg X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
split_ands refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
· refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 rw [← Category.assoc, refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ g.2 ⊚ f.2 ⊚ X✝.toSrc = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfSrc_comm, refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ g.2 ⊚ Y✝.toSrc ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.2 ⊚ Y✝.toSrc) ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgSrc_comm, refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (Z✝.toSrc ⊚ g.1) ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ Z✝.toSrc ⊚ g.1 ⊚ f.1 = Z✝.toSrc ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
· refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 rw [← Category.assoc, refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ g.2 ⊚ f.2 ⊚ X✝.toTgt = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfTgt_comm, refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ g.2 ⊚ Y✝.toTgt ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.2 ⊚ Y✝.toTgt) ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgTgt_comm, refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (Z✝.toTgt ⊚ g.1) ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc refine_2.refine_1 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ Z✝.toTgt ⊚ g.1 ⊚ f.1 = Z✝.toTgt ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
· refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 rw [← Category.assoc, refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ g.1 ⊚ f.1 ⊚ X✝.toCommonSection = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 hfCommonSection_comm, refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ g.1 ⊚ Y✝.toCommonSection ⊚ f.2 = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
Category.assoc, refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (g.1 ⊚ Y✝.toCommonSection) ⊚ f.2 = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 hgCommonSection_comm, refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ (Z✝.toCommonSection ⊚ g.2) ⊚ f.2 = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
← Category.assoc refine_2.refine_2 X✝:ReflexiveGraphY✝:ReflexiveGraphZ✝:ReflexiveGraphf:(X✝.carrierA ⟶ Y✝.carrierA) × (X✝.carrierD ⟶ Y✝.carrierD)g:(Y✝.carrierA ⟶ Z✝.carrierA) × (Y✝.carrierD ⟶ Z✝.carrierD)hfSrc_comm:f.2 ⊚ X✝.toSrc = Y✝.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ X✝.toTgt = Y✝.toTgt ⊚ f.1hfCommonSection_comm:f.1 ⊚ X✝.toCommonSection = Y✝.toCommonSection ⊚ f.2hgSrc_comm:g.2 ⊚ Y✝.toSrc = Z✝.toSrc ⊚ g.1hgTgt_comm:g.2 ⊚ Y✝.toTgt = Z✝.toTgt ⊚ g.1hgCommonSection_comm:g.1 ⊚ Y✝.toCommonSection = Z✝.toCommonSection ⊚ g.2⊢ Z✝.toCommonSection ⊚ g.2 ⊚ f.2 = Z✝.toCommonSection ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2] All goals completed! 🐙
⟩
@[ext]
lemma ReflexiveGraph.hom_ext {X Y : ReflexiveGraph}
(f g : X ⟶ Y) (hA : f.val.1 = g.val.1) (hD : f.val.2 = g.val.2)
: f = g :=
Subtype.ext (Prod.ext hA hD)
In a reflexive graph, the two endomaps {e_1 = is}, {e_0 = it} of the set of arrows are not only idempotent, but even satisfy four equations:
e_k e_j = e_j \quad\text{for}\quad k, j = 0, 1.
Solution: Exercise 15
We use our implementation of the category of reflexive graphs.
variable (X : ReflexiveGraph)
Define the two endomaps {e_1 = is}, {e_0 = it}.
variable (e₁ e₀ : X.carrierA ⟶ X.carrierA)
(h₁ : e₁ = X.toCommonSection ⊚ X.toSrc)
(h₀ : e₀ = X.toCommonSection ⊚ X.toTgt)
e_0 e_0 = e_0
example : e₀ ⊚ e₀ = e₀ := by X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ e₀ ⊚ e₀ = e₀
rw [h₀, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toTgt) ⊚ X.toCommonSection ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt Category.assoc, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ ((X.toCommonSection ⊚ X.toTgt) ⊚ X.toCommonSection) ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt ← Category.assoc X.toCommonSection, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toTgt ⊚ X.toCommonSection) ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt
X.section_tgt, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ 𝟙 X.carrierD) ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt Category.id_comp X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ X.toCommonSection ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt] All goals completed! 🐙
e_0 e_1 = e_1
example : e₀ ⊚ e₁ = e₁ := by X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ e₀ ⊚ e₁ = e₁
rw [h₀, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toTgt) ⊚ e₁ = e₁ h₁, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toTgt) ⊚ X.toCommonSection ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc Category.assoc, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ ((X.toCommonSection ⊚ X.toTgt) ⊚ X.toCommonSection) ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc ← Category.assoc X.toCommonSection, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toTgt ⊚ X.toCommonSection) ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc
X.section_tgt, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ 𝟙 X.carrierD) ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc Category.id_comp X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ X.toCommonSection ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc] All goals completed! 🐙
e_1 e_0 = e_0
example : e₁ ⊚ e₀ = e₀ := by X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ e₁ ⊚ e₀ = e₀
rw [h₁, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toSrc) ⊚ e₀ = e₀ h₀, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toSrc) ⊚ X.toCommonSection ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt Category.assoc, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ ((X.toCommonSection ⊚ X.toSrc) ⊚ X.toCommonSection) ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt ← Category.assoc X.toCommonSection, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toSrc ⊚ X.toCommonSection) ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt
X.section_src, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ 𝟙 X.carrierD) ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt Category.id_comp X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ X.toCommonSection ⊚ X.toTgt = X.toCommonSection ⊚ X.toTgt] All goals completed! 🐙
e_1 e_1 = e_1
example : e₁ ⊚ e₁ = e₁ := by X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ e₁ ⊚ e₁ = e₁
rw [h₁, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toSrc) ⊚ X.toCommonSection ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc Category.assoc, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ ((X.toCommonSection ⊚ X.toSrc) ⊚ X.toCommonSection) ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc ← Category.assoc X.toCommonSection, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ X.toSrc ⊚ X.toCommonSection) ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc
X.section_src, X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ (X.toCommonSection ⊚ 𝟙 X.carrierD) ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc Category.id_comp X:ReflexiveGraphe₁:X.carrierA ⟶ X.carrierAe₀:X.carrierA ⟶ X.carrierAh₁:e₁ = X.toCommonSection ⊚ X.toSrch₀:e₀ = X.toCommonSection ⊚ X.toTgt⊢ X.toCommonSection ⊚ X.toSrc = X.toCommonSection ⊚ X.toSrc] All goals completed! 🐙
Show that if f_A, f_D in 𝑺 constitute a map of reflexive graphs, then f_D is determined by f_A and the internal structure of the two graphs.
Solution: Exercise 16
f is a morphism in our category of reflexive graphs.
variable (X Y : ReflexiveGraph) (f : X ⟶ Y)
-- Align to the notation in the book
set_option quotPrecheck false
local notation "fA" => f.val.1
local notation "fD" => f.val.2
set_option quotPrecheck true
local notation "s" => X.toSrc
local notation "s'" => Y.toSrc
local notation "t" => X.toTgt
local notation "t'" => Y.toTgt
local notation "i" => X.toCommonSection
local notation "i'" => Y.toCommonSection
Then f_D is determined by f_A and the internal structure of the two graphs.
example : fD = s' ⊚ fA ⊚ i := by X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 = Y.toSrc ⊚ (↑f).1 ⊚ X.toCommonSection
rw [← Category.id_comp fD, X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ 𝟙 X.carrierD = Y.toSrc ⊚ (↑f).1 ⊚ X.toCommonSection ← X.section_src X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ X.toSrc ⊚ X.toCommonSection = Y.toSrc ⊚ (↑f).1 ⊚ X.toCommonSection] X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ X.toSrc ⊚ X.toCommonSection = Y.toSrc ⊚ (↑f).1 ⊚ X.toCommonSection
repeat rw [Category.assoc X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ ((↑f).2 ⊚ X.toSrc) ⊚ X.toCommonSection = Y.toSrc ⊚ (↑f).1 ⊚ X.toCommonSection] X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ ((↑f).2 ⊚ X.toSrc) ⊚ X.toCommonSection = Y.toSrc ⊚ (↑f).1 ⊚ X.toCommonSection X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ ((↑f).2 ⊚ X.toSrc) ⊚ X.toCommonSection = (Y.toSrc ⊚ (↑f).1) ⊚ X.toCommonSection
congrm ?_ ⊚ X.toCommonSection X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ X.toSrc = Y.toSrc ⊚ (↑f).1
exact f.property.1 All goals completed! 🐙
Or, alternatively,
example : fD = t' ⊚ fA ⊚ i := by X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 = Y.toTgt ⊚ (↑f).1 ⊚ X.toCommonSection
rw [← Category.id_comp fD, X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ 𝟙 X.carrierD = Y.toTgt ⊚ (↑f).1 ⊚ X.toCommonSection ← X.section_tgt X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ X.toTgt ⊚ X.toCommonSection = Y.toTgt ⊚ (↑f).1 ⊚ X.toCommonSection] X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ X.toTgt ⊚ X.toCommonSection = Y.toTgt ⊚ (↑f).1 ⊚ X.toCommonSection
repeat rw [Category.assoc X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ ((↑f).2 ⊚ X.toTgt) ⊚ X.toCommonSection = Y.toTgt ⊚ (↑f).1 ⊚ X.toCommonSection] X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ ((↑f).2 ⊚ X.toTgt) ⊚ X.toCommonSection = Y.toTgt ⊚ (↑f).1 ⊚ X.toCommonSection X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ ((↑f).2 ⊚ X.toTgt) ⊚ X.toCommonSection = (Y.toTgt ⊚ (↑f).1) ⊚ X.toCommonSection
congrm ?_ ⊚ X.toCommonSection X:ReflexiveGraphY:ReflexiveGraphf:X ⟶ Y⊢ (↑f).2 ⊚ X.toTgt = Y.toTgt ⊚ (↑f).1
exact f.property.2.1 All goals completed! 🐙
Consider a structure involving two sets and four maps as in
M \xrightarrow{\varphi} M,\; F \xrightarrow{\varphi'} M,\; F \xrightarrow{\mu} F,\; M \xrightarrow{\mu'} F \quad\text{(no equations required)}
(for example {M = \mathit{males}}, {F = \mathit{females}}, \varphi and \varphi' are \mathit{father}, and \mu and \mu' are \mathit{mother}). Devise a rational definition of map between such structures in order to make them into a category.
Solution: Exercise 17
Define the structure.
structure ParentLike where
carrierM : Type
carrierF : Type
φ : carrierM ⟶ carrierM
φ' : carrierF ⟶ carrierM
μ : carrierF ⟶ carrierF
μ' : carrierM ⟶ carrierF
Define a map between such structures.
def ParentLikeHom (X Y : ParentLike) : Type := {
f : (X.carrierM ⟶ Y.carrierM) × (X.carrierF ⟶ Y.carrierF) //
f.1 ⊚ X.φ = Y.φ ⊚ f.1 -- φ commutes
∧ f.1 ⊚ X.φ' = Y.φ' ⊚ f.2 -- φ' commutes
∧ f.2 ⊚ X.μ = Y.μ ⊚ f.2 -- μ commutes
∧ f.2 ⊚ X.μ' = Y.μ' ⊚ f.1 -- μ' commutes
}
This map between structures makes them into a category.
instance : Category ParentLike where
Hom := ParentLikeHom -- our map between ParentLike structures
id X := ⟨
(𝟙 X.carrierM, 𝟙 X.carrierF),
by X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).1 ⊚ X.φ = X.φ ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1 ∧
(𝟙 X.carrierM, 𝟙 X.carrierF).1 ⊚ X.φ' = X.φ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ∧
(𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ = X.μ ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ∧
(𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ' = X.μ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1
split_ands refine_1 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).1 ⊚ X.φ = X.φ ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1refine_2.refine_1 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).1 ⊚ X.φ' = X.φ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).2refine_2.refine_2.refine_1 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ = X.μ ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).2refine_2.refine_2.refine_2 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ' = X.μ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1 <;> refine_1 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).1 ⊚ X.φ = X.φ ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1refine_2.refine_1 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).1 ⊚ X.φ' = X.φ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).2refine_2.refine_2.refine_1 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ = X.μ ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).2refine_2.refine_2.refine_2 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ' = X.μ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1 first | exact fun _ hx ↦ hx refine_2.refine_2.refine_2 X:ParentLike⊢ (𝟙 X.carrierM, 𝟙 X.carrierF).2 ⊚ X.μ' = X.μ' ⊚ (𝟙 X.carrierM, 𝟙 X.carrierF).1 | rfl All goals completed! 🐙
⟩
comp := by ⊢ {X Y Z : ParentLike} → ParentLikeHom X Y → ParentLikeHom Y Z → ParentLikeHom X Z
rintro _ _ _ ⟨f, hf⟩ ⟨g, hg⟩ X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)hf:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1 ∧ f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2 ∧ f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2 ∧ f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hg:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1 ∧ g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2 ∧ g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2 ∧ g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ ParentLikeHom X✝ Z✝
exact ⟨
(g.1 ⊚ f.1, g.2 ⊚ f.2),
by X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)hf:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1 ∧ f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2 ∧ f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2 ∧ f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hg:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1 ∧ g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2 ∧ g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2 ∧ g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ' = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ' = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
obtain ⟨hfφ_comm, hfφ'_comm, hfμ_comm, hfμ'_comm⟩ := hf X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hg:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1 ∧ g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2 ∧ g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2 ∧ g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ' = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ' = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
obtain ⟨hgφ_comm, hgφ'_comm, hgμ_comm, hgμ'_comm⟩ := hg X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ' = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ∧
(g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ' = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
split_ands refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ' = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ' = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
· refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 rw [← Category.assoc, refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.1 ⊚ f.1 ⊚ X✝.φ = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfφ_comm, refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.1 ⊚ Y✝.φ ⊚ f.1 = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ Y✝.φ) ⊚ f.1 = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgφ_comm, refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (Z✝.φ ⊚ g.1) ⊚ f.1 = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ Z✝.φ ⊚ g.1 ⊚ f.1 = Z✝.φ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
· refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ⊚ X✝.φ' = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 rw [← Category.assoc, refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.1 ⊚ f.1 ⊚ X✝.φ' = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 hfφ'_comm, refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.1 ⊚ Y✝.φ' ⊚ f.2 = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 Category.assoc, refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ Y✝.φ') ⊚ f.2 = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
hgφ'_comm, refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (Z✝.φ' ⊚ g.2) ⊚ f.2 = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ← Category.assoc refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ Z✝.φ' ⊚ g.2 ⊚ f.2 = Z✝.φ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2] All goals completed! 🐙
· refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 rw [← Category.assoc, refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.2 ⊚ f.2 ⊚ X✝.μ = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 hfμ_comm, refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.2 ⊚ Y✝.μ ⊚ f.2 = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 Category.assoc, refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.2 ⊚ Y✝.μ) ⊚ f.2 = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2
hgμ_comm, refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (Z✝.μ ⊚ g.2) ⊚ f.2 = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ← Category.assoc refine_2.refine_2.refine_1 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ Z✝.μ ⊚ g.2 ⊚ f.2 = Z✝.μ ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).2] All goals completed! 🐙
· refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.1 ⊚ f.1, g.2 ⊚ f.2).2 ⊚ X✝.μ' = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 rw [← Category.assoc, refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.2 ⊚ f.2 ⊚ X✝.μ' = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 hfμ'_comm, refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ g.2 ⊚ Y✝.μ' ⊚ f.1 = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 Category.assoc, refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (g.2 ⊚ Y✝.μ') ⊚ f.1 = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1
hgμ'_comm, refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ (Z✝.μ' ⊚ g.1) ⊚ f.1 = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1 ← Category.assoc refine_2.refine_2.refine_2 X✝:ParentLikeY✝:ParentLikeZ✝:ParentLikef:(X✝.carrierM ⟶ Y✝.carrierM) × (X✝.carrierF ⟶ Y✝.carrierF)g:(Y✝.carrierM ⟶ Z✝.carrierM) × (Y✝.carrierF ⟶ Z✝.carrierF)hfφ_comm:f.1 ⊚ X✝.φ = Y✝.φ ⊚ f.1hfφ'_comm:f.1 ⊚ X✝.φ' = Y✝.φ' ⊚ f.2hfμ_comm:f.2 ⊚ X✝.μ = Y✝.μ ⊚ f.2hfμ'_comm:f.2 ⊚ X✝.μ' = Y✝.μ' ⊚ f.1hgφ_comm:g.1 ⊚ Y✝.φ = Z✝.φ ⊚ g.1hgφ'_comm:g.1 ⊚ Y✝.φ' = Z✝.φ' ⊚ g.2hgμ_comm:g.2 ⊚ Y✝.μ = Z✝.μ ⊚ g.2hgμ'_comm:g.2 ⊚ Y✝.μ' = Z✝.μ' ⊚ g.1⊢ Z✝.μ' ⊚ g.1 ⊚ f.1 = Z✝.μ' ⊚ (g.1 ⊚ f.1, g.2 ⊚ f.2).1] All goals completed! 🐙
⟩
10. Retractions and injectivity
We say that a map {X \xrightarrow{a} Y} is injective iff for any maps {T \xrightarrow{x_1} X} and {T \xrightarrow{x_2} X} (in the same category) if {ax_1 = ax_2} then {x_1 = x_2} (or, in contrapositive form, 'the map a does not destroy distinctions', i.e. if {x_1 \ne x_2}..., then {ax_1 \ne ax_2} as well).
cf. the earlier definition of injective on p. 52.
If a has a retraction, then a is injective. (Assume {pa = 1_X} and {ax_1 = ax_2}; then try to show by calculation that {x_1 = x_2}.)
Solution: Exercise 18
cf. mono_iff_injective.
example {𝒞 : Type u} [Category.{v, u} 𝒞] {X Y T : 𝒞}
{a : X ⟶ Y} {p : Y ⟶ X} {x₁ x₂ : T ⟶ X}
(h₁ : p ⊚ a = 𝟙 X) (h₂ : a ⊚ x₁ = a ⊚ x₂)
: x₁ = x₂ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₁ = x₂
calc x₁
_ = 𝟙 X ⊚ x₁ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₁ = 𝟙 X ⊚ x₁ rw [Category.comp_id 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₁ = x₁] All goals completed! 🐙
_ = (p ⊚ a) ⊚ x₁ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₁ = (p ⊚ a) ⊚ x₁ rw [h₁ 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₁ = 𝟙 X ⊚ x₁] All goals completed! 🐙
_ = p ⊚ a ⊚ x₁ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₁ = p ⊚ a ⊚ x₁ rw [Category.assoc 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₁ = (p ⊚ a) ⊚ x₁] All goals completed! 🐙
_ = p ⊚ a ⊚ x₂ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ p ⊚ a ⊚ x₁ = p ⊚ a ⊚ x₂ rw [h₂ 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ p ⊚ a ⊚ x₂ = p ⊚ a ⊚ x₂] All goals completed! 🐙
_ = (p ⊚ a) ⊚ x₂ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ p ⊚ a ⊚ x₂ = (p ⊚ a) ⊚ x₂ rw [Category.assoc 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₂ = (p ⊚ a) ⊚ x₂] All goals completed! 🐙
_ = 𝟙 X ⊚ x₂ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₂ = 𝟙 X ⊚ x₂ rw [h₁ 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₂ = 𝟙 X ⊚ x₂] All goals completed! 🐙
_ = x₂ := by 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₂ = x₂ rw [Category.comp_id 𝒞:Type uinst✝:Category.{v, u} 𝒞X:𝒞Y:𝒞T:𝒞a:X ⟶ Yp:Y ⟶ Xx₁:T ⟶ Xx₂:T ⟶ Xh₁:p ⊚ a = 𝟙 Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₂ = x₂] All goals completed! 🐙
Exercises 19–24 that follow relate to the sets X and Y, the endomaps \alpha and \beta, and the map a as defined below. (Note that we in fact define X and Y as finite types rather than finite sets.)
set_option backward.isDefEq.respectTransparency false in
inductive X
| x₀ | x₁
deriving Fintype
set_option backward.isDefEq.respectTransparency false in
inductive Y
| y₀ | y₁ | y₂
deriving Fintype
def α : X ⟶ X := ↾fun
| X.x₀ => X.x₀
| X.x₁ => X.x₀
def β : Y ⟶ Y := ↾fun
| Y.y₀ => Y.y₀
| Y.y₁ => Y.y₀
| Y.y₂ => Y.y₁
def a : X ⟶ Y := ↾fun
| X.x₀ => Y.y₀
| X.x₁ => Y.y₁
Show that a is a map {X^{↻\alpha} \xrightarrow{a} Y^{↻\beta}} in 𝑺↻.
Solution: Exercise 19
a is a map in 𝑺↻ if it satisfies the condition {a \alpha = \beta a}.
example : a ⊚ α = β ⊚ a := by ⊢ a ⊚ α = β ⊚ a
ext x x:X⊢ (ConcreteCategory.hom (a ⊚ α)).toFun x = (ConcreteCategory.hom (β ⊚ a)).toFun x
cases x x₀ ⊢ (ConcreteCategory.hom (a ⊚ α)).toFun X.x₀ = (ConcreteCategory.hom (β ⊚ a)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (a ⊚ α)).toFun X.x₁ = (ConcreteCategory.hom (β ⊚ a)).toFun X.x₁ <;> x₀ ⊢ (ConcreteCategory.hom (a ⊚ α)).toFun X.x₀ = (ConcreteCategory.hom (β ⊚ a)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (a ⊚ α)).toFun X.x₁ = (ConcreteCategory.hom (β ⊚ a)).toFun X.x₁ rfl All goals completed! 🐙
Or, alternatively, using the categorical framework we defined earlier, a is a map in 𝑺↻ if it is a morphism in our category of endomaps of sets.
def Xα : SetWithEndomap := {
carrier := X
toEnd := α
}
def Yβ : SetWithEndomap := {
carrier := Y
toEnd := β
}
def a' : Xα ⟶ Yβ := ⟨
a,
by ⊢ a ⊚ Xα.toEnd = Yβ.toEnd ⊚ a
ext x x:Xα.carrier⊢ (ConcreteCategory.hom (a ⊚ Xα.toEnd)).toFun x = (ConcreteCategory.hom (Yβ.toEnd ⊚ a)).toFun x
cases x x₀ ⊢ (ConcreteCategory.hom (a ⊚ Xα.toEnd)).toFun X.x₀ = (ConcreteCategory.hom (Yβ.toEnd ⊚ a)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (a ⊚ Xα.toEnd)).toFun X.x₁ = (ConcreteCategory.hom (Yβ.toEnd ⊚ a)).toFun X.x₁ <;> x₀ ⊢ (ConcreteCategory.hom (a ⊚ Xα.toEnd)).toFun X.x₀ = (ConcreteCategory.hom (Yβ.toEnd ⊚ a)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (a ⊚ Xα.toEnd)).toFun X.x₁ = (ConcreteCategory.hom (Yβ.toEnd ⊚ a)).toFun X.x₁ rfl All goals completed! 🐙
⟩
Show that a is injective.
Solution: Exercise 20
cf. Exercise 18 above.
example : ∀ {T : Type} (x₁ x₂ : T ⟶ X),
a ⊚ x₁ = a ⊚ x₂ → x₁ = x₂ := by ⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ X), a ⊚ x₁ = a ⊚ x₂ → x₁ = x₂
let p : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ X), a ⊚ x₁ = a ⊚ x₂ → x₁ = x₂
have h₁ : p ⊚ a = 𝟙 X := by
ext x p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁x:X⊢ (ConcreteCategory.hom (p ⊚ a)).toFun x = (ConcreteCategory.hom (𝟙 X)).toFun x
cases x x₀ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁⊢ (ConcreteCategory.hom (p ⊚ a)).toFun X.x₀ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₀x₁ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁⊢ (ConcreteCategory.hom (p ⊚ a)).toFun X.x₁ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₁ <;> x₀ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁⊢ (ConcreteCategory.hom (p ⊚ a)).toFun X.x₀ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₀x₁ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁⊢ (ConcreteCategory.hom (p ⊚ a)).toFun X.x₁ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₁ rfl p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 X⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ X), a ⊚ x₁ = a ⊚ x₂ → x₁ = x₂
intro _ x₁ x₂ h₂ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₁ = x₂
calc x₁
_ = 𝟙 X ⊚ x₁ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₁ = 𝟙 X ⊚ x₁ rw [Category.comp_id p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₁ = x₁] All goals completed! 🐙
_ = (p ⊚ a) ⊚ x₁ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₁ = (p ⊚ a) ⊚ x₁ rw [h₁ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₁ = 𝟙 X ⊚ x₁] All goals completed! 🐙
_ = p ⊚ a ⊚ x₁ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₁ = p ⊚ a ⊚ x₁ rw [Category.assoc p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₁ = (p ⊚ a) ⊚ x₁] All goals completed! 🐙
_ = p ⊚ a ⊚ x₂ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ p ⊚ a ⊚ x₁ = p ⊚ a ⊚ x₂ rw [h₂ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ p ⊚ a ⊚ x₂ = p ⊚ a ⊚ x₂] All goals completed! 🐙
_ = (p ⊚ a) ⊚ x₂ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ p ⊚ a ⊚ x₂ = (p ⊚ a) ⊚ x₂ rw [Category.assoc p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₂ = (p ⊚ a) ⊚ x₂] All goals completed! 🐙
_ = 𝟙 X ⊚ x₂ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ (p ⊚ a) ⊚ x₂ = 𝟙 X ⊚ x₂ rw [h₁ p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₂ = 𝟙 X ⊚ x₂] All goals completed! 🐙
_ = x₂ := by p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ 𝟙 X ⊚ x₂ = x₂ rw [Category.comp_id p:Y ⟶ X :=
↾fun x ↦
match x with
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁h₁:p ⊚ a = 𝟙 XT✝:Typex₁:T✝ ⟶ Xx₂:T✝ ⟶ Xh₂:a ⊚ x₁ = a ⊚ x₂⊢ x₂ = x₂] All goals completed! 🐙
Show that, as a map {X \xrightarrow{a} Y} in 𝑺, a has exactly two retractions p.
Solution: Exercise 21
We found one retraction p_1 in Exercise 20.
def p₁ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁
example : p₁ ⊚ a = 𝟙 X := by ⊢ p₁ ⊚ a = 𝟙 X
ext x x:X⊢ (ConcreteCategory.hom (p₁ ⊚ a)).toFun x = (ConcreteCategory.hom (𝟙 X)).toFun x
cases x x₀ ⊢ (ConcreteCategory.hom (p₁ ⊚ a)).toFun X.x₀ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (p₁ ⊚ a)).toFun X.x₁ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₁ <;> x₀ ⊢ (ConcreteCategory.hom (p₁ ⊚ a)).toFun X.x₀ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (p₁ ⊚ a)).toFun X.x₁ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₁ rfl All goals completed! 🐙
Using p_1 with Danilo's formula, we find that a has exactly two retractions.
#eval Danilo's_formula (Finset.univ) (Finset.univ) a p₁
(by ⊢ ⇑(ConcreteCategory.hom p₁) ∘ ⇑(ConcreteCategory.hom a) = id
funext x x:(fun X ↦ X) X⊢ (⇑(ConcreteCategory.hom p₁) ∘ ⇑(ConcreteCategory.hom a)) x = id x
fin_cases x «0» ⊢ (⇑(ConcreteCategory.hom p₁) ∘ ⇑(ConcreteCategory.hom a)) X.x₀ = id X.x₀«1» ⊢ (⇑(ConcreteCategory.hom p₁) ∘ ⇑(ConcreteCategory.hom a)) X.x₁ = id X.x₁ <;> «0» ⊢ (⇑(ConcreteCategory.hom p₁) ∘ ⇑(ConcreteCategory.hom a)) X.x₀ = id X.x₀«1» ⊢ (⇑(ConcreteCategory.hom p₁) ∘ ⇑(ConcreteCategory.hom a)) X.x₁ = id X.x₁ rfl All goals completed! 🐙)
(by ⊢ Function.Injective ⇑(ConcreteCategory.hom a)
intro x y _ x:Xy:Xa✝:(ConcreteCategory.hom a) x = (ConcreteCategory.hom a) y⊢ x = y
fin_cases x «0» y:Xa✝:(ConcreteCategory.hom a) X.x₀ = (ConcreteCategory.hom a) y⊢ X.x₀ = y«1» y:Xa✝:(ConcreteCategory.hom a) X.x₁ = (ConcreteCategory.hom a) y⊢ X.x₁ = y <;> «0» y:Xa✝:(ConcreteCategory.hom a) X.x₀ = (ConcreteCategory.hom a) y⊢ X.x₀ = y«1» y:Xa✝:(ConcreteCategory.hom a) X.x₁ = (ConcreteCategory.hom a) y⊢ X.x₁ = y fin_cases y «1».«0» a✝:(ConcreteCategory.hom a) X.x₁ = (ConcreteCategory.hom a) X.x₀⊢ X.x₁ = X.x₀«1».«1» a✝:(ConcreteCategory.hom a) X.x₁ = (ConcreteCategory.hom a) X.x₁⊢ X.x₁ = X.x₁
all_goals
first | rfl All goals completed! 🐙
| simp only [reduceCtorEq] «1».«0» a✝:(ConcreteCategory.hom a) X.x₁ = (ConcreteCategory.hom a) X.x₀⊢ False; trivial All goals completed! 🐙)
The other retraction p_2 is
def p₂ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₀
example : p₂ ⊚ a = 𝟙 X := by ⊢ p₂ ⊚ a = 𝟙 X
ext x x:X⊢ (ConcreteCategory.hom (p₂ ⊚ a)).toFun x = (ConcreteCategory.hom (𝟙 X)).toFun x
cases x x₀ ⊢ (ConcreteCategory.hom (p₂ ⊚ a)).toFun X.x₀ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (p₂ ⊚ a)).toFun X.x₁ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₁ <;> x₀ ⊢ (ConcreteCategory.hom (p₂ ⊚ a)).toFun X.x₀ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (p₂ ⊚ a)).toFun X.x₁ = (ConcreteCategory.hom (𝟙 X)).toFun X.x₁ rfl All goals completed! 🐙
Show that neither of the maps p found in the preceding exercise is a map {Y^{↻\beta} \rightarrow X^{↻\alpha}} in 𝑺↻. Hence a has no retractions in 𝑺↻.
Solution: Exercise 22
p_1 is not a map {Y^{↻\beta} \rightarrow X^{↻\alpha}} in 𝑺↻.
open ConcreteCategory in
example : ¬(p₁ ⊚ β = α ⊚ p₁) := by ⊢ ¬p₁ ⊚ β = α ⊚ p₁
intro h h:p₁ ⊚ β = α ⊚ p₁⊢ False
have h_contra : (p₁ ⊚ β) Y.y₂ = (α ⊚ p₁) Y.y₂ := congr_hom h Y.y₂ h:p₁ ⊚ β = α ⊚ p₁h_contra:(hom (p₁ ⊚ β)) Y.y₂ = (hom (α ⊚ p₁)) Y.y₂⊢ False
dsimp [p₁, α, β] at h_contra h:p₁ ⊚ β = α ⊚ p₁h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
p_2 is not a map {Y^{↻\beta} \rightarrow X^{↻\alpha}} in 𝑺↻.
open ConcreteCategory in
example : ¬(p₂ ⊚ β = α ⊚ p₂) := by ⊢ ¬p₂ ⊚ β = α ⊚ p₂
intro h h:p₂ ⊚ β = α ⊚ p₂⊢ False
have h_contra : (p₂ ⊚ β) Y.y₂ = (α ⊚ p₂) Y.y₂ := congr_hom h Y.y₂ h:p₂ ⊚ β = α ⊚ p₂h_contra:(hom (p₂ ⊚ β)) Y.y₂ = (hom (α ⊚ p₂)) Y.y₂⊢ False
dsimp [p₂, α, β] at h_contra h:p₂ ⊚ β = α ⊚ p₂h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
Since, by Exercise 21, p_1 and p_2 are the only retractions of a in 𝑺, they are the only candidates for retractions of a in 𝑺↻; hence a has no retractions in 𝑺↻.
How many of the eight 𝑺-maps {Y \rightarrow X} (if any) are actually 𝑺↻-maps?
Y^{↻\beta} \rightarrow X^{↻\alpha}
Solution: Exercise 23
For an 𝑺-map b to be an 𝑺↻-map, we require that {b \beta = \alpha b}. Since {\alpha b = x_0}, it follows that we require {b \beta = x_0}. That is, we require {b(y_0) = x_0} and {b(y_1) = x_0}, which leaves b(y_2) as the only degree of freedom. Hence just two of the eight 𝑺-maps {Y \rightarrow X} are actually 𝑺↻-maps {Y^{↻\beta} \rightarrow X^{↻\alpha}}, as given below.
The 𝑺-maps b_1 and b_2 are 𝑺↻-maps.
def b₁ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₀
| Y.y₂ => X.x₀
example : b₁ ⊚ β = α ⊚ b₁ := by ⊢ b₁ ⊚ β = α ⊚ b₁
ext y y:Y⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun y = (ConcreteCategory.hom (α ⊚ b₁)).toFun y
cases y y₀ ⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun Y.y₀ = (ConcreteCategory.hom (α ⊚ b₁)).toFun Y.y₀y₁ ⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun Y.y₁ = (ConcreteCategory.hom (α ⊚ b₁)).toFun Y.y₁y₂ ⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun Y.y₂ = (ConcreteCategory.hom (α ⊚ b₁)).toFun Y.y₂ <;> y₀ ⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun Y.y₀ = (ConcreteCategory.hom (α ⊚ b₁)).toFun Y.y₀y₁ ⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun Y.y₁ = (ConcreteCategory.hom (α ⊚ b₁)).toFun Y.y₁y₂ ⊢ (ConcreteCategory.hom (b₁ ⊚ β)).toFun Y.y₂ = (ConcreteCategory.hom (α ⊚ b₁)).toFun Y.y₂ rfl All goals completed! 🐙
def b₂ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₀
| Y.y₂ => X.x₁
example : b₂ ⊚ β = α ⊚ b₂ := by ⊢ b₂ ⊚ β = α ⊚ b₂
ext y y:Y⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun y = (ConcreteCategory.hom (α ⊚ b₂)).toFun y
cases y y₀ ⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun Y.y₀ = (ConcreteCategory.hom (α ⊚ b₂)).toFun Y.y₀y₁ ⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun Y.y₁ = (ConcreteCategory.hom (α ⊚ b₂)).toFun Y.y₁y₂ ⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun Y.y₂ = (ConcreteCategory.hom (α ⊚ b₂)).toFun Y.y₂ <;> y₀ ⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun Y.y₀ = (ConcreteCategory.hom (α ⊚ b₂)).toFun Y.y₀y₁ ⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun Y.y₁ = (ConcreteCategory.hom (α ⊚ b₂)).toFun Y.y₁y₂ ⊢ (ConcreteCategory.hom (b₂ ⊚ β)).toFun Y.y₂ = (ConcreteCategory.hom (α ⊚ b₂)).toFun Y.y₂ rfl All goals completed! 🐙
The remaining 𝑺-maps b_3 to b_8 are not 𝑺↻-maps.
def b₃ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₁
| Y.y₁ => X.x₀
| Y.y₂ => X.x₀
open ConcreteCategory in
example : b₃ ⊚ β ≠ α ⊚ b₃ := by ⊢ b₃ ⊚ β ≠ α ⊚ b₃
by_contra h h:b₃ ⊚ β = α ⊚ b₃⊢ False
have h_contra : (b₃ ⊚ β) Y.y₀ = (α ⊚ b₃) Y.y₀ := congr_hom h Y.y₀ h:b₃ ⊚ β = α ⊚ b₃h_contra:(hom (b₃ ⊚ β)) Y.y₀ = (hom (α ⊚ b₃)) Y.y₀⊢ False
dsimp [b₃, α, β] at h_contra h:b₃ ⊚ β = α ⊚ b₃h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
def b₄ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₁
| Y.y₁ => X.x₀
| Y.y₂ => X.x₁
open ConcreteCategory in
example : b₄ ⊚ β ≠ α ⊚ b₄ := by ⊢ b₄ ⊚ β ≠ α ⊚ b₄
by_contra h h:b₄ ⊚ β = α ⊚ b₄⊢ False
have h_contra : (b₄ ⊚ β) Y.y₀ = (α ⊚ b₄) Y.y₀ := congr_hom h Y.y₀ h:b₄ ⊚ β = α ⊚ b₄h_contra:(hom (b₄ ⊚ β)) Y.y₀ = (hom (α ⊚ b₄)) Y.y₀⊢ False
dsimp [b₄, α, β] at h_contra h:b₄ ⊚ β = α ⊚ b₄h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
def b₅ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₀
open ConcreteCategory in
example : b₅ ⊚ β ≠ α ⊚ b₅ := by ⊢ b₅ ⊚ β ≠ α ⊚ b₅
by_contra h h:b₅ ⊚ β = α ⊚ b₅⊢ False
have h_contra : (b₅ ⊚ β) Y.y₂ = (α ⊚ b₅) Y.y₂ := congr_hom h Y.y₂ h:b₅ ⊚ β = α ⊚ b₅h_contra:(hom (b₅ ⊚ β)) Y.y₂ = (hom (α ⊚ b₅)) Y.y₂⊢ False
dsimp [b₅, α, β] at h_contra h:b₅ ⊚ β = α ⊚ b₅h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
def b₆ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₀
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁
open ConcreteCategory in
example : b₆ ⊚ β ≠ α ⊚ b₆ := by ⊢ b₆ ⊚ β ≠ α ⊚ b₆
by_contra h h:b₆ ⊚ β = α ⊚ b₆⊢ False
have h_contra : (b₆ ⊚ β) Y.y₂ = (α ⊚ b₆) Y.y₂ := congr_hom h Y.y₂ h:b₆ ⊚ β = α ⊚ b₆h_contra:(hom (b₆ ⊚ β)) Y.y₂ = (hom (α ⊚ b₆)) Y.y₂⊢ False
dsimp [b₆, α, β] at h_contra h:b₆ ⊚ β = α ⊚ b₆h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
def b₇ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₁
| Y.y₁ => X.x₁
| Y.y₂ => X.x₀
open ConcreteCategory in
example : b₇ ⊚ β ≠ α ⊚ b₇ := by ⊢ b₇ ⊚ β ≠ α ⊚ b₇
by_contra h h:b₇ ⊚ β = α ⊚ b₇⊢ False
have h_contra : (b₇ ⊚ β) Y.y₂ = (α ⊚ b₇) Y.y₂ := congr_hom h Y.y₂ h:b₇ ⊚ β = α ⊚ b₇h_contra:(hom (b₇ ⊚ β)) Y.y₂ = (hom (α ⊚ b₇)) Y.y₂⊢ False
dsimp [b₇, α, β] at h_contra h:b₇ ⊚ β = α ⊚ b₇h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
def b₈ : Y ⟶ X := ↾fun
| Y.y₀ => X.x₁
| Y.y₁ => X.x₁
| Y.y₂ => X.x₁
open ConcreteCategory in
example : b₈ ⊚ β ≠ α ⊚ b₈ := by ⊢ b₈ ⊚ β ≠ α ⊚ b₈
by_contra h h:b₈ ⊚ β = α ⊚ b₈⊢ False
have h_contra : (b₈ ⊚ β) Y.y₂ = (α ⊚ b₈) Y.y₂ := congr_hom h Y.y₂ h:b₈ ⊚ β = α ⊚ b₈h_contra:(hom (b₈ ⊚ β)) Y.y₂ = (hom (α ⊚ b₈)) Y.y₂⊢ False
dsimp [b₈, α, β] at h_contra h:b₈ ⊚ β = α ⊚ b₈h_contra:X.x₁ = X.x₀⊢ False
contradiction All goals completed! 🐙
Show that our map a does not have any retractions, even when considered (via the insertion J in Section 7 of this article) as being a map in the 'looser' category 𝑺↓.
Solution: Exercise 24
Emulating the insertion J,
def X' : SimpleGraph := {
carrierA := X
carrierD := X
toFun := α
}
def Y' : SimpleGraph := {
carrierA := Y
carrierD := Y
toFun := β
}
def a'' : X' ⟶ Y' := ⟨
(a, a),
by ⊢ (a, a).2 ⊚ X'.toFun = Y'.toFun ⊚ (a, a).1
ext x x:X'.carrierA⊢ (ConcreteCategory.hom ((a, a).2 ⊚ X'.toFun)).toFun x = (ConcreteCategory.hom (Y'.toFun ⊚ (a, a).1)).toFun x
cases x x₀ ⊢ (ConcreteCategory.hom ((a, a).2 ⊚ X'.toFun)).toFun X.x₀ = (ConcreteCategory.hom (Y'.toFun ⊚ (a, a).1)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom ((a, a).2 ⊚ X'.toFun)).toFun X.x₁ = (ConcreteCategory.hom (Y'.toFun ⊚ (a, a).1)).toFun X.x₁ <;> x₀ ⊢ (ConcreteCategory.hom ((a, a).2 ⊚ X'.toFun)).toFun X.x₀ = (ConcreteCategory.hom (Y'.toFun ⊚ (a, a).1)).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom ((a, a).2 ⊚ X'.toFun)).toFun X.x₁ = (ConcreteCategory.hom (Y'.toFun ⊚ (a, a).1)).toFun X.x₁ rfl All goals completed! 🐙
⟩
we can show that a has no retractions.
open ConcreteCategory in
example : ¬(∃ p : Y' ⟶ X', p ⊚ a'' = 𝟙 X') := by ⊢ ¬∃ p, p ⊚ a'' = 𝟙 X'
push Not ⊢ ∀ (p : Y' ⟶ X'), p ⊚ a'' ≠ 𝟙 X'
intro p p:Y' ⟶ X'⊢ p ⊚ a'' ≠ 𝟙 X'
obtain ⟨p, hp_comm⟩ := p p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ Y'.toFun = X'.toFun ⊚ p.1⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
dsimp [X', Y'] at hp_comm p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
have hpβ₀ : ∀ y, (α ⊚ p.1) y = X.x₀ := by ⊢ ¬∃ p, p ⊚ a'' = 𝟙 X'
intro y p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1y:Y'.carrierA⊢ (hom (α ⊚ p.1)) y = X.x₀
change α (p.1 y) = X.x₀ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1y:Y'.carrierA⊢ (hom α) ((hom p.1) y) = X.x₀
cases p.1 y x₀ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1y:Y'.carrierA⊢ (hom α) X.x₀ = X.x₀x₁ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1y:Y'.carrierA⊢ (hom α) X.x₁ = X.x₀ <;> x₀ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1y:Y'.carrierA⊢ (hom α) X.x₀ = X.x₀x₁ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1y:Y'.carrierA⊢ (hom α) X.x₁ = X.x₀ rfl p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : (fun X ↦ X) Y'.carrierA), (hom (α ⊚ p.1)) y = X.x₀⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
erw [← hp_comm p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : (fun X ↦ X) Y'.carrierA), (hom (p.2 ⊚ β)) y = X.x₀⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'] p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : (fun X ↦ X) Y'.carrierA), (hom (p.2 ⊚ β)) y = X.x₀⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X' at hpβ₀
dsimp [Y'] at hpβ₀ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
have hpβ : p.2 (β Y.y₂) = X.x₀ := hpβ₀ Y.y₂ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) ((hom β) Y.y₂) = X.x₀⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
have hβ : β Y.y₂ = Y.y₁ := rfl p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) ((hom β) Y.y₂) = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
rw [hβ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'] at hpβ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ ⟨p, hp_comm⟩ ⊚ a'' ≠ 𝟙 X'
dsimp [CategoryStruct.comp, CategoryStruct.id, a''] p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ ¬⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩
by_contra h₁ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩⊢ False
have h₂ : (p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X) :=
congrArg Subtype.val h₁ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)⊢ False
have h₃ : p.2 ⊚ a = 𝟙 X := congrArg Prod.snd h₂ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 X⊢ False
have hpa₀ : ∀ x, p.2 (a x) = x := congr_hom h₃ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = x⊢ False
have hpa : p.2 (a X.x₁) = X.x₁ := hpa₀ X.x₁ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = xhpa:(hom p.2) ((hom a) X.x₁) = X.x₁⊢ False
have ha : a X.x₁ = Y.y₁ := rfl p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = xhpa:(hom p.2) ((hom a) X.x₁) = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False
rw [ha p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = xhpa:(hom p.2) Y.y₁ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False] at hpa p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = xhpa:(hom p.2) Y.y₁ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False
rw [hpβ p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = xhpa:X.x₀ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False] at hpa p:(Y'.carrierA ⟶ X'.carrierA) × (Y'.carrierD ⟶ X'.carrierD)hp_comm:p.2 ⊚ β = α ⊚ p.1hpβ₀:∀ (y : Y), (hom (p.2 ⊚ β)) y = X.x₀hpβ:(hom p.2) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.1.hom'.comp a.hom' }, { hom' := p.2.hom'.comp a.hom' }), ⋯⟩ =
⟨({ hom' := TypeCat.Fun.id X'.carrierA }, { hom' := TypeCat.Fun.id X'.carrierD }), ⋯⟩h₂:(p.1 ⊚ a, p.2 ⊚ a) = (𝟙 X, 𝟙 X)h₃:p.2 ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p.2) ((hom a) x) = xhpa:X.x₀ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False
contradiction All goals completed! 🐙
Or, alternatively, using our functor J defined earlier,
open ConcreteCategory in
example : ¬(∃ p : Yβ ⟶ Xα, J p ⊚ J a' = J (𝟙 Xα)) := by ⊢ ¬∃ p, J p ⊚ J a' = J (𝟙 Xα)
push Not ⊢ ∀ (p : Yβ ⟶ Xα), J p ⊚ J a' ≠ J (𝟙 Xα)
intro p p:Yβ ⟶ Xα⊢ J p ⊚ J a' ≠ J (𝟙 Xα)
obtain ⟨p, hp_comm⟩ := p p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ Yβ.toEnd = Xα.toEnd ⊚ p⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
dsimp [Xα, Yβ] at hp_comm p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ p⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
have hpβ₀ : ∀ y, (α ⊚ p) y = X.x₀ := by ⊢ ¬∃ p, J p ⊚ J a' = J (𝟙 Xα)
intro y p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ py:Yβ.carrier⊢ (hom (α ⊚ p)) y = X.x₀
change α (p y) = X.x₀ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ py:Yβ.carrier⊢ (hom α) ((hom p) y) = X.x₀
cases p y x₀ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ py:Yβ.carrier⊢ (hom α) X.x₀ = X.x₀x₁ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ py:Yβ.carrier⊢ (hom α) X.x₁ = X.x₀ <;> x₀ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ py:Yβ.carrier⊢ (hom α) X.x₀ = X.x₀x₁ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ py:Yβ.carrier⊢ (hom α) X.x₁ = X.x₀ rfl p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : (fun X ↦ X) Yβ.carrier), (hom (α ⊚ p)) y = X.x₀⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
erw [← hp_comm p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : (fun X ↦ X) Yβ.carrier), (hom (p ⊚ β)) y = X.x₀⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)] p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : (fun X ↦ X) Yβ.carrier), (hom (p ⊚ β)) y = X.x₀⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα) at hpβ₀
dsimp [Yβ] at hpβ₀ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
have hpβ : p (β Y.y₂) = X.x₀ := hpβ₀ Y.y₂ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) ((hom β) Y.y₂) = X.x₀⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
have hβ : β Y.y₂ = Y.y₁ := rfl p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) ((hom β) Y.y₂) = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
rw [hβ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)] at hpβ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ J ⟨p, hp_comm⟩ ⊚ J a' ≠ J (𝟙 Xα)
dsimp [CategoryStruct.comp, CategoryStruct.id, a', J,
functorSetWithEndomapToSimpleGraph] p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁⊢ ¬⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩
by_contra h₁ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩⊢ False
have h₂ : (p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X) :=
congrArg Subtype.val h₁ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)⊢ False
have h₃ : p ⊚ a = 𝟙 X := congrArg Prod.snd h₂ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 X⊢ False
have hpa₀ : ∀ x, p (a x) = x := congr_hom h₃ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = x⊢ False
have hpa : p (a X.x₁) = X.x₁ := hpa₀ X.x₁ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = xhpa:(hom p) ((hom a) X.x₁) = X.x₁⊢ False
have ha : a X.x₁ = Y.y₁ := rfl p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = xhpa:(hom p) ((hom a) X.x₁) = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False
rw [ha p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = xhpa:(hom p) Y.y₁ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False] at hpa p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = xhpa:(hom p) Y.y₁ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False
rw [hpβ p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = xhpa:X.x₀ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False] at hpa p:Yβ.carrier ⟶ Xα.carrierhp_comm:p ⊚ β = α ⊚ phpβ₀:∀ (y : Y), (hom (p ⊚ β)) y = X.x₀hpβ:(hom p) Y.y₁ = X.x₀hβ:(hom β) Y.y₂ = Y.y₁h₁:⟨({ hom' := p.hom'.comp a.hom' }, { hom' := p.hom'.comp a.hom' }), ⋯⟩ =
⟨(↑(SetWithEndomapHom.id Xα), ↑(SetWithEndomapHom.id Xα)), ⋯⟩h₂:(p ⊚ a, p ⊚ a) = (𝟙 X, 𝟙 X)h₃:p ⊚ a = 𝟙 Xhpa₀:∀ (x : (fun X ↦ X) X), (hom p) ((hom a) x) = xhpa:X.x₀ = X.x₁ha:(hom a) X.x₁ = Y.y₁⊢ False
contradiction All goals completed! 🐙
Show that for any two graphs and any 𝑺⇊-map between them
X \xrightarrow{f_A} Y,\; P \xrightarrow{f_D} Q,\; X \xrightarrow{s} P,\; X \xrightarrow{t} P,\; Y \xrightarrow{s'} Q,\; Y \xrightarrow{t'} Q
the equation {f_D \circ s = f_D \circ t} can only be true when f_A maps every arrow in X to a loop (relative to s', t') in Y.
Solution: Exercise 25
We first give a proof without using Category IrreflexiveGraph that we defined previously.
open ConcreteCategory in
example {X P Y Q : Type}
(s t : X ⟶ P) (s' t' : Y ⟶ Q) (fA : X ⟶ Y) (fD : P ⟶ Q)
(hfSrc_comm : fD ⊚ s = s' ⊚ fA) (hfTgt_comm : fD ⊚ t = t' ⊚ fA)
: fD ⊚ s = fD ⊚ t ↔ ∀ x, s' (fA x) = t' (fA x) := by X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fA⊢ fD ⊚ s = fD ⊚ t ↔ ∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)
constructor mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fA⊢ fD ⊚ s = fD ⊚ t → ∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fA⊢ (∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)) → fD ⊚ s = fD ⊚ t
· mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fA⊢ fD ⊚ s = fD ⊚ t → ∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x) intro h x mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:fD ⊚ s = fD ⊚ tx:X⊢ (hom s') ((hom fA) x) = (hom t') ((hom fA) x)
change (s' ⊚ fA) x = (t' ⊚ fA) x mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:fD ⊚ s = fD ⊚ tx:X⊢ (hom (s' ⊚ fA)) x = (hom (t' ⊚ fA)) x
rw [← hfSrc_comm, mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:fD ⊚ s = fD ⊚ tx:X⊢ (hom (fD ⊚ s)) x = (hom (t' ⊚ fA)) x ← hfTgt_comm mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:fD ⊚ s = fD ⊚ tx:X⊢ (hom (fD ⊚ s)) x = (hom (fD ⊚ t)) x] mp X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:fD ⊚ s = fD ⊚ tx:X⊢ (hom (fD ⊚ s)) x = (hom (fD ⊚ t)) x
exact congr_hom h x All goals completed! 🐙
· mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fA⊢ (∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)) → fD ⊚ s = fD ⊚ t intro h mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)⊢ fD ⊚ s = fD ⊚ t
rw [hfSrc_comm, mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)⊢ s' ⊚ fA = fD ⊚ t hfTgt_comm mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)⊢ s' ⊚ fA = t' ⊚ fA] mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)⊢ s' ⊚ fA = t' ⊚ fA
ext x mpr X:TypeP:TypeY:TypeQ:Types:X ⟶ Pt:X ⟶ Ps':Y ⟶ Qt':Y ⟶ QfA:X ⟶ YfD:P ⟶ QhfSrc_comm:fD ⊚ s = s' ⊚ fAhfTgt_comm:fD ⊚ t = t' ⊚ fAh:∀ (x : (fun X ↦ X) X), (hom s') ((hom fA) x) = (hom t') ((hom fA) x)x:X⊢ (hom (s' ⊚ fA)).toFun x = (hom (t' ⊚ fA)).toFun x
exact h x All goals completed! 🐙
Using Category IrreflexiveGraph, we have
variable (XP YQ : IrreflexiveGraph) (f : XP ⟶ YQ)
-- Align to the notation in the book
set_option quotPrecheck false
local notation "fA" => f.val.1
local notation "fD" => f.val.2
set_option quotPrecheck true
local notation "s" => XP.toSrc
local notation "s'" => YQ.toSrc
local notation "t" => XP.toTgt
local notation "t'" => YQ.toTgt
open ConcreteCategory in
example : (fD ⊚ s = fD ⊚ t) ↔ (∀ x, s' (fA x) = t' (fA x)) := by XP:IrreflexiveGraphYQ:IrreflexiveGraphf:XP ⟶ YQ⊢ (↑f).2 ⊚ XP.toSrc = (↑f).2 ⊚ XP.toTgt ↔
∀ (x : (fun X ↦ X) XP.carrierA), (hom YQ.toSrc) ((hom (↑f).1) x) = (hom YQ.toTgt) ((hom (↑f).1) x)
obtain ⟨f, hfSrc_comm, hfTgt_comm⟩ := f XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1⊢ (↑⟨f, ⋯⟩).2 ⊚ XP.toSrc = (↑⟨f, ⋯⟩).2 ⊚ XP.toTgt ↔
∀ (x : (fun X ↦ X) XP.carrierA), (hom YQ.toSrc) ((hom (↑⟨f, ⋯⟩).1) x) = (hom YQ.toTgt) ((hom (↑⟨f, ⋯⟩).1) x)
dsimp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1⊢ f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgt ↔ ∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)
constructor mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1⊢ f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgt → ∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1⊢ (∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)) → f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgt
· mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1⊢ f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgt → ∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x) intro h x mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgtx:XP.carrierA⊢ (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)
change (s' ⊚ f.1) x = (t' ⊚ f.1) x mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgtx:XP.carrierA⊢ (hom (YQ.toSrc ⊚ f.1)) x = (hom (YQ.toTgt ⊚ f.1)) x
rw [← hfSrc_comm, mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgtx:XP.carrierA⊢ (hom (f.2 ⊚ XP.toSrc)) x = (hom (YQ.toTgt ⊚ f.1)) x ← hfTgt_comm mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgtx:XP.carrierA⊢ (hom (f.2 ⊚ XP.toSrc)) x = (hom (f.2 ⊚ XP.toTgt)) x] mp XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgtx:XP.carrierA⊢ (hom (f.2 ⊚ XP.toSrc)) x = (hom (f.2 ⊚ XP.toTgt)) x
exact congr_hom h x All goals completed! 🐙
· mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1⊢ (∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)) → f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgt intro h mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)⊢ f.2 ⊚ XP.toSrc = f.2 ⊚ XP.toTgt
rw [hfSrc_comm, mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)⊢ YQ.toSrc ⊚ f.1 = f.2 ⊚ XP.toTgt hfTgt_comm mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)⊢ YQ.toSrc ⊚ f.1 = YQ.toTgt ⊚ f.1] mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)⊢ YQ.toSrc ⊚ f.1 = YQ.toTgt ⊚ f.1
ext x mpr XP:IrreflexiveGraphYQ:IrreflexiveGraphf:(XP.carrierA ⟶ YQ.carrierA) × (XP.carrierD ⟶ YQ.carrierD)hfSrc_comm:f.2 ⊚ XP.toSrc = YQ.toSrc ⊚ f.1hfTgt_comm:f.2 ⊚ XP.toTgt = YQ.toTgt ⊚ f.1h:∀ (x : XP.carrierA), (hom YQ.toSrc) ((hom f.1) x) = (hom YQ.toTgt) ((hom f.1) x)x:XP.carrierA⊢ (hom (YQ.toSrc ⊚ f.1)).toFun x = (hom (YQ.toTgt ⊚ f.1)).toFun x
exact h x All goals completed! 🐙
There is an 'inclusion' map {\mathbb{Z} \xrightarrow{f} \mathbb{Q}} in 𝑺 for which
-
{\mathbb{Z}^{↻5\times()} \xrightarrow{f} \mathbb{Q}^{↻5\times()}}is a map in 𝑺↻, and -
\mathbb{Q}^{↻5\times()}is an automorphism, and -
fis injective.
Find the f and prove the three statements.
Solution: Exercise 26
Rule is {f(x) = x / 1}.
def f : ℤ ⟶ ℚ := ↾fun x ↦ (x : ℚ)
1. We show that {\mathbb{Z}^{↻5\times()} \xrightarrow{f} \mathbb{Q}^{↻5\times()}} is a map in 𝑺↻.
def Z : SetWithEndomap := {
carrier := ℤ
toEnd := ↾fun x ↦ 5 * x
}
def Q : SetWithEndomap := {
carrier := ℚ
toEnd := ↾fun x ↦ 5 * x
}
example : Z ⟶ Q := ⟨
f,
by ⊢ f ⊚ Z.toEnd = Q.toEnd ⊚ f
ext (x : ℤ) x:ℤ⊢ (ConcreteCategory.hom (f ⊚ Z.toEnd)).toFun x = (ConcreteCategory.hom (Q.toEnd ⊚ f)).toFun x
dsimp [Z, Q, f] x:ℤ⊢ ↑(5 * x) = 5 * ↑x
norm_cast All goals completed! 🐙
⟩
2. We show that \mathbb{Q}^{↻5\times()} is an automorphism.
example : SetWithInvEndomap := {
carrier := Q.carrier
toEnd := Q.toEnd
inv := by ⊢ ∃ inv, inv ⊚ Q.toEnd = 𝟙 Q.carrier ∧ Q.toEnd ⊚ inv = 𝟙 Q.carrier
let finv : ℚ ⟶ ℚ := ↾fun x ↦ x / 5 finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5⊢ ∃ inv, inv ⊚ Q.toEnd = 𝟙 Q.carrier ∧ Q.toEnd ⊚ inv = 𝟙 Q.carrier
use finv h finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5⊢ finv ⊚ Q.toEnd = 𝟙 Q.carrier ∧ Q.toEnd ⊚ finv = 𝟙 Q.carrier
constructor h.left finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5⊢ finv ⊚ Q.toEnd = 𝟙 Q.carrierh.right finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5⊢ Q.toEnd ⊚ finv = 𝟙 Q.carrier
· h.left finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5⊢ finv ⊚ Q.toEnd = 𝟙 Q.carrier ext (x : ℚ) h.left finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5x:ℚ⊢ (ConcreteCategory.hom (finv ⊚ Q.toEnd)).toFun x = (ConcreteCategory.hom (𝟙 Q.carrier)).toFun x
change (5 * x) / 5 = x h.left finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5x:ℚ⊢ 5 * x / 5 = x
ring All goals completed! 🐙
· h.right finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5⊢ Q.toEnd ⊚ finv = 𝟙 Q.carrier ext (x : ℚ) h.right finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5x:ℚ⊢ (ConcreteCategory.hom (Q.toEnd ⊚ finv)).toFun x = (ConcreteCategory.hom (𝟙 Q.carrier)).toFun x
change 5 * (x / 5) = x h.right finv:ℚ ⟶ ℚ := ↾fun x ↦ x / 5x:ℚ⊢ 5 * (x / 5) = x
ring All goals completed! 🐙
}
3. We show that f is injective.
example : ∀ {T : Type} (x₁ x₂ : T ⟶ ℤ),
f ⊚ x₁ = f ⊚ x₂ → x₁ = x₂ := by ⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ ℤ), f ⊚ x₁ = f ⊚ x₂ → x₁ = x₂
let p : ℚ ⟶ ℤ := ↾fun y ↦ y.num p:ℚ ⟶ ℤ := ↾fun y ↦ y.num⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ ℤ), f ⊚ x₁ = f ⊚ x₂ → x₁ = x₂
have h₁ : p ⊚ f = 𝟙 ℤ := by
dsimp [f, p] p:ℚ ⟶ ℤ := ↾fun y ↦ y.num⊢ ((↾fun y ↦ y.num) ⊚ ↾fun x ↦ ↑x) = 𝟙 ℤ
ext x p:ℚ ⟶ ℤ := ↾fun y ↦ y.numx:ℤ⊢ (ConcreteCategory.hom ((↾fun y ↦ y.num) ⊚ ↾fun x ↦ ↑x)).toFun x = (ConcreteCategory.hom (𝟙 ℤ)).toFun x
congr p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤ⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ ℤ), f ⊚ x₁ = f ⊚ x₂ → x₁ = x₂
intro _ x₁ x₂ h₂ p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ x₁ = x₂
calc x₁
_ = 𝟙 ℤ ⊚ x₁ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ x₁ = 𝟙 ℤ ⊚ x₁ rw [Category.comp_id p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ x₁ = x₁] All goals completed! 🐙
_ = (p ⊚ f) ⊚ x₁ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ 𝟙 ℤ ⊚ x₁ = (p ⊚ f) ⊚ x₁ rw [h₁ p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ 𝟙 ℤ ⊚ x₁ = 𝟙 ℤ ⊚ x₁] All goals completed! 🐙
_ = p ⊚ f ⊚ x₁ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ (p ⊚ f) ⊚ x₁ = p ⊚ f ⊚ x₁ rw [Category.assoc p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ (p ⊚ f) ⊚ x₁ = (p ⊚ f) ⊚ x₁] All goals completed! 🐙
_ = p ⊚ f ⊚ x₂ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ p ⊚ f ⊚ x₁ = p ⊚ f ⊚ x₂ rw [h₂ p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ p ⊚ f ⊚ x₂ = p ⊚ f ⊚ x₂] All goals completed! 🐙
_ = (p ⊚ f) ⊚ x₂ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ p ⊚ f ⊚ x₂ = (p ⊚ f) ⊚ x₂ rw [Category.assoc p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ (p ⊚ f) ⊚ x₂ = (p ⊚ f) ⊚ x₂] All goals completed! 🐙
_ = 𝟙 ℤ ⊚ x₂ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ (p ⊚ f) ⊚ x₂ = 𝟙 ℤ ⊚ x₂ rw [h₁ p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ 𝟙 ℤ ⊚ x₂ = 𝟙 ℤ ⊚ x₂] All goals completed! 🐙
_ = x₂ := by p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ 𝟙 ℤ ⊚ x₂ = x₂ rw [Category.comp_id p:ℚ ⟶ ℤ := ↾fun y ↦ y.numh₁:p ⊚ f = 𝟙 ℤT✝:Typex₁:T✝ ⟶ ℤx₂:T✝ ⟶ ℤh₂:f ⊚ x₁ = f ⊚ x₂⊢ x₂ = x₂] All goals completed! 🐙
Consider our standard idempotent
inductive X
| x₀ | x₁
def α : X ⟶ X := ↾fun
| X.x₀ => X.x₀
| X.x₁ => X.x₀
def Xα : SetWithIdemEndomap := {
carrier := X
toEnd := α
idem := by ⊢ α ⊚ α = α
ext x x:X⊢ (ConcreteCategory.hom (α ⊚ α)).toFun x = (ConcreteCategory.hom α).toFun x
cases x x₀ ⊢ (ConcreteCategory.hom (α ⊚ α)).toFun X.x₀ = (ConcreteCategory.hom α).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (α ⊚ α)).toFun X.x₁ = (ConcreteCategory.hom α).toFun X.x₁ <;> x₀ ⊢ (ConcreteCategory.hom (α ⊚ α)).toFun X.x₀ = (ConcreteCategory.hom α).toFun X.x₀x₁ ⊢ (ConcreteCategory.hom (α ⊚ α)).toFun X.x₁ = (ConcreteCategory.hom α).toFun X.x₁ rfl All goals completed! 🐙
}
and let Y^{↻\beta} be any automorphism. Show that any 𝑺↻-map {X^{↻\alpha} \xrightarrow{f} Y^{↻\beta}} must be non-injective, i.e. must map both elements of X to the same (fixed) point of \beta in Y.
Solution: Exercise 27
We show that any 𝑺↻-map {X^{↻\alpha} \xrightarrow{f} Y^{↻\beta}} must be non-injective.
open ConcreteCategory in
example (Yβ : SetWithInvEndomap)
(f : Xα.toSetWithEndomap ⟶ Yβ.toSetWithEndomap)
: f X.x₀ = f X.x₁ := by Yβ:SetWithInvEndomapf:Xα.toSetWithEndomap ⟶ Yβ.toSetWithEndomap⊢ (hom f) X.x₀ = (hom f) X.x₁
obtain ⟨βinv, hβ_inv, _⟩ := Yβ.inv Yβ:SetWithInvEndomapf:Xα.toSetWithEndomap ⟶ Yβ.toSetWithEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrier⊢ (hom f) X.x₀ = (hom f) X.x₁
obtain ⟨f, hf_comm⟩ := f Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ f⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁
have hf_comm_x₀ : f X.x₀ = Yβ.toEnd (f X.x₀) :=
congr_hom hf_comm X.x₀ Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁
have hf_comm_x₁ : f X.x₀ = Yβ.toEnd (f X.x₁) :=
congr_hom hf_comm X.x₁ Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁
have hβfx_eq : Yβ.toEnd (f X.x₀) = Yβ.toEnd (f X.x₁) := by Yβ:SetWithInvEndomapf:Xα.toSetWithEndomap ⟶ Yβ.toSetWithEndomap⊢ (hom f) X.x₀ = (hom f) X.x₁
rw [← hf_comm_x₀, Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)⊢ (hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁) hf_comm_x₁ Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)⊢ (hom Yβ.toEnd) ((hom f) X.x₁) = (hom Yβ.toEnd) ((hom f) X.x₁)] Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)hβfx_eq:(hom Yβ.toEnd) ((hom f) X.x₀) = (hom Yβ.toEnd) ((hom f) X.x₁)⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁
have h_cancel
: (βinv ⊚ Yβ.toEnd) (f X.x₀) = (βinv ⊚ Yβ.toEnd) (f X.x₁) :=
congrArg βinv hβfx_eq Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)hβfx_eq:(hom Yβ.toEnd) ((hom f) X.x₀) = (hom Yβ.toEnd) ((hom f) X.x₁)h_cancel:(hom (βinv ⊚ Yβ.toEnd)) ((hom f) X.x₀) = (hom (βinv ⊚ Yβ.toEnd)) ((hom f) X.x₁)⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁
rwa [hβ_inv Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)hβfx_eq:(hom Yβ.toEnd) ((hom f) X.x₀) = (hom Yβ.toEnd) ((hom f) X.x₁)h_cancel:(hom (𝟙 Yβ.carrier)) ((hom f) X.x₀) = (hom (𝟙 Yβ.carrier)) ((hom f) X.x₁)⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁] Yβ:SetWithInvEndomapβinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrierright✝:Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierf:Xα.carrier ⟶ Yβ.carrierhf_comm:f ⊚ Xα.toEnd = Yβ.toEnd ⊚ fhf_comm_x₀:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₀)hf_comm_x₁:(hom f) X.x₀ = (hom Yβ.toEnd) ((hom f) X.x₁)hβfx_eq:(hom Yβ.toEnd) ((hom f) X.x₀) = (hom Yβ.toEnd) ((hom f) X.x₁)h_cancel:(hom (𝟙 Yβ.carrier)) ((hom f) X.x₀) = (hom (𝟙 Yβ.carrier)) ((hom f) X.x₁)⊢ (hom ⟨f, hf_comm⟩) X.x₀ = (hom ⟨f, hf_comm⟩) X.x₁ at h_cancel
If X^{↻\alpha} is any object of 𝑺↻ for which there exists an injective 𝑺↻-map f to some Y^{↻\beta} where \beta is in the subcategory of automorphisms, then \alpha itself must be injective.
Solution: Exercise 28
cf. Mono f.val, Mono Xα.toEnd.val.
example (Xα : SetWithEndomap) (Yβ : SetWithInvEndomap)
(f : Xα ⟶ Yβ.toSetWithEndomap)
(hf_inj : ∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier),
f.val ⊚ y₁ = f.val ⊚ y₂ → y₁ = y₂)
: ∀ {T : Type} (x₁ x₂ : T ⟶ Xα.carrier),
Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂ → x₁ = x₂ := by Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ Xα.carrier), Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂ → x₁ = x₂
intro _ x₁ x₂ h₁ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂⊢ x₁ = x₂
have h₂ : f.val ⊚ Xα.toEnd ⊚ x₁ = f.val ⊚ Xα.toEnd ⊚ x₂ := by Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ Xα.carrier), Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂ → x₁ = x₂
congrm f.val ⊚ ?_ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂⊢ Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂
exact h₁ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:↑f ⊚ Xα.toEnd ⊚ x₁ = ↑f ⊚ Xα.toEnd ⊚ x₂⊢ x₁ = x₂
repeat rw [Category.assoc, Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(↑f ⊚ Xα.toEnd) ⊚ x₁ = ↑f ⊚ Xα.toEnd ⊚ x₂⊢ x₁ = x₂ f.property Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = ↑f ⊚ Xα.toEnd ⊚ x₂⊢ x₁ = x₂] Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = ↑f ⊚ Xα.toEnd ⊚ x₂⊢ x₁ = x₂ at h₂ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂⊢ x₁ = x₂
obtain ⟨βinv, hβ_inv⟩ := Yβ.inv Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrier⊢ x₁ = x₂
have h₃ : βinv ⊚ Yβ.toEnd ⊚ f.val ⊚ x₁ =
βinv ⊚ Yβ.toEnd ⊚ f.val ⊚ x₂ := by Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂⊢ ∀ {T : Type} (x₁ x₂ : T ⟶ Xα.carrier), Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂ → x₁ = x₂
congrm βinv ⊚ ?_ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrier⊢ Yβ.toEnd ⊚ ↑f ⊚ x₁ = Yβ.toEnd ⊚ ↑f ⊚ x₂
exact h₂ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:βinv ⊚ Yβ.toEnd ⊚ ↑f ⊚ x₁ = βinv ⊚ Yβ.toEnd ⊚ ↑f ⊚ x₂⊢ x₁ = x₂
rw [Category.assoc, Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:(βinv ⊚ Yβ.toEnd) ⊚ ↑f ⊚ x₁ = βinv ⊚ Yβ.toEnd ⊚ ↑f ⊚ x₂⊢ x₁ = x₂ hβ_inv.1, Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:𝟙 Yβ.carrier ⊚ ↑f ⊚ x₁ = βinv ⊚ Yβ.toEnd ⊚ ↑f ⊚ x₂⊢ x₁ = x₂ Category.assoc (f.val ⊚ x₂), Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:𝟙 Yβ.carrier ⊚ ↑f ⊚ x₁ = (βinv ⊚ Yβ.toEnd) ⊚ ↑f ⊚ x₂⊢ x₁ = x₂
hβ_inv.1 Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:𝟙 Yβ.carrier ⊚ ↑f ⊚ x₁ = 𝟙 Yβ.carrier ⊚ ↑f ⊚ x₂⊢ x₁ = x₂] at h₃ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:𝟙 Yβ.carrier ⊚ ↑f ⊚ x₁ = 𝟙 Yβ.carrier ⊚ ↑f ⊚ x₂⊢ x₁ = x₂
repeat rw [Category.comp_id Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:↑f ⊚ x₁ = 𝟙 Yβ.carrier ⊚ ↑f ⊚ x₂⊢ x₁ = x₂] Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:↑f ⊚ x₁ = 𝟙 Yβ.carrier ⊚ ↑f ⊚ x₂⊢ x₁ = x₂ at h₃ Xα:SetWithEndomapYβ:SetWithInvEndomapf:Xα ⟶ Yβ.toSetWithEndomaphf_inj:∀ {U : Type} (y₁ y₂ : U ⟶ Xα.carrier), ↑f ⊚ y₁ = ↑f ⊚ y₂ → y₁ = y₂T✝:Typex₁:T✝ ⟶ Xα.carrierx₂:T✝ ⟶ Xα.carrierh₁:Xα.toEnd ⊚ x₁ = Xα.toEnd ⊚ x₂h₂:(Yβ.toEnd ⊚ ↑f) ⊚ x₁ = (Yβ.toEnd ⊚ ↑f) ⊚ x₂βinv:Yβ.carrier ⟶ Yβ.carrierhβ_inv:βinv ⊚ Yβ.toEnd = 𝟙 Yβ.carrier ∧ Yβ.toEnd ⊚ βinv = 𝟙 Yβ.carrierh₃:↑f ⊚ x₁ = ↑f ⊚ x₂⊢ x₁ = x₂
exact hf_inj x₁ x₂ h₃ All goals completed! 🐙
11. Types of structure
Every map {X \xrightarrow{f} Y} in 𝑿 gives rise to a map in the category of 𝑨-structures, by the associative law.
Solution: Exercise 29
TODO Exercise III.29
If S, s, t is a given bipointed object ... in a category 𝒞, then for each object X of 𝒞, the graph of 'X fields' on S is actually a reflexive graph, and for each map {X \xrightarrow{f} Y} in 𝒞, the induced maps on sets constitute a map of reflexive graphs.
Solution: Exercise 30
TODO Exercise III.30