Session 9: Retracts and idempotents
1. Retracts and comparisons
(In the category of sets) Show that unless the set A has a point and B has none, then there is at least one map from A to B.
Solution: Exercise 1
TODO Exercise 9.1
cases: A = β => single map A β β , B = β => no map A β β , B β β => at least one map
A is a retract of B means that there are maps {A \xrightarrow{s} B \xrightarrow{r} A} with {r s = 1_A}.
The corresponding mathlib definition is Retract, which we print below for reference.
#print Retract
(In any category) Show that
(R) A is a retract of A.
(T) If A is a retract of B and B is a retract of C then A is a retract of C.
Hint: You already proved (T) when you proved that if a composable pair of maps each has a retraction, then so does their composite.
Solution: Exercise 2
variable {π : Type u} [Category.{v, u} π] {A B C : π}
We show that (R) holds.
example : Retract A A := {
i := π A
r := π A
}
We show that (T) holds (cf. Proposition 3 in Article II).
example (hβ : Retract A B) (hβ : Retract B C) : Retract A C := {
i := hβ.i β hβ.i
r := hβ.r β hβ.r
}
2. Idempotents as records of retracts
(In any category) If {B \xrightarrow{e} B} is an idempotent map, a splitting of e consists of an object A together with two maps {A \xrightarrow{s} B \xrightarrow{r} A} with {r s = 1_A} and {s r = e}.
We implement Splitting in Lean as follows:
structure Splitting {π : Type u} [Category.{v, u} π] {B : π}
(e : B βΆ B) [IsIdempotent e] where
A : π
s : A βΆ B
r : B βΆ A
rs : r β s = π A
sr : s β r = e
(In any category) Suppose that both {A \xrightarrow{s} B \xrightarrow{r} A} and {A' \xrightarrow{s'} B \xrightarrow{r'} A'} split the same idempotent {B \xrightarrow{e} B}. Use these maps to construct an isomorphism {A \xrightarrow{f} A'}.
Solution: Exercise 3
We construct an isomorphism f as follows:
example {π : Type u} [Category.{v, u} π] {B : π}
{e : B βΆ B} [IsIdempotent e]
(hsr : Splitting e) (hsr' : Splitting e)
: Iso hsr.A hsr'.A := {
hom := hsr'.r β hsr.s
inv := hsr.r β hsr'.s
hom_inv_id := π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting eβ’ (hsr.r β hsr'.s) β hsr'.r β hsr.s = π hsr.A
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting eβ’ (hsr.r β e) β hsr.s = π hsr.A
-- rw [β hsr.sr] needs a bit of hand-holding here
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| (hsr.r β e) β hsr.s = π hsr.A
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| (hsr.r β e) β hsr.s
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| hsr.r β e
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| e
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| hsr.s β hsr.r
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting eβ’ (π hsr.A β hsr.r) β hsr.s = π hsr.A
All goals completed! π
inv_hom_id := π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting eβ’ (hsr'.r β hsr.s) β hsr.r β hsr'.s = π hsr'.A
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting eβ’ (hsr'.r β e) β hsr'.s = π hsr'.A
-- rw [β hsr'.sr] likewise needs a bit of hand-holding here
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| (hsr'.r β e) β hsr'.s = π hsr'.A
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| (hsr'.r β e) β hsr'.s
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| hsr'.r β e
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| e
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting e| hsr'.s β hsr'.r
π:Type uinstβΒΉ:Category.{v, u} πB:πe:B βΆ Binstβ:IsIdempotent ehsr:Splitting ehsr':Splitting eβ’ (π hsr'.A β hsr'.r) β hsr'.s = π hsr'.A
All goals completed! π
}