|
| 1 | +import Game.Levels.PowGroup.L07_PowSub |
| 2 | + |
| 3 | +World "Group Power" |
| 4 | +Level 8 |
| 5 | + |
| 6 | +Title "Multiplying Integer Exponents" |
| 7 | + |
| 8 | +namespace MyAlgebra |
| 9 | + |
| 10 | +Introduction "Finally, we prove the multiplication law for integer exponents: |
| 11 | +`g ^ (x * y) = (g ^ x) ^ y`." |
| 12 | + |
| 13 | +/-- |
| 14 | +For any group element `g` and integers `x`, `y`, |
| 15 | +we have `g ^ (x * y) = (g ^ x) ^ y`. |
| 16 | +-/ |
| 17 | +TheoremDoc MyAlgebra.gpow_mul as "gpow_mul" in "Group Power" |
| 18 | +Statement gpow_mul {G} [Group G] (g : G) (x y : ℤ) : |
| 19 | + g ^ (x * y) = (g ^ x) ^ y := by |
| 20 | + Hint "Use `Int.induction_on` on `y` as in earlier levels." |
| 21 | + induction y using Int.induction_on with |
| 22 | + | hz => |
| 23 | + Hint "Start with `y = 0`." |
| 24 | + -- x * 0 = 0, and (g^x)^0 = 1 |
| 25 | + simp |
| 26 | + | hp n ih => |
| 27 | + Hint "Use the identity `x * (n+1) = x * n + x` and the addition lemma for powers." |
| 28 | + -- y = n+1 |
| 29 | + -- g^(x*(n+1)) = g^(x*n + x) = g^(x*n) * g^x |
| 30 | + -- (g^x)^(n+1) = (g^x)^n * g^x |
| 31 | + rw [mul_add, mul_one, ←gpow_add, gpow_succ, ih] |
| 32 | + | hn n ih => |
| 33 | + Hint "For the negative step, use `Int.mul_sub` and your subtraction lemma `gpow_sub`." |
| 34 | + -- y = -[n+1] |
| 35 | + -- x * (-(n+1)) = x * (-n) - x |
| 36 | + -- use `gpow_sub` and `gpow_pred` to step down |
| 37 | + rw [Int.mul_sub, mul_one, ←gpow_sub, ←gpow_pred, ih] |
| 38 | + |
| 39 | +Conclusion "Excellent! You’ve proved the full multiplication law for integer exponents." |
0 commit comments