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

40 lines
831 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 Adam.Metadata
import Adam.ToBePorted
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Tactic.Ring
Game "Adam"
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 Fin
open BigOperators
Statement
"$\\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
Hint (hidden := true) "Den Induktionschritt mit Summen willst du
eigentlich immer mit `rw [sum_univ_castSucc]` beginnen."
rw [sum_univ_castSucc]
simp
rw [n_ih]
--rw [Nat.succ_eq_add_one]
ring
LemmaTab "Sum"