You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lean4game/server/nng/NNG/Levels/AdvAddition/Level_7.lean

36 lines
722 B
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import NNG.Metadata
import NNG.MyNat.AdvAddition
Game "NNG"
World "AdvAddition"
Level 7
Title "add_right_cancel_iff"
open MyNat
Introduction
"
It's sometimes convenient to have the \"if and only if\" version
of theorems like `add_right_cancel`. Remember that you can use `split`
to split an `↔` goal into the `→` goal and the `←` goal.
## Pro tip:
`exact add_right_cancel _ _ _` means \"let Lean figure out the missing inputs\"
"
Statement --add_right_cancel_iff
"For all naturals $a$, $b$ and $t$,
$$ a + t = b + t\\iff a=b. $$
"
(t a b : ) : a + t = b + t ↔ a = b := by
constructor
exact add_right_cancel _ _ _ -- done that way already,
intro H -- H : a = b,
rw [H]
rfl
Conclusion
"
"