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/LeftOvers/L08_Contrapose.lean

38 lines
993 B
Plaintext

import TestGame.Metadata
import Std.Tactic.RCases
import Mathlib.Tactic.Contrapose
import Mathlib.Tactic.Use
import Mathlib.Tactic.Ring
import TestGame.ToBePorted
Game "TestGame"
World "Implication"
Level 102
Title "Kontraposition"
Introduction
2 years ago
"**Lean Trick:** Wenn das Goal nicht bereits eine Implikation ist, sondern man eine Annahme `h` hat, die
Man gerne für die Kontraposition benützen würde, kann man mit `revert h` diese als
Implikationsannahme ins Goal schreiben.
"
Statement
"Ist n² ungerade, so ist auch n ungerade. Beweise durch Kontraposition."
2 years ago
(n : ) (h : odd (n ^ 2)) : odd n := by
revert h
contrapose
rw [not_odd]
rw [not_odd]
apply even_square
2 years ago
Hint (n : ) (h : odd (n ^ 2)) : odd n =>
"Benutze `revert h` um das Goal in eine Implikation umzuschreiben."
Message (n : ) : odd (n ^ 2) → odd n =>
"Jetzt ist es genau das gleiche wie bei der letzten Aufgabe."
Tactics contrapose rw apply revert
Lemmas even odd not_even not_odd even_square