Compfiles/Imo2002P4.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
17 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2002, Problem 4
The positive divisors of the integer n > 1 are d₁ < d₂ < ... < dₖ, so that d₁ = 1 and dₖ = n. Let d = d₁d₂ + d₂d₃ + ... + dₖ₋₁dₖ. Show that d < n² and find all n for which d divides n².
Imports (17)
- Mathlib.Algebra.BigOperators.Intervals
- Mathlib.Algebra.BigOperators.Ring.Finset
- Mathlib.Algebra.Order.Ring.Star
- Mathlib.Data.Finset.Sort
- Mathlib.Data.Rat.Star
- Mathlib.NumberTheory.Divisors
- Mathlib.Tactic.FieldSimp
- Mathlib.Tactic.FieldSimp.Lemmas
- Mathlib.Tactic.Linarith
- Mathlib.Tactic.Linarith.Preprocessing
- Mathlib.Tactic.NormNum
- Mathlib.Tactic.NormNum.Ineq
- Mathlib.Tactic.Positivity
- Mathlib.Tactic.Positivity.Core
- Mathlib.Tactic.Ring
- Mathlib.Tactic.Ring.Basic
- ProblemExtraction
Imported by 1 file
- def
Imo2002P4.nthDivThei-th smallest positive divisor ofn(meaningful fori < n.divisors.card) line 44 sourceSource documentation
The
i-th smallest positive divisor ofn(meaningful fori < n.divisors.card).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
dite,LT.lt,Finset.card,Nat.divisors,OrderEmbedding,Fin,Finset.orderEmbOfFin,Fin.mk,Not,OfNat.ofNat14 instances, coercions and auxiliary constants left out.
noncomputable def nthDiv (n i : ℕ) : ℕ := …
- def
Imo2002P4.pairSumThe sum `d₁d₂ + d₂d₃ + line 48 sourceSource documentation
The sum
d₁d₂ + d₂d₃ + ... + dₖ₋₁dₖover the ordered positive divisors ofn.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Finset.sum,Finset.range,HSub.hSub,Finset.card,Nat.divisors,OfNat.ofNat,HMul.hMul, Imo2002P4.nthDiv,HAdd.hAdd8 instances, coercions and auxiliary constants left out.
noncomputable def pairSum (n : ℕ) : ℕ := …
- lemma
Imo2002P4.nthDiv_eqline 53 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,Finset.card,Nat.divisors,Eq, Imo2002P4.nthDiv,OrderEmbedding,Fin,Finset.orderEmbOfFin,rfl,Fin.mkProof uses:
id,Eq.mpr,dite,Not,OfNat.ofNat,congrArg,dite_eq_left,Eq.refl25 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2002P4.pairSum_eqline 58 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq, Imo2002P4.pairSum,Finset.sum,Finset.range,HSub.hSub,Finset.card,Nat.divisors,OfNat.ofNat,HMul.hMul, Imo2002P4.nthDiv,HAdd.hAddProof uses:
rfl8 instances, coercions and auxiliary constants left out.
- lemma
Imo2002P4.card_divisors_ge_twoline 62 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,LE.le,Finset.card,Nat.divisorsProof uses:
Finset,Insert.insert,Singleton.singleton,Membership.mem,Eq,Or,Eq.mp,Eq.trans,congrArg,Eq.mpr,id,Iff.mpr,And,Dvd.dvd,Ne,Nat.mem_divisors,And.intro,one_dvd,dvd_refl,Finset.card_le_cardand 1 more21 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2002P4.nthDiv_zeroline 73 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq, Imo2002P4.nthDivProof uses:
Finset.card,Nat.divisors,LE.le, Imo2002P4.card_divisors_ge_two,Eq.mpr,OrderEmbedding,Fin,Finset.orderEmbOfFin,rfl,Fin.mk,id,congrArg, Imo2002P4.nthDiv_eq,Finset.min',Iff.mp,Finset.Nonempty,Finset.card_pos,Eq.rec,Eq.symm,Finset.orderEmbOfFin_zeroand 13 more26 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2002P4.nthDiv_lastline 80 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,HSub.hSub,Finset.card,Nat.divisors,Eq, Imo2002P4.nthDivProof uses:
Eq.mpr,OrderEmbedding,Fin,Finset.orderEmbOfFin,rfl,Fin.mk,id,congrArg, Imo2002P4.nthDiv_eq,Finset.max',Iff.mp,Finset.Nonempty,Finset.card_pos,Eq.rec,Eq.symm,Nat.sub_lt,Nat.succ_pos,Finset.orderEmbOfFin_last,le_antisymm,Finset.max'_leand 12 more26 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2002P4.nthDiv_geline 88 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Finset.card,Nat.divisors,LE.le,HAdd.hAdd, Imo2002P4.nthDivProof uses:
Nat.recAux,Eq.mpr,OrderEmbedding,Fin,Finset.orderEmbOfFin,rfl,Fin.mk,id,Eq,congrArg, Imo2002P4.nthDiv_eq,Nat.pos_of_mem_divisors,Finset.orderEmbOfFin_mem,OrderEmbedding.strictMono,Iff.mpr,Fin.lt_def,Nat.lt_succ_self,Nat.succ_le_of_lt,lt_of_le_of_lt,Eq.mp25 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2002P4.div_lt_div_of_dvd_of_ltDivision is strictly antitone on the divisors of a positive integer line 106 sourceSource documentation
Division is strictly antitone on the divisors of a positive integer.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Dvd.dvd,HDiv.hDivProof uses:
LT.lt.trans,Nat.div_pos,Nat.le_of_dvd,Eq,HMul.hMul,Nat.mul_div_cancel',Decidable.byContradiction,Not,LE.le,mul_le_mul_right,Eq.mp,mul_lt_mul_of_pos_right28 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
lemma div_lt_div_of_dvd_of_lt {a b n : ℕ} (hn0 : 0 < n) (ha : a ∣ n) (hb : b ∣ n) (ha0 : 0 < a) (hab : a < b) : n / b < n / a := by … - lemma
Imo2002P4.nthDiv_pairPairing of divisors: thei-th smallest times thei-th largest equalsnline 119 sourceSource documentation
Pairing of divisors: the
i-th smallest times thei-th largest equalsn.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Finset.card,Nat.divisors,Eq,HMul.hMul, Imo2002P4.nthDiv,HSub.hSubProof uses:
LE.le, Imo2002P4.card_divisors_ge_two,Fin,Fin.isLt,Membership.mem,Finset,HDiv.hDiv,OrderEmbedding,Finset.orderEmbOfFin,rfl,Fin.mk,Dvd.dvd,And.left,Ne,Iff.mp,And,Nat.mem_divisors,Finset.orderEmbOfFin_mem,Iff.mpr,And.introand 17 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 32 steps
Open to load the checked before-and-after goal states.
lemma nthDiv_pair (n : ℕ) (hn : 1 < n) (i : ℕ) (hi : i < n.divisors.card) : nthDiv n i * nthDiv n (n.divisors.card - 1 - i) = n := by …Mentions: Imo2002P4.nthDiv
- lemma
Imo2002P4.nthDiv_oneThe second smallest divisor ofn > 1is its least prime factor line 167 sourceSource documentation
The second smallest divisor of
n > 1is its least prime factor.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq, Imo2002P4.nthDiv,Nat.minFacProof uses:
LE.le,Finset.card,Nat.divisors, Imo2002P4.card_divisors_ge_two,Eq.mpr,OrderEmbedding,Fin,Finset.orderEmbOfFin,rfl,Fin.mk,id,congrArg, Imo2002P4.nthDiv_eq,le_antisymm,Membership.mem,Finset,Iff.mpr,And,Dvd.dvd,Neand 23 more39 instances, coercions and auxiliary constants left out.
Tactic trace: 41 steps
Open to load the checked before-and-after goal states.
lemma nthDiv_one (n : ℕ) (hn : 1 < n) : nthDiv n 1 = n.minFac := by …
Mentions: Imo2002P4.nthDiv
- lemma
Imo2002P4.teleTelescoping sum used in part (a) line 208 sourceSource documentation
Telescoping sum used in part (a).
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Rat,Finset.sum,Finset.range,HSub.hSub,HDiv.hDiv,OfNat.ofNat,HAdd.hAddProof uses:
Finset.sum_range_sub',Eq.mpr,id,congrArg,Eq.mp,congr,Finset.sum_congr,Eq.refl,Finset,Membership.mem,congrFun',Eq.trans,Nat.cast_add,Nat.cast_one,Nat.cast_zero,of_eq_true,True,Inv.inv,Mathlib.Meta.NormNum.IsNat.to_eq,Mathlib.Meta.NormNum.instAddMonoidWithOne'and 12 more59 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma tele (m : ℕ) : ∑ j ∈ Finset.range m, (1 / ((j : ℚ) + 1) - 1 / ((j : ℚ) + 1 + 1)) = 1 - 1 / ((m : ℚ) + 1) := by … - lemma
Imo2002P4.pairSum_ltPart (a): the sum is less thann ^ 2line 217 sourceSource documentation
Part (a): the sum is less than
n ^ 2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat, Imo2002P4.pairSum,HPow.hPowProof uses:
LE.le,Finset.card,Nat.divisors, Imo2002P4.card_divisors_ge_two,Rat,Eq,Finset.sum,Finset.range,HSub.hSub,HMul.hMul, Imo2002P4.nthDiv,HAdd.hAdd,Eq.mpr,id,congrArg, Imo2002P4.pairSum_eq,Eq.trans,Finset.sum_congr,Eq.refl,Finsetand 160 more181 instances, coercions and auxiliary constants left out.
Tactic trace: 90 steps
Open to load the checked before-and-after goal states.
lemma pairSum_lt (n : ℕ) (hn : 1 < n) : pairSum n < n ^ 2 := by …
Mentions: Imo2002P4.pairSum
- lemma
Imo2002P4.pairSum_eq_of_primeline 325 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Nat.Prime,Eq, Imo2002P4.pairSumProof uses:
Finset,Nat.divisors,Insert.insert,Singleton.singleton,Nat.Prime.divisors,Eq.mpr,Finset.sum,Finset.range,HSub.hSub,Finset.card,HMul.hMul, Imo2002P4.nthDiv,HAdd.hAdd,id,congrArg, Imo2002P4.pairSum_eq,Finset.card_pair,Ne,rfl,Finset.sum_range_oneand 10 more28 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2002P4.pairSum_not_dvd_of_not_primeCompositendoes not work:n ^ 2 / n.minFac < d ≤ n ^ 2 / n.minFacline 340 sourceSource documentation
Composite
ndoes not work:n ^ 2 / n.minFac < d ≤ n ^ 2 / n.minFac.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Not,Nat.Prime, Imo2002P4.pairSum,HPow.hPow,Dvd.dvd,FalseProof uses:
LE.le,Nat.minFac,Nat.Prime.two_le,Nat.minFac_prime,Ne,Eq,Or,eq_or_lt_of_le,Nat.minFac_le,absurd,Eq.rec,Finset.card,Nat.divisors,Finset,Insert.insert,Singleton.singleton,Membership.mem,Eq.mp,Eq.trans,congrArgand 57 more85 instances, coercions and auxiliary constants left out.
Tactic trace: 104 steps
Open to load the checked before-and-after goal states.
lemma pairSum_not_dvd_of_not_prime (n : ℕ) (hn : 1 < n) (hnp : ¬ n.Prime) (ha : pairSum n < n ^ 2) (hdvd : pairSum n ∣ n ^ 2) : False := by …Mentions: Imo2002P4.pairSum
- determine
Imo2002P4.SolutionSetline 434 sourcestandard axioms: propext what this means
Statement uses:
Set,NatProof uses:
Set.ofPred,Nat.Prime - problem
Imo2002P4.imo2002_p4line 436 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,And, Imo2002P4.pairSum,HPow.hPow,Iff,Dvd.dvd,Membership.mem,Set, Imo2002P4.SolutionSetProof uses:
And.intro, Imo2002P4.pairSum_lt,Iff.intro,Decidable.byContradiction,Nat.Prime,Not, Imo2002P4.pairSum_not_dvd_of_not_prime,Eq.mpr,id,Eq,congrArg, Imo2002P4.pairSum_eq_of_prime,dvd_pow_self,Ne,Mathlib.Meta.NormNum.isNat_eq_false,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Bool.false20 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.