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/Prime/L03_Prime.lean

42 lines
911 B
Plaintext

import Adam.Metadata
import Mathlib.Data.Nat.Prime
import Std.Tactic.RCases
import Mathlib.Tactic.LeftRight
import Mathlib.Tactic.Contrapose
import Mathlib.Tactic.Use
import Mathlib.Tactic.Ring
import Adam.ToBePorted
Game "Adam"
World "Prime"
Level 3
Title "Primzahlen"
Introduction
"
Der Lehrer erklärt sein Problem.
**Lehrer**: Und dann fragte der Schüler, wie man denn folgendes herleitet.
Und dabei ist das weit über seiner Altersstufe!
"
Statement
(p : ) (h₂ : 2 ≤ p): Nat.Prime p ↔ ∀ (a b : ), p a * b → p a p b := by
Hint "**Du**: Naja, mal schauen wie weit man mit `intro` und `constructor` kommt…"
constructor
intro h a b
Hint "**Robo**: Stop! Hier helfe ich dir etwas"
apply (Nat.Prime.dvd_mul h).mp
intro h
rw [Nat.prime_iff]
unfold Prime
rw [Nat.isUnit_iff, ←and_assoc]
constructor
constructor
linarith
linarith
assumption