Compfiles/Usa1983P5.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
25 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1983, Problem 5
Consider an open interval of length 1/n on the real number line, where n is a positive integer. Prove that the number of irreducible fractions p/q, with 1 ≤ q ≤ n, contained in the given interval is at most (n + 1) / 2.
Imports (6)
Imported by 1 file
- def
Usa1983P5.fracsRationals in the interval with reduced denominator at mostnline 34 sourceSource comment
Rationals in the interval with reduced denominator at most `n`.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,Set,RatProof uses:
Set.ofPred,And,LE.le,Rat.den,Membership.mem,Set.Ioo,HAdd.hAdd,HDiv.hDiv,OfNat.ofNat14 instances, coercions and auxiliary constants left out.
def fracs (x : ℝ) (n : ℕ) : Set ℚ := …
- def
Usa1983P5.OccursDenline 37 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,NatProof uses:
Exists,Rat,And,Membership.mem,Set, Usa1983P5.fracs,Eq,Rat.den1 instances, coercions and auxiliary constants left out.
- def
Usa1983P5.denomsline 40 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,FinsetProof uses:
Finset.filter, Usa1983P5.OccursDen,Classical.propDecidable,Finset.Icc,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.dist_lt_interval_lengthOpenness of the interval gives strict spacing line 45 sourceSource comment
Openness of the interval gives strict spacing.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Rat,Membership.mem,Set, Usa1983P5.fracs,abs,HSub.hSub,HDiv.hDivProof uses:
HAdd.hAdd,Set.Ioo,And.right,LE.le,Rat.den,Eq.mpr,And,id,Eq,congrArg,propext,abs_sub_lt_iff,And.intro,lt_of_not_ge,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,HMul.hMul,inferInstance,AddMonoidWithOne,Mathlib.Tactic.Ring.of_eqand 63 more110 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma dist_lt_interval_length {x : ℝ} {n : ℕ} (_hn : 0 < n) {r s : ℚ} (hr : r ∈ fracs x n) (hs : s ∈ fracs x n) : |(r : ℝ) - (s : ℝ)| < 1 / (n : ℝ) := by …Mentions: Usa1983P5.fracs
- lemma
Usa1983P5.one_div_den_le_abs_ratline 54 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Rat,Ne,OfNat.ofNat,LE.le,Real,HDiv.hDiv,Rat.den,absProof uses:
Rat.num,cast,Int,Eq.trans,Nat,congrFun',congrArg,Eq.symm,Nat.cast_one,Int.cast_one,Int.one_le_abs,Iff.mpr,Rat.num_ne_zero,LT.lt,Nat.cast_zero,Rat.den_pos,Eq.mpr,id,Eq,Rat.cast_defand 3 more89 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.one_div_den_le_dist_of_dvd_denSpacing for denominators related by divisibility line 64 sourceSource comment
Spacing for denominators related by divisibility.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Rat,Nat,Eq,Rat.den,Dvd.dvd,Ne,LE.le,Real,HDiv.hDiv,OfNat.ofNat,abs,HSub.hSubProof uses:
LT.lt,Eq.mpr,id,congrArg,Eq.symm,Rat.den_pos,Nat.lcm,Rat.sub_den_dvd_lcm,Nat.lcm_eq_right,Eq.mp,Nat.le_of_dvd, Usa1983P5.one_div_den_le_abs_rat,Iff.mpr,sub_ne_zero,one_div_le_one_div_of_le,cast,Eq.trans,congrFun',Nat.cast_zero,LE.le.transand 4 more80 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
lemma one_div_den_le_dist_of_dvd_den {r s : ℚ} {d e : ℕ} (hrd : r.den = d) (hse : s.den = e) (hdiv : d ∣ e) (hne : r ≠ s) : 1 / (e : ℝ) ≤ |(r : ℝ) - (s : ℝ)| := by … - lemma
Usa1983P5.same_den_uniqueline 87 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Rat,Membership.mem,Set, Usa1983P5.fracs,Eq,Rat.denProof uses:
Decidable.byContradiction,Not,LE.le,HDiv.hDiv,abs,HSub.hSub, Usa1983P5.one_div_den_le_dist_of_dvd_den,Eq.refl,Eq.mpr,Dvd.dvd,id,congrArg,dvd_refl, Usa1983P5.dist_lt_interval_length,Rat.den_pos,one_div_le_one_div_of_le,cast,Eq.symm,Eq.trans,congrFun'and 70 more106 instances, coercions and auxiliary constants left out.
Tactic trace: 18 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.den_mem_denomsline 106 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,Rat,Membership.mem,Set, Usa1983P5.fracs,Finset, Usa1983P5.denoms,Rat.denProof uses:
Eq.mpr,Finset.filter, Usa1983P5.OccursDen,Classical.propDecidable,Finset.Icc,OfNat.ofNat,id,Eq,congrArg,Usa1983P5.denoms.eq_1,And,LE.le,Eq.trans,congrFun',And.intro,Rat.den_pos,And.left,Set.Ioo,HAdd.hAdd,HDiv.hDivand 2 more25 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.no_dvd_between_occurring_denomsOccurring denominators form a divisibility antichain line 113 sourceSource comment
Occurring denominators form a divisibility antichain.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Membership.mem,Finset, Usa1983P5.denoms,Ne,Not,Dvd.dvdProof uses:
Rat,And,Set, Usa1983P5.fracs,Eq,Rat.den,Exists,False,And.right,LE.le,Eq.mp, Usa1983P5.OccursDen,congrArg,Usa1983P5.OccursDen.eq_1,Finset.filter,Classical.propDecidable,Finset.Icc,Eq.trans,congrFun',Usa1983P5.denoms.eq_1and 82 more114 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
lemma no_dvd_between_occurring_denoms {x : ℝ} {n d e : ℕ} (hn : 0 < n) (hd : d ∈ denoms x n) (he : e ∈ denoms x n) (hne : d ≠ e) : ¬ d ∣ e := by …Mentions: Usa1983P5.denoms
- lemma
Usa1983P5.den_bijOnline 139 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Set.BijOn,Rat,Rat.den, Usa1983P5.fracs,Finset, Usa1983P5.denomsProof uses:
And.intro,Set.MapsTo,And,Set.InjOn,Set.SurjOn,Membership.mem,Set, Usa1983P5.den_mem_denoms,Eq, Usa1983P5.same_den_unique,Exists,Set.image,And.right,LE.le,Eq.mp, Usa1983P5.OccursDen,congrArg,Usa1983P5.OccursDen.eq_1,Finset.filter,Classical.propDecidableand 5 more18 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.fracs_ncard_eq_denoms_cardline 153 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Eq,Set.ncard,Rat, Usa1983P5.fracs,Finset.card, Usa1983P5.denomsProof uses:
Eq.mp,Finset,congrArg,Set.ncard_coe_finset,Set.BijOn.ncard_eq,Rat.den, Usa1983P5.den_bijOn6 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.fracs_finiteline 157 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Set.Finite,Rat, Usa1983P5.fracsProof uses:
Iff.mpr,Finset, Usa1983P5.denoms,Set.BijOn.finite_iff_finite,Rat.den, Usa1983P5.den_bijOn,Finset.finite_toSet6 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- def
Usa1983P5.twoPartDecomposeainto its power-of-two factor and the remaining odd factor line 163 sourceSource comment
Decompose `a` into its power-of-two factor and the remaining odd factor. For positive `a`, `oddPart a` is the largest odd divisor.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
HPow.hPow,OfNat.ofNat,Finsupp,Nat.factorization9 instances, coercions and auxiliary constants left out.
def twoPart (a : ℕ) : ℕ := …
- def
Usa1983P5.oddPartline 166 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
HDiv.hDiv,HPow.hPow,OfNat.ofNat,Finsupp,Nat.factorization11 instances, coercions and auxiliary constants left out.
- lemma
Usa1983P5.twoPart_mul_oddPartline 169 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,HMul.hMul, Usa1983P5.twoPart, Usa1983P5.oddPartProof uses:
id,Nat.ordProj_mul_ordCompl_eq_self,OfNat.ofNat5 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.oddPart_oddline 172 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne,OfNat.ofNat,Odd, Usa1983P5.oddPartProof uses:
Iff.mp,Not,Even,Nat.not_even_iff_odd,Eq.mpr,Dvd.dvd,id,Eq,congrArg,propext,even_iff_two_dvd,HMod.hMod,HDiv.hDiv,HPow.hPow,Finsupp,Nat.factorization,Eq.mp,Nat.not_dvd_ordCompl,Nat.prime_two32 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.oddPart_le_selfline 178 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le, Usa1983P5.oddPartProof uses:
id,Nat.ordCompl_le,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.pos_of_mem_Icc_oneline 182 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset,Finset.Icc,OfNat.ofNat,LT.ltProof uses:
Iff.mp,LE.le,Nat.succ,Nat.succ_le_iff,And.left,And,Finset.mem_Icc14 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.odd_eq_of_half_eqline 186 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Odd,Eq,HDiv.hDiv,OfNat.ofNatProof uses:
Trans.trans,HAdd.hAdd,HMul.hMul,Eq.symm,Nat.two_mul_div_two_add_one_of_odd,Eq.mpr,id,congrArg,Eq.refl13 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.oddPart_index_lt_halfline 193 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset,Finset.Icc,OfNat.ofNat,LT.lt,HDiv.hDiv, Usa1983P5.oddPart,HAdd.hAddProof uses:
LE.le,And.right,Iff.mp,And,Finset.mem_Icc,Ne,LT.lt.ne', Usa1983P5.pos_of_mem_Icc_one,Odd, Usa1983P5.oddPart_odd,LE.le.trans, Usa1983P5.oddPart_le_self,Eq,HMul.hMul,Nat.two_mul_div_two_add_one_of_odd25 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.dvd_or_dvd_of_oddPart_eqline 203 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq, Usa1983P5.oddPart,Or,Dvd.dvdProof uses:
dite,LE.le,Finsupp,Nat.factorization,OfNat.ofNat,Or.inl,HPow.hPow,pow_dvd_pow,HMul.hMul,Exists.intro,Eq.mpr, Usa1983P5.twoPart,id,congrArg,Eq.symm, Usa1983P5.twoPart_mul_oddPart,Usa1983P5.twoPart.eq_1,congr,Lean.Data.AC.Context.eq_of_norm,Lean.Data.AC.Context.mkand 19 more19 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.oddIndex_injective_of_no_dvdline 220 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LE.le,Finset.Icc,OfNat.ofNat,Membership.mem,Ne,Not,Dvd.dvd,Function.Injective,Subtype,Fin,HDiv.hDiv,HAdd.hAdd,Fin.mk, Usa1983P5.oddPart, Usa1983P5.oddPart_index_lt_half,Subtype.propertyProof uses:
Eq,Subtype.ext,dite,False.elim,LT.lt.ne', Usa1983P5.pos_of_mem_Icc_one,congrArg, Usa1983P5.odd_eq_of_half_eq, Usa1983P5.oddPart_odd,Or,False, Usa1983P5.dvd_or_dvd_of_oddPart_eq,Ne.symm31 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1983P5.card_le_half_of_no_dvdLargest-odd-divisor pigeonhole step line 243 sourceSource comment
Largest-odd-divisor pigeonhole step.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LE.le,Finset.Icc,OfNat.ofNat,Membership.mem,Ne,Not,Dvd.dvd,Finset.card,HDiv.hDiv,HAdd.hAddProof uses:
Subtype,Fin,Fin.mk, Usa1983P5.oddPart, Usa1983P5.oddPart_index_lt_half,Subtype.property,Function.Injective, Usa1983P5.oddIndex_injective_of_no_dvd,Eq.mpr,id,Eq,Eq.mp,Fintype.card,congr,congrArg,Fintype.card_coe,Fintype.card_fin,Fintype.card_le_of_injective32 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma card_le_half_of_no_dvd {s : Finset ℕ} {n : ℕ} (hs : s ⊆ Finset.Icc 1 n) (hantichain : ∀ a ∈ s, ∀ b ∈ s, a ≠ b → ¬ a ∣ b) : s.card ≤ (n + 1) / 2 := by … - lemma
Usa1983P5.denoms_subset_Iccline 254 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LE.le,Finset, Usa1983P5.denoms,Finset.Icc,OfNat.ofNatProof uses:
Membership.mem,Eq.mpr,And,id,Eq,Eq.mp,And.left, Usa1983P5.OccursDen,Finset.filter,Classical.propDecidable,congrArg,Usa1983P5.denoms.eq_114 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- problem
Usa1983P5.usa1983_p5line 263 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Real,Nat,LT.lt,OfNat.ofNat,Set,Rat,Set.ofPred,And,LE.le,Rat.den,Membership.mem,Set.Ioo,HAdd.hAdd,HDiv.hDiv,Set.Finite,Set.ncardProof uses:
id,And.intro, Usa1983P5.fracs, Usa1983P5.fracs_finite,Trans.trans,Eq,Finset.card, Usa1983P5.denoms, Usa1983P5.fracs_ncard_eq_denoms_card, Usa1983P5.card_le_half_of_no_dvd, Usa1983P5.denoms_subset_Icc,Finset,Ne, Usa1983P5.no_dvd_between_occurring_denoms39 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.