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/Multiplication/Level_6.lean

53 lines
1.2 KiB
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.Levels.Multiplication.Level_5
Game "NNG"
World "Multiplication"
Level 6
Title "succ_mul"
open MyNat
Introduction
"
We now begin our journey to `mul_comm`, the proof that `a * b = b * a`.
We'll get there in level 8. Until we're there, it is frustrating
but true that we cannot assume commutativity. We have `mul_succ`
but we're going to need `succ_mul` (guess what it says -- maybe you
are getting the hang of Lean's naming conventions).
Remember also that we have tools like
* `add_right_comm a b c : a + b + c = a + c + b`
These things are the tools we need to slowly build up the results
which we will need to do mathematics \"normally\".
We also now have access to Lean's `simp` tactic,
which will solve any goal which just needs a bunch
of rewrites of `add_assoc` and `add_comm`. Use if
you're getting lazy!
"
Statement MyNat.succ_mul
"For all natural numbers $a$ and $b$, we have
$\\operatorname{succ}(a) \\cdot b = ab + b$."
(a b : ) : succ a * b = a * b + b := by
induction b with d hd
· rw [mul_zero]
rw [mul_zero]
rw [add_zero]
rfl
· rw [mul_succ]
rw [mul_succ]
rw [hd]
rw [add_succ]
rw [add_succ]
rw [add_right_comm]
rfl
LemmaTab "Mul"
Conclusion
"
"