Files
NNG/Game/Levels/OldAdvMultiplication/Level_3.lean
2023-10-14 19:57:20 +01:00

37 lines
568 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.AdvMultiplication.Level_2
World "AdvMultiplication"
Level 3
Title "mul_eq_zero_iff"
open MyNat
Introduction
"
Now you have `eq_zero_or_eq_zero_of_mul_eq_zero` this is pretty straightforward.
"
/-- $ab = 0$, if and only if at least one of $a$ or $b$ is equal to zero.
-/
Statement
{a b : } : a * b = 0 a = 0 b = 0 := by
constructor
intro h
exact eq_zero_or_eq_zero_of_mul_eq_zero a b h
intro hab
rcases hab with hab | hab
rw [hab]
rw [MyNat.zero_mul]
rfl
rw [hab]
rw [MyNat.mul_zero]
rfl
Conclusion
"
"