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

32 lines
725 B
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.Tactic.Linarith
Game "TestGame"
World "Prime"
Level 2
Title "Linarith"
Introduction
"
Sobald man mit einem Ring arbeitet, der eine lineare Order hat (also z.B. `` oder ``),
ist `linarith` stärker und kann Systeme von Gleichungen und Ungleichungen angehen.
`linarith` kann aber nur mit linearen Ungleichungen umgehen, mit Termen der Form `x ^ 2`
kann es nicht umgehen.
"
Statement
"Angenommen man hat für zwei Ganzzahlen $x, y$ folgende Ungleichungen.
$$
\\begin{aligned} 5 * y &\\le 35 - 2 * x \\\\ 2 * y &\\le x + 3 \\end{aligned}
$$
Zeige, dass $y \\le 5$.
"
(x y : )
(h₂ : 5 * y ≤ 35 - 2 * x)
(h₃ : 2 * y ≤ x + 3)
: y ≤ 5 := by
linarith