diff --git a/EasyLean/Basic.lean b/EasyLean/Basic.lean index 305e1ca..75662b9 100644 --- a/EasyLean/Basic.lean +++ b/EasyLean/Basic.lean @@ -1,12 +1,5 @@ -import Mathlib.Data.Real.Basic -import Mathlib.Tactic.Linarith +import Mathlib +import EasyLean.Theorems.mathd_algebra_513 +import EasyLean.Theorems.eq_four -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 +-- Additional project-wide declarations can be added here if needed. diff --git a/EasyLean/Theorems/eq_four.lean b/EasyLean/Theorems/eq_four.lean new file mode 100644 index 0000000..2ba14f0 --- /dev/null +++ b/EasyLean/Theorems/eq_four.lean @@ -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 diff --git a/EasyLean/Theorems/mathd_algebra_513.lean b/EasyLean/Theorems/mathd_algebra_513.lean new file mode 100644 index 0000000..4d63a2e --- /dev/null +++ b/EasyLean/Theorems/mathd_algebra_513.lean @@ -0,0 +1,22 @@ +import Mathlib + +open scoped Real + +theorem mathd_algebra_513 (a b : Real) (h0 : 3 * a + 2 * b = 5) (h1 : a + b = 2) : a = 1 ∧ b = 1 := by + have hb : b = 2 - a := by + have ht : (a + b) - a = 2 - a := by + simpa using congrArg (fun t => t - a) h1 + have hx : (a + b) - a = b := by + simpa using add_sub_cancel a b + simpa [hx] using ht + have h2 : 3 * a + 2 * (2 - a) = 5 := by + simpa [hb] using h0 + have h3 : 4 + a = 5 := by + have h2' := h2 + ring_nf at h2' + simpa using h2' + have ha : a = 1 := by + linarith [h3] + have hb1 : b = 1 := by + linarith [h1, ha] + exact ⟨ha, hb1⟩