7a3aab60c6
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
31 lines
912 B
Text
31 lines
912 B
Text
Set: pp::colors
|
|
Set: pp::unicode
|
|
Imported 'Int'
|
|
Assumed: A
|
|
Assumed: B
|
|
Assumed: f
|
|
Defined: g
|
|
Assumed: h
|
|
Assumed: hinv
|
|
Assumed: Inv
|
|
Assumed: H1
|
|
Proved: f_eq_g
|
|
Proved: Inj
|
|
definition g (A : Type) (f : A → A → A) (x y : A) : A := f y x
|
|
theorem f_eq_g (A : Type) (f : A → A → A) (H1 : ∀ x y : A, f x y = f y x) : f = g A f :=
|
|
funext (λ x : A,
|
|
funext (λ y : A,
|
|
let L1 : f x y = f y x := H1 x y, L2 : f y x = g A f x y := refl (g A f x y) in trans L1 L2))
|
|
theorem Inj (A B : Type)
|
|
(h : A → B)
|
|
(hinv : B → A)
|
|
(Inv : ∀ x : A, hinv (h x) = x)
|
|
(x y : A)
|
|
(H : h x = h y) : x = y :=
|
|
let L1 : hinv (h x) = hinv (h y) := congr2 hinv H,
|
|
L2 : hinv (h x) = x := Inv x,
|
|
L3 : hinv (h y) = y := Inv y,
|
|
L4 : x = hinv (h x) := symm L2,
|
|
L5 : x = hinv (h y) := trans L4 L1
|
|
in trans L5 L3
|
|
10
|