Compfiles/Usa2008P1.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

11 declarations, 0 contain sorry, 0 declared as axioms

USA Mathematical Olympiad 2008, Problem 1

Prove that for each positive integer n, there are pairwise relatively prime integers k₀,k₁,...,kₙ, all strictly greater than 1, such that k₀k₁...kₙ - 1 is a product of two consecutive integers.

Imports (2)
Imported by 1 file
  1. def Usa2008P1.kseq Define the two main sequences line 33 source

    Source comment

    Define the two main sequences

    standard axioms: propext what this means

    Statement uses: Nat

    Proof uses: ite, Eq, OfNat.ofNat, HAdd.hAdd, HSub.hSub, HPow.hPow

    10 instances, coercions and auxiliary constants left out.

    def kseq (n : ℕ) : ℕ :=
    …
  2. def Usa2008P1.xseq line 35 source

    standard axioms: propext what this means

    Statement uses: Nat

    Proof uses: HPow.hPow, OfNat.ofNat

    5 instances, coercions and auxiliary constants left out.

  3. lemma Usa2008P1.k_greater_than_one line 37 source

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

    Statement uses: Nat, LT.lt, OfNat.ofNat, Usa2008P1.kseq

    Proof uses: id, dite, ite, Eq, HAdd.hAdd, HSub.hSub, HPow.hPow, Eq.mpr, congrArg, ite_eq_left, Mathlib.Meta.NormNum.isNat_lt_true, Mathlib.Meta.NormNum.isNat_ofNat, Eq.refl, Bool, Bool.false, Not, ite_eq_right, pow_lt_pow_right₀

    26 instances, coercions and auxiliary constants left out.

    Tactic trace: 9 steps

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

  4. lemma Usa2008P1.quartic_polynomial_identity Main identity k₀k₁...kₙ - 1 = xₙ (xₙ + 1) line 45 source

    Source comment

    Main identity k₀k₁...kₙ - 1 = xₙ (xₙ + 1)

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

    Statement uses: Nat, Eq, HMul.hMul, HAdd.hAdd, HPow.hPow, OfNat.ofNat, HSub.hSub

    Proof uses: Eq.mpr, Int, id, Eq.trans, congr, congrArg, Nat.cast_mul, Nat.cast_add, congrFun', Nat.cast_pow, Nat.cast_one, Nat.cast_sub, LE.le, le_of_not_gt, LT.lt, Mathlib.Tactic.Linarith.lt_irrefl, Eq.mp, Neg.neg, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.add_congr and 62 more

    106 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

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

    lemma quartic_polynomial_identity (t : ℕ) :
        (t^2 + t + 1) * (t^2 - t + 1) = t^4 + t^2 + 1 := by
    …
  5. lemma Usa2008P1.main_identity line 50 source

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

    Statement uses: Nat, Eq, Finset.prod, Fin, HAdd.hAdd, OfNat.ofNat, Finset.univ, Usa2008P1.kseq, HPow.hPow, Usa2008P1.xseq

    Proof uses: Nat.recAux, of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl, Eq.mpr, HMul.hMul, Fin.castSucc, Fin.last, congrArg, Fin.prod_univ_castSucc, congrFun', Finset.prod_congr, Finset, Membership.mem, HSub.hSub, Eq.trans, ite and 34 more

    65 instances, coercions and auxiliary constants left out.

    Tactic trace: 15 steps

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

  6. lemma Usa2008P1.kseq_succ_eq kₙ₊₁ = xₙ² - xₙ + 1 line 67 source

    Source comment

    kₙ₊₁ = xₙ² - xₙ + 1

    standard axioms: propext what this means

    Statement uses: Nat, Eq, Usa2008P1.kseq, HAdd.hAdd, OfNat.ofNat, HSub.hSub, HPow.hPow, Usa2008P1.xseq

    Proof uses: id, ite, Eq.mpr, congrFun', congrArg, Eq.trans, ite_congr, Eq.refl, Not, Nat.add_sub_cancel, Decidable, Nat.succ, ite_eq_right, Nat.succ_ne_zero, of_eq_true, HMul.hMul, True, congr, Nat.rawCast, Mathlib.Tactic.Ring.Common.add_congr and 32 more

    44 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

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

    lemma kseq_succ_eq (n : ℕ) : kseq (n + 1) = xseq n ^ 2 - xseq n + 1 := by
    …

    Mentions: Usa2008P1.kseq, Usa2008P1.xseq

  7. lemma Usa2008P1.gcd_quad_identity gcd(x² + x + 1, x² - x + 1) = 1 line 73 source

    Source comment

    gcd(x² + x + 1, x² - x + 1) = 1

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

    Statement uses: Int, Eq, Nat, Int.gcd, HAdd.hAdd, HPow.hPow, OfNat.ofNat, HSub.hSub

    Proof uses: Eq.mpr, HMul.hMul, id, congrArg, Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.pow_congr, Mathlib.Tactic.Ring.Common.atom_pf, rfl, 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_pow, Mathlib.Tactic.Ring.Common.mul_pow_mul, Mathlib.Meta.NormNum.IsNat.to_raw_eq, Mathlib.Meta.NormNum.isNat_mul, Mathlib.Meta.NormNum.IsNat.of_raw and 82 more

    80 instances, coercions and auxiliary constants left out.

    Tactic trace: 15 steps

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

    lemma gcd_quad_identity (x : ℤ) :
        Int.gcd (x^2 + x + 1) (x^2 - x + 1) = 1 := by
    …
  8. lemma Usa2008P1.gcd_quad_identity_nat we also need an ℕ version of the previous identity line 89 source

    Source comment

    we also need an ℕ version of the previous identity

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

    Statement uses: Nat, Eq, Nat.gcd, HAdd.hAdd, HPow.hPow, OfNat.ofNat, HSub.hSub

    Proof uses: Eq.mpr, Int.gcd, Int, eq_of_heq, HEq, Eq.refl, HEq.refl, Eq.symm, LE.le, le_of_not_gt, LT.lt, Mathlib.Tactic.Linarith.lt_irrefl, Eq.mp, Neg.neg, HMul.hMul, congrArg, Mathlib.Tactic.Ring.of_eq, Mathlib.Tactic.Ring.Common.add_congr, Nat.rawCast, Int.rawCast and 65 more

    106 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

    lemma gcd_quad_identity_nat (x : ℕ) :
        Nat.gcd (x^2 + x + 1) (x^2 - x + 1) = 1 := by
    …
  9. lemma Usa2008P1.k_coprime_with_product kₙ₊₁ is coprime to the product k₀...kₙ line 96 source

    Source comment

    kₙ₊₁ is coprime to the product k₀...kₙ

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

    Statement uses: Nat, Nat.Coprime, Finset.prod, Fin, HAdd.hAdd, OfNat.ofNat, Finset.univ, Usa2008P1.kseq

    Proof uses: Eq.mpr, HPow.hPow, Usa2008P1.xseq, id, Eq, congrArg, Usa2008P1.main_identity, HSub.hSub, Usa2008P1.kseq_succ_eq, Nat.gcd, propext, Nat.coprime_iff_gcd_eq_one, Usa2008P1.gcd_quad_identity_nat

    18 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

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

    lemma k_coprime_with_product (n : ℕ) :
        Nat.Coprime (∏ i : Fin (n + 1), kseq ↑i) (kseq (n + 1)) := by
    …

    Mentions: Usa2008P1.kseq

  10. lemma Usa2008P1.k_are_coprime Show the main coprime lemma Strategy: kⱼ is coprime to product P := k₀...kⱼ₋₁, and kseq i divides that product line 103 source

    Source comment

    Show the main coprime lemma Strategy: kⱼ is coprime to product P := k₀...kⱼ₋₁, and kseq i divides that product

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

    Statement uses: Nat, LT.lt, Nat.Coprime, Usa2008P1.kseq

    Proof uses: Eq, HAdd.hAdd, OfNat.ofNat, Exists, Exists.intro, HSub.hSub, Finset.prod, Fin, Finset.univ, Dvd.dvd, Finset.dvd_prod_of_mem, Fin.mk, Finset.mem_univ, Usa2008P1.k_coprime_with_product, Nat.Coprime.coprime_dvd_left, Eq.symm

    15 instances, coercions and auxiliary constants left out.

    Tactic trace: 8 steps

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

    lemma k_are_coprime (i j : ℕ) (hij: i < j) : Nat.Coprime (kseq i) (kseq j) := by
    …

    Mentions: Usa2008P1.kseq

  11. problem Usa2008P1.usa2008_p1 line 113 source

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

    Statement uses: Nat, LT.lt, OfNat.ofNat, Exists, Fin, HAdd.hAdd, And, Ne, Nat.Coprime, Eq, Finset.prod, Finset.univ, HMul.hMul

    Proof uses: Exists.intro, Usa2008P1.kseq, And.intro, Usa2008P1.k_greater_than_one, Function.Injective.ne, Fin.val_injective, Or, lt_or_gt_of_ne, Usa2008P1.k_are_coprime, Nat.Coprime.symm, Usa2008P1.xseq, Eq.mpr, HPow.hPow, id, congrArg, Usa2008P1.main_identity, Mathlib.Tactic.Ring.of_eq, Nat.rawCast, Mathlib.Tactic.Ring.Common.add_congr, Mathlib.Tactic.Ring.Common.pow_congr and 27 more

    39 instances, coercions and auxiliary constants left out.

    Tactic trace: 17 steps

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