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/testgame/TestGame/Levels/Induction/L05_Sum.lean

48 lines
890 B
Plaintext

import TestGame.Metadata
import Mathlib.Tactic.Ring
import Mathlib
import TestGame.ToBePorted
Game "TestGame"
World "Induction"
2 years ago
Level 5
Title "Induktion"
Introduction
"
"
2 years ago
open BigOperators
2 years ago
lemma arithmetic_sum (n : ) : 2 * (∑ i : Fin (n + 1), ↑i) = n * (n + 1) := by
induction' n with n hn
simp
rw [Fin.sum_univ_castSucc]
rw [mul_add]
simp
rw [mul_add, hn]
simp_rw [Nat.succ_eq_one_add]
ring
Statement
2 years ago
"Zeige $\\sum_{i = 0}^n i^3 = (\\sum_{i = 0}^n i)^2$."
(n : ) : (∑ i : Fin (n + 1), (i : )^3) = (∑ i : Fin (n + 1), (i : ))^2 := by
2 years ago
induction' n with n hn
simp
2 years ago
conv_rhs =>
rw [Fin.sum_univ_castSucc]
simp
rw [add_pow_two]
rw [arithmetic_sum]
rw [mul_assoc, add_assoc, ←pow_two, ←Nat.succ_mul n, Nat.succ_eq_add_one, ←pow_succ]
conv_lhs =>
rw [Fin.sum_univ_castSucc]
simp
rw [hn]
NewTactics ring