Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions EasyLean/Basic.lean
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
import Mathlib.Data.Real.Basic
import Mathlib.Tactic.Linarith

theorem mathd_algebra_513
(a b : ℝ)
(h₀ : 3 * a + 2 * b = 5)
(h₁ : a + b = 2) :
a = 1 ∧ b = 1 := by
sorry

theorem eq_four : ∀ a b c d : Nat, a = b → a = d → a = c → c = b := by
sorry
import EasyLean.Theorems.mathd_algebra_513
import EasyLean.Theorems.eq_four
5 changes: 5 additions & 0 deletions EasyLean/Theorems/eq_four.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Mathlib

theorem eq_four : ∀ a b c d : Nat, a = b → a = d → a = c → c = b := by
intro a b c d hab had hac
exact hac.symm.trans hab
23 changes: 23 additions & 0 deletions EasyLean/Theorems/mathd_algebra_513.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Mathlib

theorem mathd_algebra_513
(a b : Real)
(h0 : 3 * a + 2 * b = 5)
(h1 : a + b = 2) :
a = 1 ∧ b = 1 := by
-- Subtract 2*(a+b) from h0 and then use h1 to simplify the right-hand side
have hsub : (3 * a + 2 * b) - 2 * (a + b) = (5 : Real) - 2 * 2 := by
have h := congrArg (fun x : Real => x - 2 * (a + b)) h0
simpa [h1] using h
-- Expand and normalize to get a = 1
have ha : a = 1 := by
have hsub' : (3 * a + 2 * b) - (2 * a + 2 * b) = (5 : Real) - 2 * 2 := by
simpa [mul_add] using hsub
have hnorm := hsub'
ring_nf at hnorm
exact hnorm
-- Get b from a + b = 2
have hb : b = 1 := by
have h1' : 1 + b = 2 := by simpa [ha] using h1
linarith [h1']
exact ⟨ha, hb⟩