o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Objects: abn: ℕ Goal: (a * b) ^ n = a ^ n * b ^ n solve this. lean4
- User
Objects: abn: ℕ Goal: (a * b) ^ n = a ^ n * b ^ n
solve this. lean4
- Assistant
To solve the equation ((a * b) ^ n = a ^ n * b ^ n) for natural numbers (a), (b), and (n) in Lean 4, we can prove it by induction on (n). Here's the Lean 4 proof:
theorem mul_pow (a b n : ℕ) : (a * b) ^ n = a ^ n * b ^ n := by induction n with | zero => -- Base case: n = 0 rw [Nat.pow_zero, Nat.pow_zero, Nat.pow_zero] rfl | succ n ih => -- Induction step: assume the statement holds for n -- Need to show it holds for n + 1 rw [Nat.pow_succ (a * b) n] rw [ih] -- Simplify the expression calc (a * b) * (a ^ n * b ^ n) = (a * a ^ n) * (b * b ^ n) := by rw [←mul_assoc, mul_comm b (a ^ n), mul_assoc a (a ^ n) b] -- Simplify a * a ^ n to a ^ (n + 1) ... = a ^ (n + 1) * b ^ (n + 1) := by rw [Nat.mul_pow a n, Nat.mul_pow b n]