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/Sum/L04_SumOdd.lean

34 lines
722 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 TestGame.Metadata
import TestGame.Options.BigOperators
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Tactic.Ring
Game "TestGame"
World "Sum"
Level 4
Title "Summe aller ungeraden Zahlen"
Introduction
"
**Du**: Haben eigentlich alle Türme hier so kryptische Beschreibungen am Eingang?
Du gehst zu einem etwas kleineren Nachbarsturm.
"
set_option tactic.hygienic false
open BigOperators
Statement odd_arithmetic_sum
"$\\sum_{i = 0}^n (2n + 1) = n ^ 2$."
(n : ) : (∑ i : Fin n, (2 * (i : ) + 1)) = n ^ 2 := by
Hint "**Robo**: Das funktioniert genau gleich wie zuvor, viel Glück."
induction n
simp
rw [Fin.sum_univ_castSucc]
simp
rw [n_ih]
rw [Nat.succ_eq_add_one]
ring