Session 11: Ascending to categories of richer structures
1. A category of richer structures: Endomaps of sets
How many maps can you find? (There are fewer than seven.)
Solution: Exercise 1
Label the elements in the three-element set A as a_1, a_2, a_3 (clockwise starting with any element); label the elements in the set X as x_1 for the element forming the one-element loop and x_2, x_3, x_4 (anticlockwise starting with any element) for the elements forming the three-element cycle, ignoring all other elements.
inductive A
| aβ | aβ | aβ
inductive X
| xβ | xβ | xβ | xβ
def A' : SetWithEndomap := {
carrier := A
toEnd := βΎfun
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
}
def X' : SetWithEndomap := {
carrier := X
toEnd := βΎfun -- a restriction of Ξ± to the subset {xβ, xβ, xβ, xβ}
| X.xβ => X.xβ
| X.xβ => X.xβ
| X.xβ => X.xβ
| X.xβ => X.xβ
}
Then there are four structure-preserving maps from A to X, which we call f_1, f_2, f_3, f_4 below.
def fβ : A βΆ X := βΎfun
| A.aβ => X.xβ
| A.aβ => X.xβ
| A.aβ => X.xβ
-- fβ is structure-preserving
example : A' βΆ X' := β¨
fβ,
β’ fβ β A'.toEnd = X'.toEnd β fβ
a:A'.carrierβ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun a = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun a
β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ All goals completed! π
β©
def fβ : A βΆ X := βΎfun
| A.aβ => X.xβ
| A.aβ => X.xβ
| A.aβ => X.xβ
-- fβ is structure-preserving
example : A' βΆ X' := β¨
fβ,
β’ fβ β A'.toEnd = X'.toEnd β fβ
a:A'.carrierβ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun a = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun a
β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ All goals completed! π
β©
def fβ : A βΆ X := βΎfun
| A.aβ => X.xβ
| A.aβ => X.xβ
| A.aβ => X.xβ
-- fβ is structure-preserving
example : A' βΆ X' := β¨
fβ,
β’ fβ β A'.toEnd = X'.toEnd β fβ
a:A'.carrierβ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun a = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun a
β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ All goals completed! π
β©
def fβ : A βΆ X := βΎfun
| A.aβ => X.xβ
| A.aβ => X.xβ
| A.aβ => X.xβ
-- fβ is structure-preserving
example : A' βΆ X' := β¨
fβ,
β’ fβ β A'.toEnd = X'.toEnd β fβ
a:A'.carrierβ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun a = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun a
β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ β’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aββ’ (ConcreteCategory.hom (fβ β A'.toEnd)).toFun A.aβ = (ConcreteCategory.hom (X'.toEnd β fβ)).toFun A.aβ All goals completed! π
β©
3. The category of graphs
inductive X
| a | b | c
def Ξ± : X βΆ X := βΎfun
| X.a => X.c
| X.b => X.a
| X.c => X.b
def XΞ± : SetWithEndomap := {
carrier := X
toEnd := Ξ±
}
inductive Y
| p | q | r
def Ξ² : Y βΆ Y := βΎfun
| Y.p => Y.q
| Y.q => Y.r
| Y.r => Y.p
def YΞ² : SetWithEndomap := {
carrier := Y
toEnd := Ξ²
}
Find an isomorphism from X^{β»\alpha} to Y^{β»\beta}. How many such isomorphisms are there?
Hint: You need to find {X \xrightarrow{f} Y} such that {f \alpha = \beta f}, and check that f has an inverse {Y \xrightarrow{f^{-1}} X} (meaning {f^{-1}f = 1_X} and {ff^{-1} = 1_Y}). Then you'll still need to check that f^{-1} is a map in πΊβ» (meaning {f^{-1} \beta = \alpha f^{-1}}), but see Exercise 4, below.
Solution: Exercise 2
There are three such isomorphisms, which we call f_1, f_2, f_3 below.
def fβ : X βΆ Y := βΎfun
| X.a => Y.r
| X.b => Y.q
| X.c => Y.p
--fβ is an isomorphism
example : β f : XΞ± βΆ YΞ², IsIso f := β’ β f, IsIso f
f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ β f, IsIso f
let finv : YΞ² βΆ XΞ± := β¨
βΎfun
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
by f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd =
XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a
-- fβ»ΒΉΞ² = Ξ±fβ»ΒΉ
ext y f:XΞ± βΆ YΞ² := β¨fβ, β―β©y:YΞ².carrierβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
y =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
y
cases y p f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
Y.p =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
Y.q =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
Y.r =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
Y.r <;> p f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
Y.p =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
Y.q =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a) β
YΞ².toEnd)).toFun
Y.r =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a)).toFun
Y.r rfl All goals completed! π
β© f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ β f, IsIso f
use f h f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ IsIso f
use finv h f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ finv β f = π XΞ± β§ f β finv = π YΞ²
constructor h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ finv β f = π XΞ±h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ f β finv = π YΞ²
Β· h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ finv β f = π XΞ± -- fβ»ΒΉf = π X
have h : finv.val β f.val = π X := by β’ β f, IsIso f
ext x f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©x:XΞ±.carrierβ’ (ConcreteCategory.hom (βfinv β βf)).toFun x = (ConcreteCategory.hom (π X)).toFun x
cases x a f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.a = (ConcreteCategory.hom (π X)).toFun X.ab f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.b = (ConcreteCategory.hom (π X)).toFun X.bc f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.c = (ConcreteCategory.hom (π X)).toFun X.c <;> a f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.a = (ConcreteCategory.hom (π X)).toFun X.ab f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.b = (ConcreteCategory.hom (π X)).toFun X.bc f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.c = (ConcreteCategory.hom (π X)).toFun X.c rfl h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©h:βfinv β βf = π Xβ’ finv β f = π XΞ±
exact Subtype.ext h All goals completed! π
Β· h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ f β finv = π YΞ² -- ffβ»ΒΉ = π Y
have h : f.val β finv.val = π Y := by β’ β f, IsIso f
ext y f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©y:YΞ².carrierβ’ (ConcreteCategory.hom (βf β βfinv)).toFun y = (ConcreteCategory.hom (π Y)).toFun y
cases y p f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.p = (ConcreteCategory.hom (π Y)).toFun Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.q = (ConcreteCategory.hom (π Y)).toFun Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.r = (ConcreteCategory.hom (π Y)).toFun Y.r <;> p f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.p = (ConcreteCategory.hom (π Y)).toFun Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.q = (ConcreteCategory.hom (π Y)).toFun Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.r = (ConcreteCategory.hom (π Y)).toFun Y.r rfl h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.c
| Y.q => X.b
| Y.r => X.a,
β―β©h:βf β βfinv = π Yβ’ f β finv = π YΞ²
exact Subtype.ext h All goals completed! π
def fβ : X βΆ Y := βΎfun
| X.a => Y.q
| X.b => Y.p
| X.c => Y.r
--fβ is an isomorphism
example : β f : XΞ± βΆ YΞ², IsIso f := by β’ β f, IsIso f
let f : XΞ± βΆ YΞ² := β¨
fβ,
by β’ fβ β XΞ±.toEnd = YΞ².toEnd β fβ
-- fΞ± = Ξ²f
ext x x:XΞ±.carrierβ’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun x = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun x
cases x a β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.a = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.ab β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.b = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.bc β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.c = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.c <;> a β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.a = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.ab β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.b = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.bc β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.c = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.c rfl All goals completed! π
β© f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ β f, IsIso f
let finv : YΞ² βΆ XΞ± := β¨
βΎfun
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
by f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd =
XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c
-- fβ»ΒΉΞ² = Ξ±fβ»ΒΉ
ext y f:XΞ± βΆ YΞ² := β¨fβ, β―β©y:YΞ².carrierβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
y =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
y
cases y p f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
Y.p =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
Y.q =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
Y.r =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
Y.r <;> p f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
Y.p =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
Y.q =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c) β
YΞ².toEnd)).toFun
Y.r =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c)).toFun
Y.r rfl All goals completed! π
β© f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ β f, IsIso f
use f h f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ IsIso f
use finv h f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ finv β f = π XΞ± β§ f β finv = π YΞ²
constructor h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ finv β f = π XΞ±h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ f β finv = π YΞ²
Β· h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ finv β f = π XΞ± -- fβ»ΒΉf = π X
have h : finv.val β f.val = π X := by β’ β f, IsIso f
ext x f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©x:XΞ±.carrierβ’ (ConcreteCategory.hom (βfinv β βf)).toFun x = (ConcreteCategory.hom (π X)).toFun x
cases x a f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.a = (ConcreteCategory.hom (π X)).toFun X.ab f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.b = (ConcreteCategory.hom (π X)).toFun X.bc f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.c = (ConcreteCategory.hom (π X)).toFun X.c <;> a f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.a = (ConcreteCategory.hom (π X)).toFun X.ab f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.b = (ConcreteCategory.hom (π X)).toFun X.bc f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.c = (ConcreteCategory.hom (π X)).toFun X.c rfl h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©h:βfinv β βf = π Xβ’ finv β f = π XΞ±
exact Subtype.ext h All goals completed! π
Β· h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ f β finv = π YΞ² -- ffβ»ΒΉ = π Y
have h : f.val β finv.val = π Y := by β’ β f, IsIso f
ext y f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©y:YΞ².carrierβ’ (ConcreteCategory.hom (βf β βfinv)).toFun y = (ConcreteCategory.hom (π Y)).toFun y
cases y p f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.p = (ConcreteCategory.hom (π Y)).toFun Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.q = (ConcreteCategory.hom (π Y)).toFun Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.r = (ConcreteCategory.hom (π Y)).toFun Y.r <;> p f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.p = (ConcreteCategory.hom (π Y)).toFun Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.q = (ConcreteCategory.hom (π Y)).toFun Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.r = (ConcreteCategory.hom (π Y)).toFun Y.r rfl h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.b
| Y.q => X.a
| Y.r => X.c,
β―β©h:βf β βfinv = π Yβ’ f β finv = π YΞ²
exact Subtype.ext h All goals completed! π
def fβ : X βΆ Y := βΎfun
| X.a => Y.p
| X.b => Y.r
| X.c => Y.q
--fβ is an isomorphism
example : β f : XΞ± βΆ YΞ², IsIso f := by β’ β f, IsIso f
let f : XΞ± βΆ YΞ² := β¨
fβ,
by β’ fβ β XΞ±.toEnd = YΞ².toEnd β fβ
-- fΞ± = Ξ²f
ext x x:XΞ±.carrierβ’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun x = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun x
cases x a β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.a = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.ab β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.b = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.bc β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.c = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.c <;> a β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.a = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.ab β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.b = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.bc β’ (ConcreteCategory.hom (fβ β XΞ±.toEnd)).toFun X.c = (ConcreteCategory.hom (YΞ².toEnd β fβ)).toFun X.c rfl All goals completed! π
β© f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ β f, IsIso f
let finv : YΞ² βΆ XΞ± := β¨
βΎfun
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
by f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd =
XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b
-- fβ»ΒΉΞ² = Ξ±fβ»ΒΉ
ext y f:XΞ± βΆ YΞ² := β¨fβ, β―β©y:YΞ².carrierβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
y =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
y
cases y p f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
Y.p =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
Y.q =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
Y.r =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
Y.r <;> p f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
Y.p =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
Y.q =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b) β
YΞ².toEnd)).toFun
Y.r =
(ConcreteCategory.hom
(XΞ±.toEnd β
βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b)).toFun
Y.r rfl All goals completed! π
β© f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ β f, IsIso f
use f h f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ IsIso f
use finv h f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ finv β f = π XΞ± β§ f β finv = π YΞ²
constructor h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ finv β f = π XΞ±h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ f β finv = π YΞ²
Β· h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ finv β f = π XΞ± -- fβ»ΒΉf = π X
have h : finv.val β f.val = π X := by β’ β f, IsIso f
ext x f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©x:XΞ±.carrierβ’ (ConcreteCategory.hom (βfinv β βf)).toFun x = (ConcreteCategory.hom (π X)).toFun x
cases x a f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.a = (ConcreteCategory.hom (π X)).toFun X.ab f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.b = (ConcreteCategory.hom (π X)).toFun X.bc f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.c = (ConcreteCategory.hom (π X)).toFun X.c <;> a f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.a = (ConcreteCategory.hom (π X)).toFun X.ab f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.b = (ConcreteCategory.hom (π X)).toFun X.bc f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βfinv β βf)).toFun X.c = (ConcreteCategory.hom (π X)).toFun X.c rfl h.left f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©h:βfinv β βf = π Xβ’ finv β f = π XΞ±
exact Subtype.ext h All goals completed! π
Β· h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ f β finv = π YΞ² -- ffβ»ΒΉ = π Y
have h : f.val β finv.val = π Y := by β’ β f, IsIso f
ext y f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©y:YΞ².carrierβ’ (ConcreteCategory.hom (βf β βfinv)).toFun y = (ConcreteCategory.hom (π Y)).toFun y
cases y p f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.p = (ConcreteCategory.hom (π Y)).toFun Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.q = (ConcreteCategory.hom (π Y)).toFun Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.r = (ConcreteCategory.hom (π Y)).toFun Y.r <;> p f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.p = (ConcreteCategory.hom (π Y)).toFun Y.pq f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.q = (ConcreteCategory.hom (π Y)).toFun Y.qr f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©β’ (ConcreteCategory.hom (βf β βfinv)).toFun Y.r = (ConcreteCategory.hom (π Y)).toFun Y.r rfl h.right f:XΞ± βΆ YΞ² := β¨fβ, β―β©finv:YΞ² βΆ XΞ± :=
β¨βΎfun x β¦
match x with
| Y.p => X.a
| Y.q => X.c
| Y.r => X.b,
β―β©h:βf β βfinv = π Yβ’ f β finv = π YΞ²
exact Subtype.ext h All goals completed! π
Prove that there is no isomorphism (in πΊβ»)
from
inductive X
| xβ | xβ | xβ | xβ
def Ξ± : X βΆ X := βΎfun
| X.xβ => X.xβ
| X.xβ => X.xβ
| X.xβ => X.xβ
| X.xβ => X.xβ
def XΞ± : SetWithEndomap := {
carrier := X
toEnd := Ξ±
}
to
inductive Y
| yβ | yβ | yβ | yβ
def Ξ² : Y βΆ Y := βΎfun
| Y.yβ => Y.yβ
| Y.yβ => Y.yβ
| Y.yβ => Y.yβ
| Y.yβ => Y.yβ
def YΞ² : SetWithEndomap := {
carrier := Y
toEnd := Ξ²
}
Hint: In fact, more is true: there is no map (in πΊβ») from X^{β»\alpha} to Y^{β»\beta}.
Solution: Exercise 3
We give a proof by contradiction below.
example : Β¬(β f : XΞ± βΆ YΞ², IsIso f) := by β’ Β¬β f, IsIso f
rintro β¨f, _β© f:XΞ± βΆ YΞ²hβ:IsIso fβ’ False
-- X.xβ is a fixed point of Ξ± β Ξ± β Ξ±,
have hβ : (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd) X.xβ = X.xβ := by β’ Β¬β f, IsIso f rfl f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ False
-- but Ξ² β Ξ² β Ξ² has no fixed points in Y
have hβ : β y : Y, (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd) y β y := by β’ Β¬β f, IsIso f
intro y f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβy:Yβ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β y
cases y yβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβyβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβyβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβyβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβ <;> yβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβyβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβyβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβyβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xββ’ (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) Y.yβ β Y.yβ exact fun h β¦ by contradiction f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ False
-- Since f β (Ξ± β Ξ± β Ξ±) = (Ξ² β Ξ² β Ξ²) β f, we can derive a
-- contradiction
have h_contra : f.val ((XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd) X.xβ) =
(YΞ².toEnd β YΞ².toEnd β YΞ².toEnd) (f.val X.xβ) := by β’ Β¬β f, IsIso f
rw [β types_comp_apply f.val (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)
X.xβ, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom ((YΞ².toEnd β YΞ².toEnd β YΞ².toEnd) β βf)) X.xβ
β Category.assoc, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β (YΞ².toEnd β YΞ².toEnd) β βf)) X.xβ β Category.assoc, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd β βf)) X.xβ β f.property f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β βf β XΞ±.toEnd)) X.xβ] f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β βf β XΞ±.toEnd)) X.xβ
rw [Category.assoc XΞ±.toEnd f.val, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β (YΞ².toEnd β βf) β XΞ±.toEnd)) X.xβ β f.property f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β (βf β XΞ±.toEnd) β XΞ±.toEnd)) X.xβ] f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β (βf β XΞ±.toEnd) β XΞ±.toEnd)) X.xβ
rw [Category.assoc XΞ±.toEnd (f.val β XΞ±.toEnd), f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom ((YΞ².toEnd β βf β XΞ±.toEnd) β XΞ±.toEnd)) X.xβ
Category.assoc XΞ±.toEnd f.val, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (((YΞ².toEnd β βf) β XΞ±.toEnd) β XΞ±.toEnd)) X.xβ β f.property f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (((βf β XΞ±.toEnd) β XΞ±.toEnd) β XΞ±.toEnd)) X.xβ] f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (((βf β XΞ±.toEnd) β XΞ±.toEnd) β XΞ±.toEnd)) X.xβ
rw [β Category.assoc, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom ((βf β XΞ±.toEnd) β XΞ±.toEnd β XΞ±.toEnd)) X.xβ β Category.assoc, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (βf β XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ
types_comp_apply (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd) _ X.xβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yβ’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ)] f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yh_contra:(ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ)β’ False
have : (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd) (f.val X.xβ) =
f.val X.xβ := by β’ Β¬β f, IsIso f
rw [β h_contra, f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yh_contra:(ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ)β’ (ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom βf) X.xβ hβ f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yh_contra:(ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ)β’ (ConcreteCategory.hom βf) X.xβ = (ConcreteCategory.hom βf) X.xβ] f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yh_contra:(ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ)this:(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ) =
(ConcreteCategory.hom βf) X.xββ’ False
have : (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd) (f.val X.xβ) β
f.val X.xβ := hβ (f.val X.xβ) f:XΞ± βΆ YΞ²hβ:IsIso fhβ:(ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ = X.xβhβ:β (y : Y), (ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) y β yh_contra:(ConcreteCategory.hom βf) ((ConcreteCategory.hom (XΞ±.toEnd β XΞ±.toEnd β XΞ±.toEnd)) X.xβ) =
(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ)thisβ:(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ) =
(ConcreteCategory.hom βf) X.xβthis:(ConcreteCategory.hom (YΞ².toEnd β YΞ².toEnd β YΞ².toEnd)) ((ConcreteCategory.hom βf) X.xβ) β
(ConcreteCategory.hom βf) X.xββ’ False
contradiction All goals completed! π
Suppose {A^{β»\alpha} \xrightarrow{f} B^{β»\beta}} is a map in πΊβ», and that as a map of sets, {A \xrightarrow{f} B} has an inverse {B \xrightarrow{f^{-1}} A}. Show that f^{-1} is automatically a map in πΊβ».
Solution: Exercise 4
Let {g = f^{-1}}.
example {AΞ± BΞ² : SetWithEndomap}
(f : AΞ± βΆ BΞ²) (g : BΞ².carrier βΆ AΞ±.carrier)
(h : g β f.val = π AΞ±.carrier β§ f.val β g = π BΞ².carrier)
: β finv : BΞ² βΆ AΞ±, finv.val = g := by AΞ±:SetWithEndomapBΞ²:SetWithEndomapf:AΞ± βΆ BΞ²g:BΞ².carrier βΆ AΞ±.carrierh:g β βf = π AΞ±.carrier β§ βf β g = π BΞ².carrierβ’ β finv, βfinv = g
obtain β¨f, hf_commβ© := f AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierβ’ β finv, βfinv = g
use β¨
g,
by AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierβ’ g β BΞ².toEnd = AΞ±.toEnd β g
ext b AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom (g β BΞ².toEnd)).toFun b = (ConcreteCategory.hom (AΞ±.toEnd β g)).toFun b
apply_fun f AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom f) ((ConcreteCategory.hom (g β BΞ².toEnd)).toFun b) =
(ConcreteCategory.hom f) ((ConcreteCategory.hom (AΞ±.toEnd β g)).toFun b)inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ Function.Injective β(ConcreteCategory.hom f)
Β· AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom f) ((ConcreteCategory.hom (g β BΞ².toEnd)).toFun b) =
(ConcreteCategory.hom f) ((ConcreteCategory.hom (AΞ±.toEnd β g)).toFun b) change (f β (g β BΞ².toEnd)) b = (f β (AΞ±.toEnd β g)) b AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom (f β g β BΞ².toEnd)) b = (ConcreteCategory.hom (f β AΞ±.toEnd β g)) b
rw [Category.assoc, AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom ((f β g) β BΞ².toEnd)) b = (ConcreteCategory.hom (f β AΞ±.toEnd β g)) b h.2, AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom (π BΞ².carrier β BΞ².toEnd)) b = (ConcreteCategory.hom (f β AΞ±.toEnd β g)) b Category.comp_id AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom (f β AΞ±.toEnd β g)) b] AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom (f β AΞ±.toEnd β g)) b
rw [Category.assoc, AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom ((f β AΞ±.toEnd) β g)) b hf_comm, AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom ((BΞ².toEnd β f) β g)) b β Category.assoc, AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom (BΞ².toEnd β f β g)) b h.2, AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom (BΞ².toEnd β π BΞ².carrier)) b
Category.id_comp AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ (ConcreteCategory.hom BΞ².toEnd) b = (ConcreteCategory.hom BΞ².toEnd) b] All goals completed! π
Β· inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrierβ’ Function.Injective β(ConcreteCategory.hom f) intro aβ aβ hf inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrieraβ:AΞ±.carrieraβ:AΞ±.carrierhf:(ConcreteCategory.hom f) aβ = (ConcreteCategory.hom f) aββ’ aβ = aβ
have hgf := congrArg g hf inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrieraβ:AΞ±.carrieraβ:AΞ±.carrierhf:(ConcreteCategory.hom f) aβ = (ConcreteCategory.hom f) aβhgf:(ConcreteCategory.hom g) ((ConcreteCategory.hom f) aβ) = (ConcreteCategory.hom g) ((ConcreteCategory.hom f) aβ)β’ aβ = aβ
repeat rw [β types_comp_apply f g, inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrieraβ:AΞ±.carrieraβ:AΞ±.carrierhf:(ConcreteCategory.hom f) aβ = (ConcreteCategory.hom f) aβhgf:(ConcreteCategory.hom (g β f)) aβ = (ConcreteCategory.hom g) ((ConcreteCategory.hom f) aβ)β’ aβ = aβ h.1 inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrieraβ:AΞ±.carrieraβ:AΞ±.carrierhf:(ConcreteCategory.hom f) aβ = (ConcreteCategory.hom f) aβhgf:(ConcreteCategory.hom (π AΞ±.carrier)) aβ = (ConcreteCategory.hom g) ((ConcreteCategory.hom f) aβ)β’ aβ = aβ] inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrieraβ:AΞ±.carrieraβ:AΞ±.carrierhf:(ConcreteCategory.hom f) aβ = (ConcreteCategory.hom f) aβhgf:(ConcreteCategory.hom (π AΞ±.carrier)) aβ = (ConcreteCategory.hom g) ((ConcreteCategory.hom f) aβ)β’ aβ = aβ at hgf inj AΞ±:SetWithEndomapBΞ²:SetWithEndomapg:BΞ².carrier βΆ AΞ±.carrierf:AΞ±.carrier βΆ BΞ².carrierhf_comm:f β AΞ±.toEnd = BΞ².toEnd β fh:g β ββ¨f, hf_commβ© = π AΞ±.carrier β§ ββ¨f, hf_commβ© β g = π BΞ².carrierb:BΞ².carrieraβ:AΞ±.carrieraβ:AΞ±.carrierhf:(ConcreteCategory.hom f) aβ = (ConcreteCategory.hom f) aβhgf:(ConcreteCategory.hom (π AΞ±.carrier)) aβ = (ConcreteCategory.hom (π AΞ±.carrier)) aββ’ aβ = aβ
exact hgf All goals completed! π
β©
{\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, 3, \ldots\}} is the set of integers, and \mathbb{Z}^{β»\alpha} and \mathbb{Z}^{β»\beta} are the maps which add 2 and 3: {\alpha(n) = n + 2}, {\beta(n) = n + 3}. Is \mathbb{Z}^{β»\alpha} isomorphic to \mathbb{Z}^{β»\beta}? (If so, find an isomorphism {\mathbb{Z}^{β»\alpha} \xrightarrow{f} \mathbb{Z}^{β»\beta}}; if not, explain how you know they are not isomorphic.)
Solution: Exercise 5
Define the maps \mathbb{Z}^{β»\alpha} and \mathbb{Z}^{β»\beta} as SetWithEndomap structures.
def Ξ± := (Β· + (2 : β€))
def Ξ² := (Β· + (3 : β€))
abbrev β€Ξ± : SetWithEndomap := {
carrier := β€
toEnd := βΎΞ±
}
abbrev β€Ξ² : SetWithEndomap := {
carrier := β€
toEnd := βΎΞ²
}
We show that \mathbb{Z}^{β»\alpha} is not isomorphic to \mathbb{Z}^{β»\beta}.
open ConcreteCategory in
example (f : β€Ξ± βΆ β€Ξ²) : Β¬(IsIso f) := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
-- Assume f is an isomorphism, and derive a contradiction
by_contra hf_iso f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fβ’ False
-- We begin by extracting the structure-preserving property of f
have hf_comm
: β x : β€, (f.val β β€Ξ±.toEnd) x = (β€Ξ².toEnd β f.val) x := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
intro x f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fx:β€β’ (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) x
exact congr_hom f.property x f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xβ’ False
-- and unfolding the definitions of Ξ± and Ξ²
have hf_comm' : β x : β€, f.val (x + 2) = f.val x + 3 := hf_comm f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3β’ False
-- The key observation: f.val(x + 2) and f.val(x) have the same
-- remainder when divided by 3
have hf_mod_3_eq : β x : β€, f.val (x + 2) β‘ f.val x [ZMOD 3] := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
intro x f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3x:β€β’ (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]
dsimp [Int.ModEq] f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3x:β€β’ (hom βf) (x + 2) % 3 = (hom βf) x % 3
rw [hf_comm' x f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3x:β€β’ ((hom βf) x + 3) % 3 = (hom βf) x % 3] f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3x:β€β’ ((hom βf) x + 3) % 3 = (hom βf) x % 3
omega f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]β’ False
-- Hence all even numbers map to values with the same remainder
-- mod 3 as f.val(0),
have hf_even_congr :
β x : β€, f.val (2 * x) β‘ f.val 0 [ZMOD 3] := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
intro x f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x:β€β’ (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]
dsimp [Int.ModEq] f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x:β€β’ (hom βf) (2 * x) % 3 = (hom βf) 0 % 3
induction x with
| zero => zero f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]β’ (hom βf) (2 * 0) % 3 = (hom βf) 0 % 3 simp All goals completed! π
| succ x' ih => succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * (βx' + 1)) % 3 = (hom βf) 0 % 3 rw [mul_add, succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * βx' + 2 * 1) % 3 = (hom βf) 0 % 3 mul_one, succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * βx' + 2) % 3 = (hom βf) 0 % 3 hf_mod_3_eq (2 * x'), succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * βx') % 3 = (hom βf) 0 % 3
ih succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * βx') % 3 = (hom βf) 0 % 3β’ (hom βf) 0 % 3 = (hom βf) 0 % 3] All goals completed! π
| pred x' ih => pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * (-βx' - 1)) % 3 = (hom βf) 0 % 3 rw [mul_sub, pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * -βx' - 2 * 1) % 3 = (hom βf) 0 % 3
β hf_mod_3_eq (2 * (-x') - 2 * 1), pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * -βx' - 2 * 1 + 2) % 3 = (hom βf) 0 % 3 mul_one, pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * -βx' - 2 + 2) % 3 = (hom βf) 0 % 3
sub_add_cancel, pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3β’ (hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3 ih pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]x':βih:(hom βf) (2 * -βx') % 3 = (hom βf) 0 % 3β’ (hom βf) 0 % 3 = (hom βf) 0 % 3] f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]β’ False
-- and all odd numbers map to values with the same remainder mod 3
-- as f.val(1)
have hf_odd_congr
: β x : β€, f.val (2 * x + 1) β‘ f.val 1 [ZMOD 3] := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
intro x f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x:β€β’ (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]
dsimp [Int.ModEq] f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x:β€β’ (hom βf) (2 * x + 1) % 3 = (hom βf) 1 % 3
induction x with
| zero => zero f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]β’ (hom βf) (2 * 0 + 1) % 3 = (hom βf) 1 % 3 simp All goals completed! π
| succ x' ih => succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * (βx' + 1) + 1) % 3 = (hom βf) 1 % 3
rw [mul_add, succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + 2 * 1 + 1) % 3 = (hom βf) 1 % 3 mul_one succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + 2 + 1) % 3 = (hom βf) 1 % 3] succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + 2 + 1) % 3 = (hom βf) 1 % 3
rw [add_assoc, succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + (2 + 1)) % 3 = (hom βf) 1 % 3 add_comm 2 1, succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + (1 + 2)) % 3 = (hom βf) 1 % 3 β add_assoc succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + 1 + 2) % 3 = (hom βf) 1 % 3] succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + 1 + 2) % 3 = (hom βf) 1 % 3
rw [hf_mod_3_eq (2 * x' + 1), succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3 ih succ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) 1 % 3 = (hom βf) 1 % 3] All goals completed! π
| pred x' ih => pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * (-βx' - 1) + 1) % 3 = (hom βf) 1 % 3
rw [mul_sub, pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * -βx' - 2 * 1 + 1) % 3 = (hom βf) 1 % 3 β hf_mod_3_eq (2 * (-x') - 2 * 1 + 1) pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * -βx' - 2 * 1 + 1 + 2) % 3 = (hom βf) 1 % 3] pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3β’ (hom βf) (2 * -βx' - 2 * 1 + 1 + 2) % 3 = (hom βf) 1 % 3
have : 2 * (-x' : β€) - 2 * 1 + 1 + 2 = 2 * (-x') +1 := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
ring pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3this:2 * -βx' - 2 * 1 + 1 + 2 = 2 * -βx' + 1β’ (hom βf) (2 * -βx' - 2 * 1 + 1 + 2) % 3 = (hom βf) 1 % 3
rw [this pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3this:2 * -βx' - 2 * 1 + 1 + 2 = 2 * -βx' + 1β’ (hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3] pred f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]x':βih:(hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3this:2 * -βx' - 2 * 1 + 1 + 2 = 2 * -βx' + 1β’ (hom βf) (2 * -βx' + 1) % 3 = (hom βf) 1 % 3
exact ih f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]β’ False
-- So the image of f.val can have at most two distinct remainders
-- mod 3
have hf_img_setβ : Set.range (fun x β¦ f.val x % 3) =
{f.val 0 % 3, f.val 1 % 3} := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
ext b f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierβ’ (b β Set.range fun x β¦ (hom βf) x % 3) β b β {(hom βf) 0 % 3, (hom βf) 1 % 3}
constructor mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierβ’ (b β Set.range fun x β¦ (hom βf) x % 3) β b β {(hom βf) 0 % 3, (hom βf) 1 % 3}mpr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierβ’ b β {(hom βf) 0 % 3, (hom βf) 1 % 3} β b β Set.range fun x β¦ (hom βf) x % 3
Β· mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierβ’ (b β Set.range fun x β¦ (hom βf) x % 3) β b β {(hom βf) 0 % 3, (hom βf) 1 % 3} rintro β¨a, hfaβ© mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(fun x β¦ (hom βf) x % 3) a = bβ’ b β {(hom βf) 0 % 3, (hom βf) 1 % 3}
dsimp at hfa mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bβ’ b β {(hom βf) 0 % 3, (hom βf) 1 % 3}
rw [Set.mem_insert_iff, mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bβ’ b = (hom βf) 0 % 3 β¨ b β {(hom βf) 1 % 3} Set.mem_singleton_iff mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bβ’ b = (hom βf) 0 % 3 β¨ b = (hom βf) 1 % 3] mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bβ’ b = (hom βf) 0 % 3 β¨ b = (hom βf) 1 % 3
rcases Int.even_or_odd a with ha_even | ha_odd mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bha_even:Even aβ’ b = (hom βf) 0 % 3 β¨ b = (hom βf) 1 % 3mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bha_odd:Odd aβ’ b = (hom βf) 0 % 3 β¨ b = (hom βf) 1 % 3
Β· mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bha_even:Even aβ’ b = (hom βf) 0 % 3 β¨ b = (hom βf) 1 % 3 left mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bha_even:Even aβ’ b = (hom βf) 0 % 3
obtain β¨a', ha_evenβ© := ha_even mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_even:a = a' + a'β’ b = (hom βf) 0 % 3
rw [β hfa, mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_even:a = a' + a'β’ (hom βf) a % 3 = (hom βf) 0 % 3 ha_even, mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_even:a = a' + a'β’ (hom βf) (a' + a') % 3 = (hom βf) 0 % 3 β two_mul, mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_even:a = a' + a'β’ (hom βf) (2 * a') % 3 = (hom βf) 0 % 3 hf_even_congr a' mp.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_even:a = a' + a'β’ (hom βf) 0 % 3 = (hom βf) 0 % 3] All goals completed! π
Β· mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bha_odd:Odd aβ’ b = (hom βf) 0 % 3 β¨ b = (hom βf) 1 % 3 right mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bha_odd:Odd aβ’ b = (hom βf) 1 % 3
obtain β¨a', ha_oddβ© := ha_odd mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_odd:a = 2 * a' + 1β’ b = (hom βf) 1 % 3
rw [β hfa, mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_odd:a = 2 * a' + 1β’ (hom βf) a % 3 = (hom βf) 1 % 3 ha_odd, mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_odd:a = 2 * a' + 1β’ (hom βf) (2 * a' + 1) % 3 = (hom βf) 1 % 3 hf_odd_congr a' mp.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = ba':β€ha_odd:a = 2 * a' + 1β’ (hom βf) 1 % 3 = (hom βf) 1 % 3] All goals completed! π
Β· mpr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierβ’ b β {(hom βf) 0 % 3, (hom βf) 1 % 3} β b β Set.range fun x β¦ (hom βf) x % 3 intro hb mpr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierhb:b β {(hom βf) 0 % 3, (hom βf) 1 % 3}β’ b β Set.range fun x β¦ (hom βf) x % 3
rcases hb with hb_mem | hb_mem mpr.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierhb_mem:b = (hom βf) 0 % 3β’ b β Set.range fun x β¦ (hom βf) x % 3mpr.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierhb_mem:b β {(hom βf) 1 % 3}β’ b β Set.range fun x β¦ (hom βf) x % 3
all_goals
rw [hb_mem mpr.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierhb_mem:b = (hom βf) 0 % 3β’ (hom βf) 0 % 3 β Set.range fun x β¦ (hom βf) x % 3] mpr.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierhb_mem:b = (hom βf) 0 % 3β’ (hom βf) 0 % 3 β Set.range fun x β¦ (hom βf) x % 3 mpr.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]b:(fun X β¦ X) β€Ξ².carrierhb_mem:b β {(hom βf) 1 % 3}β’ (hom βf) 1 % 3 β Set.range fun x β¦ (hom βf) x % 3
simp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}β’ False
-- Now, since f is an isomorphism, f.val is bijective
have hf_bij : Function.Bijective f.val :=
ConcreteCategory.bijective_of_isIso f f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)β’ False
-- and hence surjective,
have hf_surj : Function.Surjective f.val := hf_bij.right f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)β’ False
-- but a surjective function on β€ must hit all three remainders
-- mod 3
have hf_img_setβ :
Set.range (fun x β¦ f.val x % 3) = {0, 1, 2} := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
ext b f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierβ’ (b β Set.range fun x β¦ (hom βf) x % 3) β b β {0, 1, 2}
constructor mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierβ’ (b β Set.range fun x β¦ (hom βf) x % 3) β b β {0, 1, 2}mpr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierβ’ b β {0, 1, 2} β b β Set.range fun x β¦ (hom βf) x % 3
Β· mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierβ’ (b β Set.range fun x β¦ (hom βf) x % 3) β b β {0, 1, 2} rintro β¨a, hfaβ© mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(fun x β¦ (hom βf) x % 3) a = bβ’ b β {0, 1, 2}
dsimp at hfa mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bβ’ b β {0, 1, 2}
have hf_lbound : 0 β€ f.val a % 3 := Int.emod_nonneg
(f.val a) (by f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bβ’ 3 β 0 decide All goals completed! π : (3 : β€) β 0) mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bhf_lbound:0 β€ (hom βf) a % 3β’ b β {0, 1, 2}
have hf_ubound : f.val a % 3 < 3 := Int.emod_lt_of_pos
(f.val a) (by f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bhf_lbound:0 β€ (hom βf) a % 3β’ 0 < 3 decide All goals completed! π : (0 < (3 : β€))) mp f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierhfa:(hom βf) a % 3 = bhf_lbound:0 β€ (hom βf) a % 3hf_ubound:(hom βf) a % 3 < 3β’ b β {0, 1, 2}
interval_cases k : f.val a % 3 using hf_lbound, hf_ubound mp.Β«0Β» f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierk:(hom βf) a % 3 = 0hfa:0 = bhf_lbound:0 β€ 0hf_ubound:0 < 3β’ b β {0, 1, 2}mp.Β«1Β» f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierk:(hom βf) a % 3 = 1hfa:1 = bhf_lbound:0 β€ 1hf_ubound:1 < 3β’ b β {0, 1, 2}mp.Β«2Β» f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierk:(hom βf) a % 3 = 2hfa:2 = bhf_lbound:0 β€ 2hf_ubound:2 < 3β’ b β {0, 1, 2}
all_goals
rw [β hfa mp.Β«0Β» f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierk:(hom βf) a % 3 = 0hfa:0 = bhf_lbound:0 β€ 0hf_ubound:0 < 3β’ 0 β {0, 1, 2}] mp.Β«1Β» f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierk:(hom βf) a % 3 = 1hfa:1 = bhf_lbound:0 β€ 1hf_ubound:1 < 3β’ 1 β {0, 1, 2} mp.Β«2Β» f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carriera:β€Ξ±.carrierk:(hom βf) a % 3 = 2hfa:2 = bhf_lbound:0 β€ 2hf_ubound:2 < 3β’ 2 β {0, 1, 2}
bound All goals completed! π
Β· mpr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierβ’ b β {0, 1, 2} β b β Set.range fun x β¦ (hom βf) x % 3 rintro (hb | hb | hb) mpr.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b = 0β’ b β Set.range fun x β¦ (hom βf) x % 3mpr.inr.inl f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b = 1β’ b β Set.range fun x β¦ (hom βf) x % 3mpr.inr.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b β {2}β’ b β Set.range fun x β¦ (hom βf) x % 3
all_goals
obtain β¨a, hfaβ© := hf_surj b mpr.inr.inr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b β {2}a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ b β Set.range fun x β¦ (hom βf) x % 3
use a h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b β {2}a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ (fun x β¦ (hom βf) x % 3) a = b
dsimp h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b β {2}a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ (hom βf) a % 3 = b
rw [hfa, h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b = 0a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ b % 3 = b hb h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b = 0a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ 0 % 3 = 0] h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b = 1a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ 1 % 3 = 1 h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)b:(fun X β¦ X) β€Ξ².carrierhb:b β {2}a:β€Ξ±.carrierhfa:(hom βf) a = bβ’ 2 % 3 = 2
norm_num1 f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}β’ False
-- Since we have found that the image of f.val can have at most
-- two distinct elements and must also have exactly three distinct
-- elements, we have a contradiction
have h_cardβ
: Set.ncard ({f.val 0 % 3, f.val 1 % 3} : Set β€) β€ 2 := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
have h := Set.ncard_insert_le (f.val 0 % 3) {f.val 1 % 3} f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ {(hom βf) 1 % 3}.ncard + 1β’ {(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2
rwa [Set.ncard_singleton f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 1 + 1β’ {(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2] f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 1 + 1β’ {(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2 at h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2β’ False
have h_cardβ : Set.ncard ({0, 1, 2} : Set β€) = 3 := by f:β€Ξ± βΆ β€Ξ²β’ Β¬IsIso f
apply Set.ncard_eq_three.mpr f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2β’ β x y z, x β y β§ x β z β§ y β z β§ {0, 1, 2} = {x, y, z}
use 0, 1, 2 h f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2β’ 0 β 1 β§ 0 β 2 β§ 1 β 2 β§ {0, 1, 2} = {0, 1, 2}
trivial f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:{(hom βf) 0 % 3, (hom βf) 1 % 3}.ncard β€ 2h_cardβ:{0, 1, 2}.ncard = 3β’ False
rw [β hf_img_setβ, f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:(Set.range fun x β¦ (hom βf) x % 3).ncard β€ 2h_cardβ:{0, 1, 2}.ncard = 3β’ False hf_img_setβ, f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:{0, 1, 2}.ncard β€ 2h_cardβ:{0, 1, 2}.ncard = 3β’ False h_cardβ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:3 β€ 2h_cardβ:{0, 1, 2}.ncard = 3β’ False] at h_cardβ f:β€Ξ± βΆ β€Ξ²hf_iso:IsIso fhf_comm:β (x : β€), (β(hom βf) β β(hom β€Ξ±.toEnd)) x = (β(hom β€Ξ².toEnd) β β(hom βf)) xhf_comm':β (x : β€), (hom βf) (x + 2) = (hom βf) x + 3hf_mod_3_eq:β (x : β€), (hom βf) (x + 2) β‘ (hom βf) x [ZMOD 3]hf_even_congr:β (x : β€), (hom βf) (2 * x) β‘ (hom βf) 0 [ZMOD 3]hf_odd_congr:β (x : β€), (hom βf) (2 * x + 1) β‘ (hom βf) 1 [ZMOD 3]hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {(hom βf) 0 % 3, (hom βf) 1 % 3}hf_bij:Function.Bijective β(hom βf)hf_surj:Function.Surjective β(hom βf)hf_img_setβ:(Set.range fun x β¦ (hom βf) x % 3) = {0, 1, 2}h_cardβ:3 β€ 2h_cardβ:{0, 1, 2}.ncard = 3β’ False
linarith All goals completed! π
Each of the following graphs is isomorphic to exactly one of the others. Which?
Solution: Exercise 6
We label the arrows in each graph from top to bottom.
inductive A
| aβ | aβ | aβ
We label the dots in each graph from left to right.
inductive D
| dβ | dβ | dβ
Then the six graphs (a) to (f) are as follows:
def graph_a : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
}
def graph_b : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ,
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
}
def graph_c : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
}
def graph_d : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
}
def graph_e : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
}
def graph_f : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
}
Graph (a) is isomorphic to graph (d).
def fβ : graph_a βΆ graph_d := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toSrc =
graph_d.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt =
graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toSrc =
graph_d.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt =
graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
all_goals
ext x right x:graph_a.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_a.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_d.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
def finvβ : graph_d βΆ graph_a := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toSrc =
graph_a.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt =
graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toSrc =
graph_a.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt =
graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
all_goals
ext x right x:graph_d.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_d.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_a.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
example : graph_a β
graph_d := {
hom := fβ,
inv := finvβ,
hom_inv_id := by β’ finvβ β fβ = π graph_a
have hβ : (finvβ.val.1 β fβ.val.1 = π graph_a.carrierA) β§
(finvβ.val.2 β fβ.val.2 = π graph_a.carrierD) := by
constructor left β’ (βfinvβ).1 β (βfβ).1 = π graph_a.carrierAright β’ (βfinvβ).2 β (βfβ).2 = π graph_a.carrierD <;> left β’ (βfinvβ).1 β (βfβ).1 = π graph_a.carrierAright β’ (βfinvβ).2 β (βfβ).2 = π graph_a.carrierD (ext x right x:graph_a.carrierDβ’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun x = (ConcreteCategory.hom (π graph_a.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_a.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_a.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_a.carrierD)).toFun D.dβ <;> right.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_a.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_a.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_a.carrierD)).toFun D.dβ rfl All goals completed! π) hβ:(βfinvβ).1 β (βfβ).1 = π graph_a.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_a.carrierDβ’ finvβ β fβ = π graph_a
have hβ : (finvβ.val.1 β fβ.val.1, finvβ.val.2 β fβ.val.2) =
(π graph_a.carrierA, π graph_a.carrierD) := by
rw [hβ.1, hβ:(βfinvβ).1 β (βfβ).1 = π graph_a.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_a.carrierDβ’ (π graph_a.carrierA, (βfinvβ).2 β (βfβ).2) = (π graph_a.carrierA, π graph_a.carrierD) hβ.2 hβ:(βfinvβ).1 β (βfβ).1 = π graph_a.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_a.carrierDβ’ (π graph_a.carrierA, π graph_a.carrierD) = (π graph_a.carrierA, π graph_a.carrierD)] hβ:(βfinvβ).1 β (βfβ).1 = π graph_a.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_a.carrierDhβ:((βfinvβ).1 β (βfβ).1, (βfinvβ).2 β (βfβ).2) = (π graph_a.carrierA, π graph_a.carrierD)β’ finvβ β fβ = π graph_a
exact Subtype.ext hβ All goals completed! π,
inv_hom_id := by β’ fβ β finvβ = π graph_d
have hβ : (fβ.val.1 β finvβ.val.1 = π graph_d.carrierA) β§
(fβ.val.2 β finvβ.val.2 = π graph_d.carrierD) := by
constructor left β’ (βfβ).1 β (βfinvβ).1 = π graph_d.carrierAright β’ (βfβ).2 β (βfinvβ).2 = π graph_d.carrierD <;> left β’ (βfβ).1 β (βfinvβ).1 = π graph_d.carrierAright β’ (βfβ).2 β (βfinvβ).2 = π graph_d.carrierD (ext x right x:graph_d.carrierDβ’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun x = (ConcreteCategory.hom (π graph_d.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_d.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_d.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_d.carrierD)).toFun D.dβ <;> right.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_d.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_d.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_d.carrierD)).toFun D.dβ rfl All goals completed! π) hβ:(βfβ).1 β (βfinvβ).1 = π graph_d.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_d.carrierDβ’ fβ β finvβ = π graph_d
have hβ : (fβ.val.1 β finvβ.val.1, fβ.val.2 β finvβ.val.2) =
(π graph_d.carrierA, π graph_d.carrierD) := by
rw [hβ.1, hβ:(βfβ).1 β (βfinvβ).1 = π graph_d.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_d.carrierDβ’ (π graph_d.carrierA, (βfβ).2 β (βfinvβ).2) = (π graph_d.carrierA, π graph_d.carrierD) hβ.2 hβ:(βfβ).1 β (βfinvβ).1 = π graph_d.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_d.carrierDβ’ (π graph_d.carrierA, π graph_d.carrierD) = (π graph_d.carrierA, π graph_d.carrierD)] hβ:(βfβ).1 β (βfinvβ).1 = π graph_d.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_d.carrierDhβ:((βfβ).1 β (βfinvβ).1, (βfβ).2 β (βfinvβ).2) = (π graph_d.carrierA, π graph_d.carrierD)β’ fβ β finvβ = π graph_d
exact Subtype.ext hβ All goals completed! π
}
Graph (b) is isomorphic to graph (e).
def fβ : graph_b βΆ graph_e := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toSrc =
graph_e.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt =
graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toSrc =
graph_e.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt =
graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
all_goals
ext x right x:graph_b.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_b.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_e.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
def finvβ : graph_e βΆ graph_b := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toSrc =
graph_b.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt =
graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toSrc =
graph_b.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt =
graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
all_goals
ext x right x:graph_e.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_e.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_b.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
example : graph_b β
graph_e := {
hom := fβ,
inv := finvβ,
hom_inv_id := by β’ finvβ β fβ = π graph_b
have hβ : (finvβ.val.1 β fβ.val.1 = π graph_b.carrierA) β§
(finvβ.val.2 β fβ.val.2 = π graph_b.carrierD) := by
constructor left β’ (βfinvβ).1 β (βfβ).1 = π graph_b.carrierAright β’ (βfinvβ).2 β (βfβ).2 = π graph_b.carrierD <;> left β’ (βfinvβ).1 β (βfβ).1 = π graph_b.carrierAright β’ (βfinvβ).2 β (βfβ).2 = π graph_b.carrierD (ext x right x:graph_b.carrierDβ’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun x = (ConcreteCategory.hom (π graph_b.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_b.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_b.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_b.carrierD)).toFun D.dβ <;> right.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_b.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_b.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_b.carrierD)).toFun D.dβ rfl All goals completed! π) hβ:(βfinvβ).1 β (βfβ).1 = π graph_b.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_b.carrierDβ’ finvβ β fβ = π graph_b
have hβ : (finvβ.val.1 β fβ.val.1, finvβ.val.2 β fβ.val.2) =
(π graph_b.carrierA, π graph_b.carrierD) := by
rw [hβ.1, hβ:(βfinvβ).1 β (βfβ).1 = π graph_b.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_b.carrierDβ’ (π graph_b.carrierA, (βfinvβ).2 β (βfβ).2) = (π graph_b.carrierA, π graph_b.carrierD) hβ.2 hβ:(βfinvβ).1 β (βfβ).1 = π graph_b.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_b.carrierDβ’ (π graph_b.carrierA, π graph_b.carrierD) = (π graph_b.carrierA, π graph_b.carrierD)] hβ:(βfinvβ).1 β (βfβ).1 = π graph_b.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_b.carrierDhβ:((βfinvβ).1 β (βfβ).1, (βfinvβ).2 β (βfβ).2) = (π graph_b.carrierA, π graph_b.carrierD)β’ finvβ β fβ = π graph_b
exact Subtype.ext hβ All goals completed! π,
inv_hom_id := by β’ fβ β finvβ = π graph_e
have hβ : (fβ.val.1 β finvβ.val.1 = π graph_e.carrierA) β§
(fβ.val.2 β finvβ.val.2 = π graph_e.carrierD) := by
constructor left β’ (βfβ).1 β (βfinvβ).1 = π graph_e.carrierAright β’ (βfβ).2 β (βfinvβ).2 = π graph_e.carrierD <;> left β’ (βfβ).1 β (βfinvβ).1 = π graph_e.carrierAright β’ (βfβ).2 β (βfinvβ).2 = π graph_e.carrierD (ext x right x:graph_e.carrierDβ’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun x = (ConcreteCategory.hom (π graph_e.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_e.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_e.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_e.carrierD)).toFun D.dβ <;> right.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_e.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_e.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_e.carrierD)).toFun D.dβ rfl All goals completed! π) hβ:(βfβ).1 β (βfinvβ).1 = π graph_e.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_e.carrierDβ’ fβ β finvβ = π graph_e
have hβ : (fβ.val.1 β finvβ.val.1, fβ.val.2 β finvβ.val.2) =
(π graph_e.carrierA, π graph_e.carrierD) := by
rw [hβ.1, hβ:(βfβ).1 β (βfinvβ).1 = π graph_e.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_e.carrierDβ’ (π graph_e.carrierA, (βfβ).2 β (βfinvβ).2) = (π graph_e.carrierA, π graph_e.carrierD) hβ.2 hβ:(βfβ).1 β (βfinvβ).1 = π graph_e.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_e.carrierDβ’ (π graph_e.carrierA, π graph_e.carrierD) = (π graph_e.carrierA, π graph_e.carrierD)] hβ:(βfβ).1 β (βfinvβ).1 = π graph_e.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_e.carrierDhβ:((βfβ).1 β (βfinvβ).1, (βfβ).2 β (βfinvβ).2) = (π graph_e.carrierA, π graph_e.carrierD)β’ fβ β finvβ = π graph_e
exact Subtype.ext hβ All goals completed! π
}
Graph (c) is isomorphic to graph (f).
def fβ : graph_c βΆ graph_f := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toSrc =
graph_f.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt =
graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toSrc =
graph_f.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt =
graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
all_goals
ext x right x:graph_c.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_c.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_f.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
def finvβ : graph_f βΆ graph_c := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toSrc =
graph_c.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt =
graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toSrc =
graph_c.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt =
graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1
all_goals
ext x right x:graph_f.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).2 β
graph_f.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_c.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
example : graph_c β
graph_f := {
hom := fβ,
inv := finvβ,
hom_inv_id := by β’ finvβ β fβ = π graph_c
have hβ : (finvβ.val.1 β fβ.val.1 = π graph_c.carrierA) β§
(finvβ.val.2 β fβ.val.2 = π graph_c.carrierD) := by
constructor left β’ (βfinvβ).1 β (βfβ).1 = π graph_c.carrierAright β’ (βfinvβ).2 β (βfβ).2 = π graph_c.carrierD <;> left β’ (βfinvβ).1 β (βfβ).1 = π graph_c.carrierAright β’ (βfinvβ).2 β (βfβ).2 = π graph_c.carrierD (ext x right x:graph_c.carrierDβ’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun x = (ConcreteCategory.hom (π graph_c.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_c.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_c.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_c.carrierD)).toFun D.dβ <;> right.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_c.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_c.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinvβ).2 β (βfβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_c.carrierD)).toFun D.dβ rfl All goals completed! π) hβ:(βfinvβ).1 β (βfβ).1 = π graph_c.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_c.carrierDβ’ finvβ β fβ = π graph_c
have hβ : (finvβ.val.1 β fβ.val.1, finvβ.val.2 β fβ.val.2) =
(π graph_c.carrierA, π graph_c.carrierD) := by
rw [hβ.1, hβ:(βfinvβ).1 β (βfβ).1 = π graph_c.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_c.carrierDβ’ (π graph_c.carrierA, (βfinvβ).2 β (βfβ).2) = (π graph_c.carrierA, π graph_c.carrierD) hβ.2 hβ:(βfinvβ).1 β (βfβ).1 = π graph_c.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_c.carrierDβ’ (π graph_c.carrierA, π graph_c.carrierD) = (π graph_c.carrierA, π graph_c.carrierD)] hβ:(βfinvβ).1 β (βfβ).1 = π graph_c.carrierA β§ (βfinvβ).2 β (βfβ).2 = π graph_c.carrierDhβ:((βfinvβ).1 β (βfβ).1, (βfinvβ).2 β (βfβ).2) = (π graph_c.carrierA, π graph_c.carrierD)β’ finvβ β fβ = π graph_c
exact Subtype.ext hβ All goals completed! π,
inv_hom_id := by β’ fβ β finvβ = π graph_f
have hβ : (fβ.val.1 β finvβ.val.1 = π graph_f.carrierA) β§
(fβ.val.2 β finvβ.val.2 = π graph_f.carrierD) := by
constructor left β’ (βfβ).1 β (βfinvβ).1 = π graph_f.carrierAright β’ (βfβ).2 β (βfinvβ).2 = π graph_f.carrierD <;> left β’ (βfβ).1 β (βfinvβ).1 = π graph_f.carrierAright β’ (βfβ).2 β (βfinvβ).2 = π graph_f.carrierD (ext x right x:graph_f.carrierDβ’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun x = (ConcreteCategory.hom (π graph_f.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_f.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_f.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_f.carrierD)).toFun D.dβ <;> right.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_f.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_f.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfβ).2 β (βfinvβ).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_f.carrierD)).toFun D.dβ rfl All goals completed! π) hβ:(βfβ).1 β (βfinvβ).1 = π graph_f.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_f.carrierDβ’ fβ β finvβ = π graph_f
have hβ : (fβ.val.1 β finvβ.val.1, fβ.val.2 β finvβ.val.2) =
(π graph_f.carrierA, π graph_f.carrierD) := by
rw [hβ.1, hβ:(βfβ).1 β (βfinvβ).1 = π graph_f.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_f.carrierDβ’ (π graph_f.carrierA, (βfβ).2 β (βfinvβ).2) = (π graph_f.carrierA, π graph_f.carrierD) hβ.2 hβ:(βfβ).1 β (βfinvβ).1 = π graph_f.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_f.carrierDβ’ (π graph_f.carrierA, π graph_f.carrierD) = (π graph_f.carrierA, π graph_f.carrierD)] hβ:(βfβ).1 β (βfinvβ).1 = π graph_f.carrierA β§ (βfβ).2 β (βfinvβ).2 = π graph_f.carrierDhβ:((βfβ).1 β (βfinvβ).1, (βfβ).2 β (βfinvβ).2) = (π graph_f.carrierA, π graph_f.carrierD)β’ fβ β finvβ = π graph_f
exact Subtype.ext hβ All goals completed! π
}
If these two graphs are isomorphic, find an isomorphism between them; if they are not isomorphic, explain how you know they are not.
Solution: Exercise 7
We label the arrows in each graph starting with the arrow at the bottom left and moving clockwise through the four outer arrows (a_1 to a_4) and then vertically upwards through the two inner arrows (a_5 and a_6).
inductive A
| aβ | aβ | aβ | aβ | aβ
| aβ
We label the dots in each graph starting with the bottom dot and moving clockwise through the four outer dots (d_1 to d_4) and then finishing with the centre dot (d_5).
inductive D
| dβ | dβ | dβ | dβ | dβ
Then the two graphs are as follows:
def graph_L : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ
=> D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ
=> D.dβ
| A.aβ => D.dβ
}
def graph_R : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ
=> D.dβ
| A.aβ => D.dβ
toTgt := βΎfun
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ => D.dβ
| A.aβ
=> D.dβ
| A.aβ => D.dβ
}
The two graphs are isomorphic, with an isomorphism between them given by f below.
def f : graph_L βΆ graph_R := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ
,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toSrc =
graph_R.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt =
graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toSrc =
graph_R.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt =
graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1
all_goals
ext x right x:graph_L.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ
β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ
=
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ
right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ
β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ
=
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ
right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_L.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_R.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
def finv : graph_R βΆ graph_L := {
val := (
βΎfun -- maps arrows
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun -- maps dots
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ
)
property := by β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toSrc =
graph_L.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1 β§
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt =
graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1
constructor left β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toSrc =
graph_L.toSrc β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1right β’ (βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt =
graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1
all_goals
ext x right x:graph_R.carrierAβ’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
x =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
x; cases x right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ
β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ
=
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ
right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ <;> right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβright.aβ
β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ
=
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ
right.aβ β’ (ConcreteCategory.hom
((βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).2 β
graph_R.toTgt)).toFun
A.aβ =
(ConcreteCategory.hom
(graph_L.toTgt β
(βΎfun x β¦
match x with
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ => A.aβ
| A.aβ
=> A.aβ
| A.aβ => A.aβ,
βΎfun x β¦
match x with
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ => D.dβ
| D.dβ
=> D.dβ).1)).toFun
A.aβ rfl All goals completed! π
}
example : graph_L β
graph_R := {
hom := f,
inv := finv,
hom_inv_id := by β’ finv β f = π graph_L
have hβ : (finv.val.1 β f.val.1 = π graph_L.carrierA) β§
(finv.val.2 β f.val.2 = π graph_L.carrierD) := by
constructor left β’ (βfinv).1 β (βf).1 = π graph_L.carrierAright β’ (βfinv).2 β (βf).2 = π graph_L.carrierD <;> left β’ (βfinv).1 β (βf).1 = π graph_L.carrierAright β’ (βfinv).2 β (βf).2 = π graph_L.carrierD (ext x right x:graph_L.carrierDβ’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun x = (ConcreteCategory.hom (π graph_L.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ
β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ
= (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβ
<;> right.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβright.dβ
β’ (ConcreteCategory.hom ((βfinv).2 β (βf).2)).toFun D.dβ
= (ConcreteCategory.hom (π graph_L.carrierD)).toFun D.dβ
rfl All goals completed! π) hβ:(βfinv).1 β (βf).1 = π graph_L.carrierA β§ (βfinv).2 β (βf).2 = π graph_L.carrierDβ’ finv β f = π graph_L
have hβ : (finv.val.1 β f.val.1, finv.val.2 β f.val.2) =
(π graph_L.carrierA, π graph_L.carrierD) := by
rw [hβ.1, hβ:(βfinv).1 β (βf).1 = π graph_L.carrierA β§ (βfinv).2 β (βf).2 = π graph_L.carrierDβ’ (π graph_L.carrierA, (βfinv).2 β (βf).2) = (π graph_L.carrierA, π graph_L.carrierD) hβ.2 hβ:(βfinv).1 β (βf).1 = π graph_L.carrierA β§ (βfinv).2 β (βf).2 = π graph_L.carrierDβ’ (π graph_L.carrierA, π graph_L.carrierD) = (π graph_L.carrierA, π graph_L.carrierD)] hβ:(βfinv).1 β (βf).1 = π graph_L.carrierA β§ (βfinv).2 β (βf).2 = π graph_L.carrierDhβ:((βfinv).1 β (βf).1, (βfinv).2 β (βf).2) = (π graph_L.carrierA, π graph_L.carrierD)β’ finv β f = π graph_L
exact Subtype.ext hβ All goals completed! π,
inv_hom_id := by β’ f β finv = π graph_R
have hβ : (f.val.1 β finv.val.1 = π graph_R.carrierA) β§
(f.val.2 β finv.val.2 = π graph_R.carrierD) := by
constructor left β’ (βf).1 β (βfinv).1 = π graph_R.carrierAright β’ (βf).2 β (βfinv).2 = π graph_R.carrierD <;> left β’ (βf).1 β (βfinv).1 = π graph_R.carrierAright β’ (βf).2 β (βfinv).2 = π graph_R.carrierD (ext x right x:graph_R.carrierDβ’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun x = (ConcreteCategory.hom (π graph_R.carrierD)).toFun x; cases x right.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ
β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ
= (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβ
<;> right.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ = (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβright.dβ
β’ (ConcreteCategory.hom ((βf).2 β (βfinv).2)).toFun D.dβ
= (ConcreteCategory.hom (π graph_R.carrierD)).toFun D.dβ
rfl All goals completed! π) hβ:(βf).1 β (βfinv).1 = π graph_R.carrierA β§ (βf).2 β (βfinv).2 = π graph_R.carrierDβ’ f β finv = π graph_R
have hβ : (f.val.1 β finv.val.1, f.val.2 β finv.val.2) =
(π graph_R.carrierA, π graph_R.carrierD) := by
rw [hβ.1, hβ:(βf).1 β (βfinv).1 = π graph_R.carrierA β§ (βf).2 β (βfinv).2 = π graph_R.carrierDβ’ (π graph_R.carrierA, (βf).2 β (βfinv).2) = (π graph_R.carrierA, π graph_R.carrierD) hβ.2 hβ:(βf).1 β (βfinv).1 = π graph_R.carrierA β§ (βf).2 β (βfinv).2 = π graph_R.carrierDβ’ (π graph_R.carrierA, π graph_R.carrierD) = (π graph_R.carrierA, π graph_R.carrierD)] hβ:(βf).1 β (βfinv).1 = π graph_R.carrierA β§ (βf).2 β (βfinv).2 = π graph_R.carrierDhβ:((βf).1 β (βfinv).1, (βf).2 β (βfinv).2) = (π graph_R.carrierA, π graph_R.carrierD)β’ f β finv = π graph_R
exact Subtype.ext hβ All goals completed! π
}
(Impossible journeys) J is the graph
inductive A
| aβ | aβ | aβ
abbrev D := Fin 2
def J : IrreflexiveGraph := {
carrierA := A
carrierD := D
toSrc := βΎfun
| A.aβ => 0
| A.aβ => 1
| A.aβ => 1
toTgt := βΎfun
| A.aβ => 0
| A.aβ => 0
| A.aβ => 1
}
G is any graph, and b and e are dots of G.
variable (G : IrreflexiveGraph) (b e : G.carrierD)
(a) Suppose that {G \xrightarrow{f} J} is a map of graphs with {fb = 0} and {fe = 1}. Show that there is no path in G that begins at b and ends at e.
(b) Conversely, suppose that there is no path in G that begins at b and ends at e. Show that there is a map {G \xrightarrow{f} J} with {fb = 0} and {fe = 1}.
Solution: Exercise 8
TODO Exercise 11.8