alternate proof for add_right_eq_self

This commit is contained in:
Yannick Seurin
2024-06-12 14:40:24 +02:00
committed by GitHub
parent 401d973028
commit 2ba1b7084b

View File

@@ -48,19 +48,17 @@ rw [add_comm]
exact add_left_eq_self y x exact add_left_eq_self y x
``` ```
Alternatively you can just prove it by induction on `x` Alternatively you can just prove it by induction on `x`:
(the dots in the proof just indicate the two goals and
can be omitted):
``` ```
induction x with d hd induction x with d hd
· intro h intro h
rw [zero_add] at h rw [zero_add] at h
assumption exact h
· intro h intro h
rw [succ_add] at h rw [succ_add] at h
apply succ_inj at h apply succ_inj at h
apply hd at h apply hd at h
assumption exact h
``` ```
" "