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/AdvMultiplication/Level_3.lean

42 lines
748 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.Multiplication
import Std.Tactic.RCases
import Mathlib.Tactic.LeftRight
Game "NNG"
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.
"
axiom eq_zero_or_eq_zero_of_mul_eq_zero (a b : ) (h : a * b = 0) : a = 0 b = 0
axiom zero_mul (a : ) : 0 * a = 0
Statement
"$ab = 0$, if and only if at least one of $a$ or $b$ is equal to zero.
"
(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 [zero_mul]
rfl
rw [hab]
rw [mul_zero]
rfl
Conclusion
"
"