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

31 lines
518 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 Mathlib.Tactic.Ring
import Mathlib
Game "TestGame"
World "Induction"
Level 4
Title "Bernoulli Ungleichung"
Introduction
"
Hier nochmals eine Übung zur Induktion.
"
open BigOperators
Statement
"Zeige folgende Gleichung zur Summe aller ungeraden Zahlen:
$\\sum_{i = 0}^n (2n + 1) = n ^ 2$."
(n : ) : (∑ i : Fin n, (2 * (i : ) + 1)) = n ^ 2 := by
induction' n with n hn
simp
rw [Fin.sum_univ_castSucc]
simp
rw [hn, Nat.succ_eq_add_one]
ring
NewTactics ring