Files
NNG/Game/Levels/Implication/L02exact2.lean
2023-10-11 17:53:51 +01:00

26 lines
614 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.Implication.L01exact
World "Implication"
Level 2
Title "`exact` practice."
namespace MyNat
Introduction "If the goal is not *exactly* a hypothesis, we can sometimes
use rewrites to fix things up."
/-- Assuming $0+x=(0+y)+2$, we have $x=y+2$. -/
Statement (x : ) (h : 0 + x = 0 + y + 2) : x = y + 2 := by
Hint "Rewrite `zero_add` at `h` twice, to change `h` into the goal."
repeat rw [zero_add] at h
Hint "Now you could finish with `rw [h]` then `rfl`, but `exact h`
does it in one line."
exact h
Conclusion "Here's a two-line proof:
```
repeat rw [zero_add] at h
exact h
```
"