Files
NNG/Game/Levels/AdvAddition/Level_7.lean
Jon Eugster 2604c89284 big refactor
2023-05-15 15:12:35 +02:00

36 lines
783 B
Lean4
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Game.Levels.AdvAddition.Level_6
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 `constructor`
to split an `↔` goal into the `→` goal and the `←` goal.
"
Statement MyNat.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
Branch
induction t
· simp
· simp
exact n_ih
constructor
· Hint "Pro tip: `exact add_right_cancel _ _ _` means \"let Lean figure out the missing inputs\"."
exact add_right_cancel _ _ _
· intro H
rw [H]
rfl
LemmaTab "Add"
DisabledTactic simp