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

5 declarations, 0 contain sorry, 0 declared as axioms

USA Mathematical Olympiad 1998, Problem 1

Suppose that the set { 1, 2, ..., 1998 } has been partitioned into disjoint pairs {aᵢ, bᵢ}, where 1 ≤ i ≤ 999, so that for all i, |aᵢ - bᵢ| = 1 or 6.

Prove that the sum

|a₁ - b₁| + |a₂ - b₂| + ... + |a₉₉₉ - b₉₉₉|

ends in the digit 9.

Imports (6)
Imported by 1 file
  1. lemma Usa1998P1.zmod_eq line 38 source

    no axioms what this means

    Statement uses: Int, Iff, Int.ModEq, Eq, HMod.hMod

    Proof uses: Iff.rfl

    2 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  2. lemma Usa1998P1.mod2_abs line 40 source

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

    Statement uses: Int, Eq, HMod.hMod, abs, OfNat.ofNat

    Proof uses: And, LE.le, Neg.neg, LT.lt, Or, abs_cases, Eq.mpr, id, congrArg, And.left, Eq.refl, Int.neg_emod_two

    30 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

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

  3. lemma Usa1998P1.mod2_diff For integers M,N we have |M-N| ≡ M-N ≡ M+N MOD 2 line 45 source

    Source comment

    For integers M,N we have |M-N| ≡ M-N ≡ M+N MOD 2.

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

    Statement uses: Int, Eq, HMod.hMod, abs, HSub.hSub, OfNat.ofNat, HAdd.hAdd

    Proof uses: Eq.mpr, id, congrArg, Usa1998P1.mod2_abs, Neg.neg, Int.sub_eq_add_neg, Int.add_emod, Int.neg_emod_two, Eq.symm, Eq.refl

    19 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

    lemma mod2_diff (a b : ℤ) : |a - b| % 2 = (a + b) % 2 := by
    …
  4. lemma Usa1998P1.lemma0 line 48 source

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

    Statement uses: Nat, Eq, Int, HMod.hMod, Finset.sum, Finset.Icc, OfNat.ofNat, HAdd.hAdd, HMul.hMul

    Proof uses: Eq.mpr, id, Eq.trans, congr, congrArg, congrFun', Finset.sum_congr, Eq.refl, Finset, Membership.mem, Eq.symm, Nat.cast_one, Nat.recAux, of_eq_true, eq_true_of_decide, Bool, Bool.true, Finset.sum_Icc_succ_top, LE.le, True and 3 more

    77 instances, coercions and auxiliary constants left out.

    Tactic trace: 14 steps

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

  5. problem Usa1998P1.usa1998_p1 ab 0 i is aᵢ and ab 1 i is bᵢ line 65 source

    Source documentation

    ab 0 i is aᵢ and ab 1 i is bᵢ

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

    Statement uses: Fin, OfNat.ofNat, Nat, Subtype, Membership.mem, Finset, Finset.Icc, Function.Bijective, Prod, Function.uncurry, Or, Eq, Int, abs, HSub.hSub, HMod.hMod, Finset.sum, Finset.univ

    Proof uses: Eq.mpr, id, congrArg, Eq.refl, Int.ModEq, propext, Usa1998P1.zmod_eq, Finset.sum_int_mod, Fintype.sum_congr, HSMul.hSMul, Finset.card, Finset.sum_const, Fintype.card, Finset.card_univ, Fintype.card_fin, of_decide_eq_true, Bool, Decidable.decide, Bool.true, HAdd.hAdd and 24 more

    64 instances, coercions and auxiliary constants left out.

    Tactic trace: 34 steps

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

    problem usa1998_p1
        (ab : Fin 2 → Fin 999 → Finset.Icc 1 1998)
        (hab : (ab.uncurry).Bijective)
        (habd : ∀ i : Fin 999,
                  |(ab 0 i : ℤ) - (ab 1 i : ℤ)| = 1 ∨
                  |(ab 0 i : ℤ) - (ab 1 i : ℤ)| = 6) :
        (∑ i : Fin 999, |(ab 0 i : ℤ) - (ab 1 i : ℤ)|) % 10 = 9 := by
    …