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/Numbers/L01_PNat.lean

83 lines
1.9 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 TestGame.Metadata
import Mathlib
Game "TestGame"
World "Numbers"
Level 1
Title ""
Introduction
"
-- Level name : Positive natürliche Zahlen
import data.pnat.basic
/-
In diesem Level lernst du neben `` weitere Arten von
Zahlen kennen: `+`,``, ``, ``, ``.
Manchmal sieht man in der Literatur Diskussionen, ob die natürlichen Zahlen jetzt bei `0` oder `1`
anfangen, wobei zumindest in der formalisierten Mathematik (z.B. ZFC-Mengenlehre)
eigentlich immer ` = {0, 1, 2, 3, …}` definiert wird.
So ist auch in Lean `1` als `0.succ` und `2 = 1.succ = 0.succ.succ` definiert und
Lean hat eine separate Notation `+` (oder `pnat`) für alle *positiven* natürlichen Zahlen.
Dies ist als Sub-Typ von `` definiert:
`def pnat := {n : // 0 < n}`
ein Element `(p : +)` besteht also aus einer natürlichen Zahl `(p.val : )`
(oder auch `p.1`, wobei `p.val` bevorzugt ist) sowie einem Beweis, dass diese positiv ist,
`p.property` (oder `p.2`).
Solche Strukturen mit mehr als einem Feld kann man in Lean mit dem anonymen Konstruktor `⟨_, _⟩`
erstellen, wie du schon einmal beim `∃` gesehen hast: `(⟨n, h⟩ : +)`
"
Statement
""
(a : +) : (a : ) ≠ 0 := by
apply ne_of_gt
rcases a with ⟨a, ha⟩
assumption
-- -/
-- /- Hint : a.property
-- `have ha := a.property` speichert die `+`-Eigenschaft dass `0 < a.val`
-- gilt als neue Variable.
-- -/
-- /- Hint : ne_of_lt/ne_of_gt
-- `a < b → a ≠ b`
-- oder
-- `a < b → b ≠ a`
-- alternativ kannst du auch mit `symmetry` ein symmetrischen Goal drehen.
-- -/
-- /- Lemma : no-side-bar
-- Beweise.
-- -/
-- example (a : +) : (a : ) ≠ 0 :=
-- begin
-- have ha := a.property,
-- symmetry,
-- apply ne_of_lt,
-- exact ha,
-- end
-- /- Axiom : ne_of_lt
-- `a < b → a ≠ b`.
-- -/
-- /- Axiom : ne_of_gt
-- `a < b → b ≠ a`.
-- -/
-- /- Tactic : symmetry
-- Dreht ein symmetrisches Goal wie `A = B`, `A ≠ B`, `A ↔ B`, ...
-- -/