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/LinearAlgebra/L02_VectorNotation.lean

60 lines
1.4 KiB
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 Mathlib.Data.Real.Basic -- definiert ``
import Mathlib.Algebra.Module.Pi -- definiert `Module (fin 2 → )`
import Mathlib.Data.Fin.VecNotation
import Mathlib.Tactic.FinCases
set_option tactic.hygienic false
Game "Adam"
World "Module"
Level 2
Title "Konkrete Vektorräume"
Introduction
"
Den $\\mathbb{Q}$-Vektorraum $\\mathbb{Q}^3$ definiert man am besten mit
der lokalen Notation
```
local notation `ℚ³` := Fin 3 →
```
Dabei ist `Fin 3` die Indexmenge $\\{0, 1, 2\\}$.
Die schreibweise für einen Vektor ist `![ _, _ ]`. Zu beachten ist,
dass man bei Zahlen explizit einen Typ angeben muss, sonst denkt sich
Lean, man arbeite über ``.
Um direkt Vektoroperationen über `` auszurechnen, kann man oft
`#eval` benützen:
```
#eval ![ (2 : ), 5 ] + ![ 1/2, -7 ]
```
zeigt `![5/2, -2]` an.
Um eine Gleichheit in einem Beweis zu verwenden, muss man andere Taktiken
benützen.
Am hilfreichsten ist die kombination `funext i, fin_cases i`, die
Dann eine Vektorgleichung komponentenweise aufteilt.
Für jede Komponente kann man dann mit `simp` und `ring` weiterkommen.
"
local notation "ℚ³" => Fin 3 →
local notation "^(" n ")" => (Fin n) →
Statement
""
: ![ (2 : ), 5 ] + ![ 1/2, -7 ] = ![5/2, -2] := by
funext i
fin_cases i <;>
simp <;>
ring
NewTactic fin_cases funext