Compfiles/Usa2018P3.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
19 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 2018, Problem 3
Let n ≥ 2 be an integer, and let {a₁, ..., aₘ} denote the m = φ(n) integers less than n and relatively prime to n. Assume that every prime divisor of m also divides n. Prove that m divides a₁ᵏ + ⋯ + aₘᵏ for every positive integer k.
Imports (5)
Imported by 1 file
- def
Usa2018P3.coprimeSetThe set of integers in[0, n)that are coprime tonline 33 sourceSource documentation
The set of integers in
[0, n)that are coprime ton. Forn ≥ 2this is the set{a₁, ..., aₘ}of the problem statement.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,FinsetProof uses:
Finset.filter,Nat.Coprime,Finset.range1 instances, coercions and auxiliary constants left out.
def coprimeSet (n : ℕ) : Finset ℕ := (Finset.range n).filter (Nat.Coprime n)
- def
Usa2018P3.powSumThe sum of thek-th powers of the elements ofcoprimeSet nline 36 sourceSource documentation
The sum of the
k-th powers of the elements ofcoprimeSet n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Finset.sum, Usa2018P3.coprimeSet,HPow.hPow5 instances, coercions and auxiliary constants left out.
def powSum (n k : ℕ) : ℕ := ∑ a ∈ coprimeSet n, a ^ k
Mentions: Usa2018P3.coprimeSet
- lemma
Usa2018P3.mem_coprimeSetline 38 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Iff,Membership.mem,Finset, Usa2018P3.coprimeSet,And,LT.lt,Nat.CoprimeProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,Finset.filter,Finset.range,iff_self9 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2018P3.coprimeSet_cardline 41 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.card, Usa2018P3.coprimeSet,Nat.totientProof uses:
Eq.symm,Finset.filter,Nat.Coprime,Finset.range,Nat.totient_eq_card_coprime1 instances, coercions and auxiliary constants left out.
- lemma
Usa2018P3.one_mem_coprimeSetline 44 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Membership.mem,Finset, Usa2018P3.coprimeSetProof uses:
Eq.mpr,And,LT.lt,Nat.Coprime,id,Eq,congrArg,propext, Usa2018P3.mem_coprimeSet,And.intro,Nat.coprime_one_right10 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2018P3.powSum_posline 48 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,LT.lt, Usa2018P3.powSumProof uses:
Membership.mem,Finset, Usa2018P3.coprimeSet, Usa2018P3.one_mem_coprimeSet,Trans.trans,HPow.hPow,of_eq_true,Eq.trans,Eq,True,congrArg,one_pow,eq_self,Finset.single_le_sum,Nat.zero_le33 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2018P3.powSum_zeroline 53 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq, Usa2018P3.powSum,OfNat.ofNat,Nat.totientProof uses:
Finset.sum, Usa2018P3.coprimeSet,HPow.hPow,Finset.sum_congr,rfl,Finset,Membership.mem,pow_zero,Eq.mpr,id,congrArg,Usa2018P3.powSum.eq_1,HSMul.hSMul,Finset.card,Finset.sum_const,HMul.hMul,smul_eq_mul,mul_one, Usa2018P3.coprimeSet_card,Eq.refl21 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2018P3.coprime_mod_left'Coprimality is preserved when taking a value modulo the left argument line 59 sourceSource documentation
Coprimality is preserved when taking a value modulo the left argument.
standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Nat.Coprime,HMod.hModProof uses:
Eq,HAdd.hAdd,HMul.hMul,HDiv.hDiv,Nat.mod_add_div,Iff.mp,Nat.coprime_add_mul_left_right,Eq.mp,congrArg,Eq.symm10 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma coprime_mod_left' {m x : ℕ} (h : Nat.Coprime m x) : Nat.Coprime m (x % m) := by …Mentions: h
- lemma
Usa2018P3.add_mul_injThe map(a, h) ↦ a + n * his injective whena, a' < nline 65 sourceSource documentation
The map
(a, h) ↦ a + n * his injective whena, a' < n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,Eq,HAdd.hAdd,HMul.hMul,AndProof uses:
HMod.hMod,congrArg,OfNat.ofNat,Eq.mp,Nat.mod_eq_of_lt,Nat.add_mul_mod_self_left,And.intro,Nat.eq_of_mul_eq_mul_left15 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma add_mul_inj {n a h a' h' : ℕ} (ha : a < n) (ha' : a' < n) (heq : a + n * h = a' + n * h') : a = a' ∧ h = h' := by …Mentions: h
- lemma
Usa2018P3.powSum_mul_prime_of_dvdKey identity, caseq ∣ n: the reduced residues modn*qare exactly{a + n*h | a ∈ coprimeSet n, h < q}line 76 sourceSource documentation
Key identity, case
q ∣ n: the reduced residues modn*qare exactly{a + n*h | a ∈ coprimeSet n, h < q}.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Nat.Prime,Dvd.dvd,Eq, Usa2018P3.powSum,HMul.hMul,Finset.sum, Usa2018P3.coprimeSet,Finset.range,HPow.hPow,HAdd.hAddProof uses:
LT.lt,Nat.Prime.pos,Finset,Finset.image,Prod,Prod.fst,Prod.snd,SProd.sprod,Finset.ext,Iff.intro,Membership.mem,Nat.Coprime,And,Eq.mp,congrArg,propext, Usa2018P3.mem_coprimeSet,Eq.mpr,Exists,idand 49 more54 instances, coercions and auxiliary constants left out.
Tactic trace: 43 steps
Open to load the checked before-and-after goal states.
lemma powSum_mul_prime_of_dvd {n q : ℕ} (hn : 2 ≤ n) (hq : q.Prime) (hqd : q ∣ n) (k : ℕ) : powSum (n * q) k = ∑ a ∈ coprimeSet n, ∑ h ∈ Finset.range q, (a + n * h) ^ k := by …Mentions: Usa2018P3.powSum, Usa2018P3.coprimeSet, h
- lemma
Usa2018P3.powSum_mul_prime_of_not_dvdKey identity, caseq ∤ n: the reduced residues modn*qare{a + n*h | a ∈ coprimeSet n, h < q}with the multiplesq * aremoved line 127 sourceSource documentation
Key identity, case
q ∤ n: the reduced residues modn*qare{a + n*h | a ∈ coprimeSet n, h < q}with the multiplesq * aremoved.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Nat.Prime,Not,Dvd.dvd,Eq,HAdd.hAdd, Usa2018P3.powSum,HMul.hMul,HPow.hPow,Finset.sum, Usa2018P3.coprimeSet,Finset.rangeProof uses:
LT.lt,Nat.Prime.pos,Nat.Coprime,Iff.mp,Nat.coprime_comm,Iff.mpr,Nat.Prime.coprime_iff_not_dvd,Finset,Finset.image,Prod,Prod.fst,Prod.snd,SProd.sprod,Union.union,Finset.ext,Iff.intro,Membership.mem,And,Exists,Eq.mpand 80 more75 instances, coercions and auxiliary constants left out.
Tactic trace: 86 steps
Open to load the checked before-and-after goal states.
lemma powSum_mul_prime_of_not_dvd {n q : ℕ} (hn : 2 ≤ n) (hq : q.Prime) (hqd : ¬ q ∣ n) (k : ℕ) : powSum (n * q) k + q ^ k * powSum n k = ∑ a ∈ coprimeSet n, ∑ h ∈ Finset.range q, (a + n * h) ^ k := by …Mentions: Usa2018P3.powSum, Usa2018P3.coprimeSet, h
- lemma
Usa2018P3.sum_add_pow_eqBinomial expansion of the double sum line 223 sourceSource documentation
Binomial expansion of the double sum.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum, Usa2018P3.coprimeSet,Finset.range,HPow.hPow,HAdd.hAdd,HMul.hMul, Usa2018P3.powSum,Nat.choose,OfNat.ofNat,HSub.hSubProof uses:
Eq.mpr,id,congrArg,add_comm,add_pow,Finset.sum_congr,rfl,Finset,Membership.mem,Nat.cast_id,Eq.refl,Finset.mul_sum,mul_pow,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,Mathlib.Tactic.Ring.Common.mul_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,Eq.symm,Mathlib.Tactic.Ring.Common.pow_addand 38 more65 instances, coercions and auxiliary constants left out.
Tactic trace: 25 steps
Open to load the checked before-and-after goal states.
lemma sum_add_pow_eq (n q k : ℕ) : ∑ a ∈ coprimeSet n, ∑ h ∈ Finset.range q, (a + n * h) ^ k = q * powSum n k + ∑ j ∈ Finset.range k, (k.choose (j + 1)) * (n ^ (j + 1) * powSum n (k - (j + 1)) * ∑ h ∈ Finset.range q, h ^ (j + 1)) := by …Mentions: Usa2018P3.coprimeSet, h, Usa2018P3.powSum
- lemma
Usa2018P3.pow_pred_dvd_powSum_prime_powThe prime power case:p^(e-1) ∣ powSum (p^e) kline 286 sourceSource documentation
The prime power case:
p^(e-1) ∣ powSum (p^e) k.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LE.le,OfNat.ofNat,Dvd.dvd,HPow.hPow,HSub.hSub, Usa2018P3.powSumProof uses:
Nat.le_induction,one_dvd,le_trans,Nat.Prime.two_le,Nat.le_self_pow,dvd_pow_self,Eq,HMul.hMul,Finset.sum, Usa2018P3.coprimeSet,Finset.range,HAdd.hAdd, Usa2018P3.powSum_mul_prime_of_dvd,Eq.mpr,id,congrArg,pow_succ,Nat.choose,Eq.mp, Usa2018P3.sum_add_pow_eq and 16 more41 instances, coercions and auxiliary constants left out.
Tactic trace: 29 steps
Open to load the checked before-and-after goal states.
lemma pow_pred_dvd_powSum_prime_pow {p : ℕ} (hp : p.Prime) : ∀ e : ℕ, 1 ≤ e → ∀ k : ℕ, p ^ (e - 1) ∣ powSum (p ^ e) k := by …Mentions: Usa2018P3.powSum
- lemma
Usa2018P3.sum_range_pow_eq_sum_IccHelper:∑ h ∈ range q, h^(j+1) = ∑ h ∈ Icc 1 (q-1), h^(j+1)line 319 sourceSource documentation
Helper:
∑ h ∈ range q, h^(j+1) = ∑ h ∈ Icc 1 (q-1), h^(j+1).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum,Finset.range,HPow.hPow,HAdd.hAdd,OfNat.ofNat,Finset.Icc,HSub.hSubProof uses:
GT.gt,Or,Nat.eq_zero_or_pos,of_eq_true,Eq.trans,True,congrArg,Finset.sum_congr,EmptyCollection.emptyCollection,Finset,zero_tsub,Finset.Icc_eq_empty_of_lt,LT.lt,eq_self,Membership.mem,Eq.refl,Eq.symm,Nat.succ,Exists,Nat.exists_eq_succ_of_ne_zeroand 14 more71 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
lemma sum_range_pow_eq_sum_Icc (q j : ℕ) : ∑ h ∈ Finset.range q, h ^ (j + 1) = ∑ h ∈ Finset.Icc 1 (q - 1), h ^ (j + 1) := by …Mentions: h
- lemma
Usa2018P3.pow_pred_dvd_sum_pow_IccCorollary:p^(c-1) ∣ 1^j + ⋯ + t^jwhenp^c ∣ t,c ≥ 1,j ≥ 1line 334 sourceSource documentation
Corollary:
p^(c-1) ∣ 1^j + ⋯ + t^jwhenp^c ∣ t,c ≥ 1,j ≥ 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LE.le,OfNat.ofNat,Dvd.dvd,HPow.hPow,HSub.hSub,Finset.sum,Finset.IccProof uses:
Nat.le_induction,one_dvd,HAdd.hAdd,Eq.mpr,id,Eq,congrArg,Nat.add_sub_cancel,LT.lt,Nat.Prime.pos,rfl,Eq.rec,pow_pos,Eq.symm,HDiv.hDiv,HMul.hMul,Nat.mul_div_cancel',Eq.mp,Finset.filter,Notand 133 more126 instances, coercions and auxiliary constants left out.
Tactic trace: 184 steps
Open to load the checked before-and-after goal states.
lemma pow_pred_dvd_sum_pow_Icc {p : ℕ} (hp : p.Prime) : ∀ c : ℕ, 1 ≤ c → ∀ t : ℕ, p ^ c ∣ t → ∀ j : ℕ, 1 ≤ j → p ^ (c - 1) ∣ ∑ h ∈ Finset.Icc 1 t, h ^ j := by …Mentions: h
- lemma
Usa2018P3.padicValNat_totient_mul_prime_of_dvdline 512 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Ne,OfNat.ofNat,Dvd.dvd,Eq,padicValNat,Nat.totient,HMul.hMulProof uses:
Fact,Fact.mk,rfl,LE.le,one_le_padicValNat_of_dvd,HPow.hPow,pow_padicValNat_dvd,HDiv.hDiv,Eq.symm,Nat.mul_div_cancel',Eq.mp,congrArg,MulZeroClass.mul_zero,Not,HAdd.hAdd,Eq.mpr,id,pow_succ,mul_dvd_mul_left,pow_succ_padicValNat_not_dvdand 41 more54 instances, coercions and auxiliary constants left out.
Tactic trace: 41 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2018P3.padicValNat_totient_mul_prime_of_not_dvdline 559 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Ne,OfNat.ofNat,Not,Dvd.dvd,Eq,padicValNat,Nat.totient,HMul.hMul,HAdd.hAdd,HSub.hSubProof uses:
Fact,Fact.mk,Nat.Coprime,Nat.Coprime.symm,Iff.mpr,Nat.Prime.coprime_iff_not_dvd,LE.le,Nat.Prime.two_le,Eq.mpr,id,congrArg,Nat.totient_mul,Nat.totient_prime,padicValNat.mul,LT.lt.ne',LT.lt,Nat.totient_pos,Nat.pos_of_ne_zero,Eq.refl20 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Usa2018P3.pow_padicValNat_totient_dvd_powSumThe main claim: forpprime withp ∣ n,p ^ ν_p (φ n) ∣ powSum n kline 572 sourceSource documentation
The main claim: for
pprime withp ∣ n,p ^ ν_p (φ n) ∣ powSum n k.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LE.le,OfNat.ofNat,Dvd.dvd,HPow.hPow,padicValNat,Nat.totient, Usa2018P3.powSumProof uses:
Fact,Fact.mk,Nat.strong_induction_on,LT.lt,Nat.casesAuxOn,Eq.mpr,id,Eq,congrArg, Usa2018P3.powSum_zero,pow_padicValNat_dvd,Ne,rfl,one_le_padicValNat_of_dvd,HDiv.hDiv,HMul.hMul,Eq.symm,Nat.mul_div_cancel',Decidable.byContradiction,Notand 118 more106 instances, coercions and auxiliary constants left out.
Tactic trace: 155 steps
Open to load the checked before-and-after goal states.
lemma pow_padicValNat_totient_dvd_powSum {p : ℕ} (hp : p.Prime) : ∀ n : ℕ, 2 ≤ n → p ∣ n → ∀ k : ℕ, p ^ padicValNat p (Nat.totient n) ∣ powSum n k := by …Mentions: Usa2018P3.powSum
- problem
Usa2018P3.usa2018_p3line 732 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Nat.Prime,Dvd.dvd,Nat.totient,Finset.sum,Finset.filter,Nat.Coprime,Finset.range,HPow.hPowProof uses:
Ne,LT.lt.ne',Iff.mpr,LT.lt,Nat.totient_pos, Usa2018P3.powSum, Usa2018P3.powSum_pos,id,Eq.mpr,Finsupp,Nat.factorization,Eq,congrArg,Eq.symm,propext,Nat.factorization_prime_le_iff_dvd,Fact,Fact.mk,padicValNat,Nat.factorization_defand 9 more26 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.