Compfiles/Usa1983P5.lean

GitHub source file

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
  1. def Usa1983P5.fracs Rationals in the interval with reduced denominator at most n line 34 source

    Source 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, Rat

    Proof uses: Set.ofPred, And, LE.le, Rat.den, Membership.mem, Set.Ioo, HAdd.hAdd, HDiv.hDiv, OfNat.ofNat

    14 instances, coercions and auxiliary constants left out.

    def fracs (x : ℝ) (n : ℕ) : Set ℚ :=
    …
  2. def Usa1983P5.OccursDen line 37 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Real, Nat

    Proof uses: Exists, Rat, And, Membership.mem, Set, Usa1983P5.fracs, Eq, Rat.den

    1 instances, coercions and auxiliary constants left out.

  3. def Usa1983P5.denoms line 40 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Real, Nat, Finset

    Proof uses: Finset.filter, Usa1983P5.OccursDen, Classical.propDecidable, Finset.Icc, OfNat.ofNat

    3 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

  4. lemma Usa1983P5.dist_lt_interval_length Openness of the interval gives strict spacing line 45 source

    Source 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.hDiv

    Proof 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_eq and 63 more

    110 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

  5. lemma Usa1983P5.one_div_den_le_abs_rat line 54 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Rat, Ne, OfNat.ofNat, LE.le, Real, HDiv.hDiv, Rat.den, abs

    Proof 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_def and 3 more

    89 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

    Open to load the checked before-and-after goal states.

  6. lemma Usa1983P5.one_div_den_le_dist_of_dvd_den Spacing for denominators related by divisibility line 64 source

    Source 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.hSub

    Proof 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.trans and 4 more

    80 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
    …
  7. lemma Usa1983P5.same_den_unique line 87 source

    standard 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.den

    Proof 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 more

    106 instances, coercions and auxiliary constants left out.

    Tactic trace: 18 steps

    Open to load the checked before-and-after goal states.

  8. lemma Usa1983P5.den_mem_denoms line 106 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Real, Nat, Rat, Membership.mem, Set, Usa1983P5.fracs, Finset, Usa1983P5.denoms, Rat.den

    Proof 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.hDiv and 2 more

    25 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

    Open to load the checked before-and-after goal states.

  9. lemma Usa1983P5.no_dvd_between_occurring_denoms Occurring denominators form a divisibility antichain line 113 source

    Source 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.dvd

    Proof 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_1 and 82 more

    114 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

  10. lemma Usa1983P5.den_bijOn line 139 source

    standard 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.denoms

    Proof 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.propDecidable and 5 more

    18 instances, coercions and auxiliary constants left out.

    Tactic trace: 14 steps

    Open to load the checked before-and-after goal states.

  11. lemma Usa1983P5.fracs_ncard_eq_denoms_card line 153 source

    standard 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.denoms

    Proof uses: Eq.mp, Finset, congrArg, Set.ncard_coe_finset, Set.BijOn.ncard_eq, Rat.den, Usa1983P5.den_bijOn

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  12. lemma Usa1983P5.fracs_finite line 157 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Real, Nat, LT.lt, OfNat.ofNat, Set.Finite, Rat, Usa1983P5.fracs

    Proof uses: Iff.mpr, Finset, Usa1983P5.denoms, Set.BijOn.finite_iff_finite, Rat.den, Usa1983P5.den_bijOn, Finset.finite_toSet

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  13. def Usa1983P5.twoPart Decompose a into its power-of-two factor and the remaining odd factor line 163 source

    Source 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: Nat

    Proof uses: HPow.hPow, OfNat.ofNat, Finsupp, Nat.factorization

    9 instances, coercions and auxiliary constants left out.

    def twoPart (a : ℕ) : ℕ :=
    …
  14. def Usa1983P5.oddPart line 166 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: HDiv.hDiv, HPow.hPow, OfNat.ofNat, Finsupp, Nat.factorization

    11 instances, coercions and auxiliary constants left out.

  15. lemma Usa1983P5.twoPart_mul_oddPart line 169 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Eq, HMul.hMul, Usa1983P5.twoPart, Usa1983P5.oddPart

    Proof uses: id, Nat.ordProj_mul_ordCompl_eq_self, OfNat.ofNat

    5 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  16. lemma Usa1983P5.oddPart_odd line 172 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Ne, OfNat.ofNat, Odd, Usa1983P5.oddPart

    Proof 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_two

    32 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

    Open to load the checked before-and-after goal states.

  17. lemma Usa1983P5.oddPart_le_self line 178 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, Usa1983P5.oddPart

    Proof uses: id, Nat.ordCompl_le, OfNat.ofNat

    3 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  18. lemma Usa1983P5.pos_of_mem_Icc_one line 182 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Membership.mem, Finset, Finset.Icc, OfNat.ofNat, LT.lt

    Proof uses: Iff.mp, LE.le, Nat.succ, Nat.succ_le_iff, And.left, And, Finset.mem_Icc

    14 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

  19. lemma Usa1983P5.odd_eq_of_half_eq line 186 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Odd, Eq, HDiv.hDiv, OfNat.ofNat

    Proof uses: Trans.trans, HAdd.hAdd, HMul.hMul, Eq.symm, Nat.two_mul_div_two_add_one_of_odd, Eq.mpr, id, congrArg, Eq.refl

    13 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

  20. lemma Usa1983P5.oddPart_index_lt_half line 193 source

    standard 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.hAdd

    Proof 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_odd

    25 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

    Open to load the checked before-and-after goal states.

  21. lemma Usa1983P5.dvd_or_dvd_of_oddPart_eq line 203 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Eq, Usa1983P5.oddPart, Or, Dvd.dvd

    Proof 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.mk and 19 more

    19 instances, coercions and auxiliary constants left out.

    Tactic trace: 16 steps

    Open to load the checked before-and-after goal states.

  22. lemma Usa1983P5.oddIndex_injective_of_no_dvd line 220 source

    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, Function.Injective, Subtype, Fin, HDiv.hDiv, HAdd.hAdd, Fin.mk, Usa1983P5.oddPart, Usa1983P5.oddPart_index_lt_half, Subtype.property

    Proof 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.symm

    31 instances, coercions and auxiliary constants left out.

    Tactic trace: 17 steps

    Open to load the checked before-and-after goal states.

  23. lemma Usa1983P5.card_le_half_of_no_dvd Largest-odd-divisor pigeonhole step line 243 source

    Source 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.hAdd

    Proof 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_injective

    32 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
    …
  24. lemma Usa1983P5.denoms_subset_Icc line 254 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Real, Nat, LE.le, Finset, Usa1983P5.denoms, Finset.Icc, OfNat.ofNat

    Proof uses: Membership.mem, Eq.mpr, And, id, Eq, Eq.mp, And.left, Usa1983P5.OccursDen, Finset.filter, Classical.propDecidable, congrArg, Usa1983P5.denoms.eq_1

    14 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  25. problem Usa1983P5.usa1983_p5 line 263 source

    standard 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.ncard

    Proof 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_denoms

    39 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

    Open to load the checked before-and-after goal states.