50 lines
1.3 KiB
Text
50 lines
1.3 KiB
Text
x : Nat
|
||
h : f (f x) = x
|
||
⊢ (let y := x * x;
|
||
if True then 1 else y + 1) =
|
||
1
|
||
theorem ex1 : ∀ (x : Nat),
|
||
f (f x) = x →
|
||
(let y := x * x;
|
||
if f (f x) = x then 1 else y + 1) =
|
||
1 :=
|
||
fun x h =>
|
||
Eq.mpr
|
||
(id
|
||
(congrArg (fun x => x = 1)
|
||
(let_congr (Eq.refl (x * x)) fun y =>
|
||
ite_congr (Eq.trans (congrArg (fun x_1 => x_1 = x) h) (eq_self x)) (fun a => Eq.refl 1) fun a =>
|
||
Eq.refl (y + 1))))
|
||
(of_eq_true (Eq.trans (congrArg (fun x => x = 1) (ite_cond_eq_true 1 (x * x + 1) (Eq.refl True))) (eq_self 1)))
|
||
x z : Nat
|
||
h : f (f x) = x
|
||
h' : z = x
|
||
⊢ (let y := x;
|
||
y) =
|
||
z
|
||
theorem ex2 : ∀ (x z : Nat),
|
||
f (f x) = x →
|
||
z = x →
|
||
(let y := f (f x);
|
||
y) =
|
||
z :=
|
||
fun x z h h' =>
|
||
Eq.mpr (id (congrArg (fun x => x = z) (let_val_congr (fun y => y) h)))
|
||
(of_eq_true (Eq.trans (congrArg (Eq x) h') (eq_self x)))
|
||
x z : Nat
|
||
⊢ (let α := Nat;
|
||
fun x => 0 + x) =
|
||
id
|
||
p : Prop
|
||
h : p
|
||
⊢ (let n := 10;
|
||
fun x => True) =
|
||
fun z => p
|
||
theorem ex4 : ∀ (p : Prop),
|
||
p →
|
||
(let n := 10;
|
||
fun x => x = x) =
|
||
fun z => p :=
|
||
fun p h =>
|
||
Eq.mpr (id (congrArg (fun x => x = fun z => p) (let_body_congr 10 fun n => funext fun x => eq_self x)))
|
||
(of_eq_true (Eq.trans (congrArg (Eq fun x => True) (funext fun z => eq_true h)) (eq_self fun x => True)))
|