Compfiles/Usa1998P1.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
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
- lemma
Usa1998P1.zmod_eqline 38 sourceno axioms what this means
Statement uses:
Int,Iff,Int.ModEq,Eq,HMod.hModProof uses:
Iff.rfl2 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1998P1.mod2_absline 40 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Int,Eq,HMod.hMod,abs,OfNat.ofNatProof uses:
And,LE.le,Neg.neg,LT.lt,Or,abs_cases,Eq.mpr,id,congrArg,And.left,Eq.refl,Int.neg_emod_two30 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa1998P1.mod2_diffFor integers M,N we have |M-N| ≡ M-N ≡ M+N MOD 2 line 45 sourceSource 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.hAddProof 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.refl19 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 …
- lemma
Usa1998P1.lemma0line 48 sourcestandard 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.hMulProof 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,Trueand 3 more77 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- problem
Usa1998P1.usa1998_p1ab 0 iis aᵢ andab 1 iisbᵢline 65 sourceSource documentation
ab 0 iis aᵢ andab 1 iisbᵢ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.univProof 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.hAddand 24 more64 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 …