Compfiles/Usa1985P2.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned compfiles documentation, Pinned compfiles corpus index
13 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1985, Problem 2
Find all real roots of the quartic x⁴ - (2N + 1)x² - x + N² + N - 1 = 0 correct to 4 decimal places, where N = 10¹⁰.
Imports (6)
Imported by 1 file
- lemma
Usa1985P2.quartic_eqThe quartic of the problem rewrites as(x² - N - 1/2)² - x - 5/4; this is the key observation of the solution (see https://prase.cz/kalva/usa/usoln/usol852.html) line 34 sourceSource documentation
The quartic of the problem rewrites as
(x² - N - 1/2)² - x - 5/4; this is the key observation of the solution (see https://prase.cz/kalva/usa/usoln/usol852.html).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HSub.hSub,HAdd.hAdd,HPow.hPow,Nat,OfNat.ofNat,HMul.hMul,HDiv.hDivProof uses:
Mathlib.Tactic.Ring.of_eq,Int.rawCast,inferInstance,Ring,Int.negOfNat,Nat.rawCast,Mathlib.Tactic.Ring.Common.sub_congr,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.mpr,id,congrArg,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Tactic.Ring.Common.pow_add,Mathlib.Tactic.Ring.Common.single_powand 71 more85 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
lemma quartic_eq (N x : ℝ) : x ^ 4 - (2 * N + 1) * x ^ 2 - x + N ^ 2 + N - 1 = (x ^ 2 - N - 1 / 2) ^ 2 - x - 5 / 4 := by … - def
Usa1985P2.fThe function whose zeros are the real roots of the quartic line 40 sourceSource documentation
The function whose zeros are the real roots of the quartic.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
RealProof uses:
HSub.hSub,HPow.hPow,Nat,OfNat.ofNat,HDiv.hDiv17 instances, coercions and auxiliary constants left out.
noncomputable def f (N : ℝ) (x : ℝ) : ℝ := (x ^ 2 - N - 1 / 2) ^ 2 - x - 5 / 4
- lemma
Usa1985P2.f_defline 42 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq, Usa1985P2.f,HSub.hSub,HPow.hPow,Nat,OfNat.ofNat,HDiv.hDivProof uses:
rfl16 instances, coercions and auxiliary constants left out.
- lemma
Usa1985P2.f_continuousline 44 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Continuous, Usa1985P2.fProof uses:
id,Eq.mpr,HSub.hSub,HPow.hPow,Nat,OfNat.ofNat,HDiv.hDiv,Inv.inv,Eq,congrArg,funext,congrFun',one_div,Continuous.add_const,Continuous.fun_add,Neg.neg,Continuous.fun_pow,continuous_id',ContinuousNeg.continuous_neg39 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1985P2.exists_root_of_sign_changeA sign change off Non an interval locates a root in its interior line 49 sourceSource documentation
A sign change of
f Non an interval locates a root in its interior.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LE.le,LT.lt,HMul.hMul, Usa1985P2.f,OfNat.ofNat,Exists,And,Membership.mem,Set,Set.Ioo,EqProof uses:
ContinuousOn,Set.Icc,Continuous.continuousOn, Usa1985P2.f_continuous,Or,Iff.mp,mul_neg_iff,HAdd.hAdd,Set.image,intermediate_value_Ioo',And.intro,Exists.intro,intermediate_value_Ioo67 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
lemma exists_root_of_sign_change {N : ℝ} {a b : ℝ} (hab : a ≤ b) (h : f N a * f N b < 0) : ∃ x ∈ Set.Ioo a b, f N x = 0 := by …Mentions: h, Usa1985P2.f
- lemma
Usa1985P2.f_pos_of_nonposDocumented declaration: f_pos_of_nonpos line 63 sourceSource documentation
The quartic has no nonpositive real roots when
N = 10^10: forx ≤ -5/4the right sidex + 5/4of(x² - N - 1/2)² = x + 5/4is too small, and for-5/4 < x ≤ 0the left side is huge while the right side stays below5/4.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HPow.hPow,Nat,OfNat.ofNat,LE.le,LT.lt, Usa1985P2.fProof uses:
Eq.mpr,HSub.hSub,HDiv.hDiv,id,congrArg, Usa1985P2.f_def,Neg.neg,Or,le_or_gt,lt_or_eq_of_le,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HAdd.hAdd,HMul.hMul,inferInstance,AddMonoidWithOne,Mathlib.Meta.NormNum.instAtLeastTwo,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congrand 138 more137 instances, coercions and auxiliary constants left out.
Tactic trace: 24 steps
Open to load the checked before-and-after goal states.
lemma f_pos_of_nonpos {N : ℝ} (hN : N = 10 ^ 10) {x : ℝ} (hx : x ≤ 0) : 0 < f N x := by …Mentions: Usa1985P2.f
- lemma
Usa1985P2.f_lt_f_of_ltf Nis strictly antitone on{x ≥ 0 | x² ≤ N + 1/2}line 85 sourceSource documentation
f Nis strictly antitone on{x ≥ 0 | x² ≤ N + 1/2}.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LE.le,OfNat.ofNat,LT.lt,HPow.hPow,Nat,HAdd.hAdd,HDiv.hDiv, Usa1985P2.fProof uses:
HSub.hSub,Iff.mpr,sub_pos,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HMul.hMul,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,Int.rawCast,inferInstance,Ring,Int.negOfNat,Mathlib.Tactic.Ring.Common.mul_congr,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Mathlib.Meta.NormNum.instAtLeastTwoand 111 more133 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma f_lt_f_of_lt {N : ℝ} {x y : ℝ} (hx : 0 ≤ x) (hxy : x < y) (hy : y ^ 2 ≤ N + 1 / 2) : f N y < f N x := by …Mentions: Usa1985P2.f
- lemma
Usa1985P2.eq_of_region1Hence there is at most one root in{x ≥ 0 | x² ≤ N + 1/2}line 98 sourceSource documentation
Hence there is at most one root in
{x ≥ 0 | x² ≤ N + 1/2}.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LE.le,OfNat.ofNat,HPow.hPow,Nat,HAdd.hAdd,HDiv.hDiv,Eq, Usa1985P2.fProof uses:
LT.lt,Or,lt_trichotomy,absurd, Usa1985P2.f_lt_f_of_lt,Not.intro,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HSub.hSub,Neg.neg,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,HMul.hMul,Nat.rawCast,Int.rawCast,inferInstance,Ring,Int.negOfNat,Mathlib.Tactic.Ring.Common.sub_congrand 35 more82 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
lemma eq_of_region1 {N : ℝ} {x y : ℝ} (hx0 : 0 ≤ x) (hx2 : x ^ 2 ≤ N + 1 / 2) (hfx : f N x = 0) (hy0 : 0 ≤ y) (hy2 : y ^ 2 ≤ N + 1 / 2) (hfy : f N y = 0) : x = y := by …Mentions: Usa1985P2.f
- lemma
Usa1985P2.region2_keyTwo rootsx < ylying in{x² ≥ C}would force(y + x) * ((y² - C) + (x² - C)) = 1line 108 sourceSource documentation
Two roots
x < ylying in{x² ≥ C}would force(y + x) * ((y² - C) + (x² - C)) = 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,LT.lt,Eq,HPow.hPow,Nat,HSub.hSub,OfNat.ofNat,HAdd.hAdd,HDiv.hDiv,HMul.hMulProof uses:
Iff.mpr,sub_pos,Trans.trans,rfl,Eq.mpr,id,congrArg,mul_assoc,Eq.refl,sq_sub_sq,sub_sub_sub_cancel_right,mul_comm,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,Int.rawCast,inferInstance,Ring,Int.negOfNat,Mathlib.Tactic.Ring.Common.sub_congr,NNRat.rawCastand 55 more125 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma region2_key {x y : ℝ} (hxy : x < y) (C : ℝ) (e1 : (x ^ 2 - C) ^ 2 = x + 5 / 4) (e2 : (y ^ 2 - C) ^ 2 = y + 5 / 4) : (y + x) * ((y ^ 2 - C) + (x ^ 2 - C)) = 1 := by … - lemma
Usa1985P2.region2_auxBut forN = 10^10two roots in{x² ≥ N + 1/2}are impossible: the left side of the identity above exceeds2 * 10^5 * 316line 121 sourceSource documentation
But for
N = 10^10two roots in{x² ≥ N + 1/2}are impossible: the left side of the identity above exceeds2 * 10^5 * 316.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HPow.hPow,Nat,OfNat.ofNat,LE.le,HAdd.hAdd,HDiv.hDiv, Usa1985P2.f,LT.lt,FalseProof uses:
HSub.hSub,Mathlib.Tactic.Ring.of_eq,Rat.rawCast,Int.negOfNat,HMul.hMul,Nat.rawCast,Mathlib.Tactic.Ring.Common.sub_congr,NNRat.rawCast,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.mpr,id,congrArg,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Tactic.Ring.Common.pow_add,Mathlib.Tactic.Ring.Common.single_powand 133 more125 instances, coercions and auxiliary constants left out.
Tactic trace: 39 steps
Open to load the checked before-and-after goal states.
lemma region2_aux {N : ℝ} (hN : N = 10 ^ 10) {x y : ℝ} (hx0 : 0 ≤ x) (hx2 : N + 1 / 2 ≤ x ^ 2) (hfx : f N x = 0) (hxy : x < y) (hy2 : N + 1 / 2 ≤ y ^ 2) (hfy : f N y = 0) : False := by …Mentions: Usa1985P2.f
- lemma
Usa1985P2.eq_of_region2At most one root in{x ≥ 0 | x² ≥ N + 1/2}line 159 sourceSource documentation
At most one root in
{x ≥ 0 | x² ≥ N + 1/2}.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HPow.hPow,Nat,OfNat.ofNat,LE.le,HAdd.hAdd,HDiv.hDiv, Usa1985P2.fProof uses:
LT.lt,Or,lt_trichotomy,False.elim, Usa1985P2.region2_aux43 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma eq_of_region2 {N : ℝ} (hN : N = 10 ^ 10) {x y : ℝ} (hx0 : 0 ≤ x) (hx2 : N + 1 / 2 ≤ x ^ 2) (hfx : f N x = 0) (hy0 : 0 ≤ y) (hy2 : N + 1 / 2 ≤ y ^ 2) (hfy : f N y = 0) : x = y := by …Mentions: Usa1985P2.f
- determine
Usa1985P2.answerThe two real roots, correct to 4 decimal places line 170 sourceSource documentation
The two real roots, correct to 4 decimal places.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Prod,RealProof uses:
Prod.mk,OfScientific.ofScientific,Bool.true2 instances, coercions and auxiliary constants left out.
determine answer : ℝ × ℝ := (99999.9984, 100000.0016)
- problem
Usa1985P2.usa1985_p2line 172 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Eq,HPow.hPow,Nat,OfNat.ofNat,Exists,And,LT.lt,Iff,HSub.hSub,HAdd.hAdd,HMul.hMul,Or,abs,Prod.fst, Usa1985P2.answer,OfScientific.ofScientific,Bool.true,Prod.sndProof uses: Usa1985P2.f,
Eq.mpr,HDiv.hDiv,id,congrArg, Usa1985P2.f_def,Mathlib.Meta.NormNum.isNNRat_lt_true,Mathlib.Meta.NormNum.IsNat.to_isNNRat,Mathlib.Meta.NormNum.isNat_ofNat,Nat.cast_zero,Mathlib.Meta.NormNum.IsRat.to_isNNRat,Mathlib.Meta.NormNum.isRat_sub,Int.ofNat,Eq.refl,Mathlib.Meta.NormNum.IsNNRat.to_isRat,Mathlib.Meta.NormNum.isRat_pow,Int.negOfNat,Mathlib.Meta.NormNum.isNNRat_pow,Mathlib.Meta.NormNum.isNNRat_ofScientific_of_true,Mathlib.Meta.NormNum.isNNRat_nnratCastand 142 more159 instances, coercions and auxiliary constants left out.
Tactic trace: 72 steps
Open to load the checked before-and-after goal states.