Skip to content

Commit c208a3d

Browse files
committed
More levels
1 parent 4283469 commit c208a3d

File tree

9 files changed

+159
-14
lines changed

9 files changed

+159
-14
lines changed

.i18n/en/Game.pot

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr "Project-Id-Version: Game v4.7.0\n"
33
"Report-Msgid-Bugs-To: \n"
4-
"POT-Creation-Date: Wed Jun 18 12:03:04 2025\n"
4+
"POT-Creation-Date: Wed Jun 18 21:45:45 2025\n"
55
"Last-Translator: \n"
66
"Language-Team: none\n"
77
"Language: en\n"
@@ -131,7 +131,7 @@ msgid "Every element of a ring has an additive inverse."
131131
msgstr ""
132132

133133
#: Game.Levels.AxiomWorld.L06_Inverses
134-
msgid "exact provides a term that completes the goal"
134+
msgid "close a goal by matching it against the conclusion of a given expression"
135135
msgstr ""
136136

137137
#: Game.Levels.AxiomWorld.L06_Inverses
@@ -150,6 +150,54 @@ msgstr ""
150150
msgid "We introduce the ring axioms."
151151
msgstr ""
152152

153+
#: Game.Levels.RingWorld.L01
154+
msgid "Implications"
155+
msgstr ""
156+
157+
#: Game.Levels.RingWorld.L01
158+
msgid "We learn how to use the intro tactic."
159+
msgstr ""
160+
161+
#: Game.Levels.RingWorld.L01
162+
msgid ""
163+
msgstr ""
164+
165+
#: Game.Levels.RingWorld.L01
166+
msgid "We can use intro to prove conditional statements."
167+
msgstr ""
168+
169+
#: Game.Levels.RingWorld.L02
170+
msgid "Substitution"
171+
msgstr ""
172+
173+
#: Game.Levels.RingWorld.L02
174+
msgid "One of our rules of logic is substitution."
175+
msgstr ""
176+
177+
#: Game.Levels.RingWorld.L02
178+
msgid ""
179+
msgstr ""
180+
181+
#: Game.Levels.RingWorld.L03
182+
msgid "add_right_cancel"
183+
msgstr ""
184+
185+
#: Game.Levels.RingWorld.L03
186+
msgid "Using the axioms, we prove that cancellation is possible."
187+
msgstr ""
188+
189+
#: Game.Levels.RingWorld.L03
190+
msgid "You have just proved `add_right_cancel`"
191+
msgstr ""
192+
193+
#: Game.Levels.RingWorld
194+
msgid "Ring World"
195+
msgstr ""
196+
197+
#: Game.Levels.RingWorld
198+
msgid "We use the ring axioms to prove various facts about rings."
199+
msgstr ""
200+
153201
#: Game
154202
msgid "Ross Game"
155203
msgstr ""

Game.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Game.Levels.AxiomWorld
2+
import Game.Levels.RingWorld
23

34
-- Here's what we'll put on the title screen
45
Title "Ross Game"

Game/Levels/AxiomWorld/L06_Inverses.lean

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,15 @@ variable [CommRing R]
1010

1111
Introduction "Every element of a ring has an additive inverse."
1212

13-
theorem exist_add_inv (a : R) : (∃ (b : R), a + b = 0) := by
14-
use -a
15-
exact add_right_neg a
16-
17-
/-- exact provides a term that completes the goal -/
18-
TacticDoc exact
19-
20-
NewTactic exact
13+
/-- close a goal by matching it against the conclusion of a given expression -/
14+
TacticDoc apply
15+
NewTactic apply
2116

2217
/-- Every element has an additive inverse -/
2318
TheoremDoc exist_add_inv as "exist_add_inv" in "Ring"
24-
2519
NewTheorem exist_add_inv
2620

2721
Statement (a : R) : ∃ b, (a + a) + b = 0 := by
28-
exact exist_add_inv (a+a)
22+
apply exist_add_inv
2923

3024
Conclusion "We will have to learn how to combine more axioms to prove more interesting statements."

Game/Levels/RingWorld.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Game.Levels.RingWorld.L01
2+
import Game.Levels.RingWorld.L02
3+
import Game.Levels.RingWorld.L03
4+
import Game.Levels.RingWorld.L04
5+
6+
World "RingWorld"
7+
Title "Ring World"
8+
9+
Introduction "
10+
We use the ring axioms to prove various facts about rings.
11+
"

Game/Levels/RingWorld/L01.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Game.Metadata
2+
3+
World "RingWorld"
4+
Level 1
5+
6+
Title "Implications"
7+
8+
Introduction "We learn how to use the intro tactic."
9+
10+
variable {R : Type}
11+
variable [CommRing R]
12+
13+
TacticDoc intro
14+
NewTactic intro
15+
16+
Statement ( x y : R ) : x = y + y → x + x = y + y + y + y := by
17+
intro h
18+
rw [h]
19+
rw [←add_assoc]
20+
21+
Conclusion "We can use intro to prove conditional statements."

Game/Levels/RingWorld/L02.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Game.Metadata
2+
3+
World "RingWorld"
4+
Level 2
5+
6+
Title "Substitution"
7+
8+
Introduction "One of our rules of logic is substitution."
9+
10+
variable {R : Type}
11+
variable [CommRing R]
12+
13+
NewTactic rfl
14+
15+
Statement ( a b b' : R ) : b = b' → a + b = a + b' := by
16+
intro h
17+
have : a + b = a + b := by rfl
18+
rw [h]
19+
20+
Conclusion ""

Game/Levels/RingWorld/L03.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Game.Metadata
2+
3+
World "RingWorld"
4+
Level 3
5+
6+
Title "add_right_cancel"
7+
8+
Introduction "Using the axioms, we prove that cancellation is possible."
9+
10+
variable {R : Type}
11+
variable [CommRing R]
12+
13+
NewTactic rcases congr «have»
14+
15+
Statement ( a b b' : R ) : b + a = b' + a → b = b' := by
16+
intro h
17+
rcases exist_add_inv a
18+
have : b + (a + w) = b' + (a + w) := by
19+
rw [←add_assoc]
20+
rw [←add_assoc]
21+
congr
22+
rw [h_1] at this
23+
rw [add_zero] at this
24+
rw [add_zero] at this
25+
apply this
26+
27+
Conclusion "You have just proved `add_right_cancel`"

Game/Levels/RingWorld/L04.lean

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Game.Metadata
2+
3+
World "RingWorld"
4+
Level 4
5+
6+
Title "zero times anything"
7+
8+
Introduction "Using the axioms, we prove zero times anything vanishes."
9+
10+
variable {R : Type}
11+
variable [CommRing R]
12+
13+
NewTheorem add_left_cancel add_right_cancel
14+
15+
NewTactic swap exact
16+
17+
Statement ( a : R ) : 0 * a = 0 := by
18+
apply add_left_cancel
19+
swap
20+
exact (0 * a)
21+
rw [add_zero]
22+
rw [←right_distrib]
23+
rw [add_zero]
24+
25+
Conclusion "You have just proved `zero_mul`"

Game/Metadata.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import Mathlib.Algebra.Ring.Defs
66
variable {R : Type}
77
variable [CommRing R]
88

9-
namespace Mathlib.Algebra.Ring
10-
119
theorem exist_add_inv (a : R) : (∃ (b : R), a + b = 0) := by
1210
use -a
1311
exact add_right_neg a

0 commit comments

Comments
 (0)