Compfiles/Imo1998P3.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
13 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1998, Problem 3
For any positive integer $n$, let $d(n)$ denote the number of positive divisors of $n$ (including 1 and $n$ itself). Determine all positive integers $k$ such that $d(n^2)/d(n) = k$ for some $n$.
Imports (6)
Imported by 1 file
- determine
Imo1998P3.solution_setline 31 sourceno axioms what this means
Statement uses:
Set,NatProof uses:
Set.ofPred,Exists,Eq,HAdd.hAdd,HMul.hMul,OfNat.ofNat5 instances, coercions and auxiliary constants left out.
- def
Imo1998P3.dDefined(n), the function counting the number of positive divisors ofnline 125 sourceSource documentation
Define
d(n), the function counting the number of positive divisors ofn.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Finset.card,Nat.divisorsdef d (n : ℕ) : ℕ := (Nat.divisors n).card
- lemma
Imo1998P3.d_multiplicativeProof thatdis multiplicative line 128 sourceSource documentation
Proof that
dis multiplicative.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Coprime,Eq, Imo1998P3.d,HMul.hMulProof uses:
Nat.Coprime.card_divisors_mul2 instances, coercions and auxiliary constants left out.
lemma d_multiplicative (m n : ℕ) (h : Nat.Coprime m n) : d (m * n) = d m * d n := …
Mentions: h, Imo1998P3.d
- lemma
Imo1998P3.prime_power_divisorsProof thatd(pᵏ) = k + 1forpprime line 132 sourceSource documentation
Proof that
d(pᵏ) = k + 1forpprime.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Eq, Imo1998P3.d,HPow.hPow,HAdd.hAdd,OfNat.ofNatProof uses:
id,Eq.mpr,Finset.card,Nat.divisors,Finset.map,Function.Embedding.mk,Nat.pow_right_injective,Nat.Prime.two_le,Finset.range,congrArg,Finset,Nat.divisors_prime_pow,Finset.card_map,of_eq_true,Eq.trans,True,congrFun',Finset.card_range,eq_self15 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma prime_power_divisors {p k : ℕ} (hp : p.Prime) : d (p ^ k) = k + 1 := by …Mentions: Imo1998P3.d
- lemma
Imo1998P3.d_eq_dComputedProof thatd n = ∏ᵢ(kᵢ + 1)wheren = ∏ᵢpᵢᵏᵢ(prime factorization), using the fact thatdis multiplicative andd(pᵏ) = k + 1forpprime line 142 sourceSource documentation
Proof that
d n = ∏ᵢ(kᵢ + 1)wheren = ∏ᵢpᵢᵏᵢ(prime factorization), using the fact thatdis multiplicative andd(pᵏ) = k + 1forpprime.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne,OfNat.ofNat,Eq, Imo1998P3.d,Finsupp.prod,Nat.factorization,HAdd.hAddProof uses:
Or,eq_or_ne,absurd,Eq.refl,Eq.symm,Eq.mpr,HPow.hPow,id,congrArg,Nat.multiplicative_factorization, Imo1998P3.d_multiplicative,of_eq_true,Eq.trans,True,congrFun',Finset.card,Nat.divisors,Singleton.singleton,Finset,Nat.divisors_oneand 8 more28 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma d_eq_dComputed (n : ℕ) (hn : n ≠ 0) : d n = n.factorization.prod (fun _ k ↦ k + 1) := by …
Mentions: Imo1998P3.d
- lemma
Imo1998P3.d_n2Proof thatd(n²) = ∏ᵢ(2kᵢ + 1)forn = ∏ᵢpᵢᵏᵢ(prime factorization) line 151 sourceSource documentation
Proof that
d(n²) = ∏ᵢ(2kᵢ + 1)forn = ∏ᵢpᵢᵏᵢ(prime factorization).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne,OfNat.ofNat,Eq, Imo1998P3.d,HPow.hPow,Finsupp.prod,Nat.factorization,HAdd.hAdd,HMul.hMulProof uses:
Eq.mpr,id,congrArg, Imo1998P3.d_eq_dComputed,pow_ne_zero,HSMul.hSMul,Finsupp,Nat.factorization_pow,Finset.prod_congr,Finsupp.support,Finsupp.support_smul_eq,two_ne_zero,of_eq_true,Membership.mem,Finset,Nat.primeFactors,Eq.trans,True,forall_congr,Andand 6 more63 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma d_n2 (n : ℕ) (hn : n ≠ 0) : d (n ^ 2) = n.factorization.prod (fun _ k ↦ 2 * k + 1) := by …
Mentions: Imo1998P3.d
- lemma
Imo1998P3.list_prod_oddProof that if every number in a list is odd, the product of the list is odd line 159 sourceSource documentation
Proof that if every number in a list is odd, the product of the list is odd.
standard axioms: Quot.sound, propext what this means
Statement uses:
List,Nat,Membership.mem,Odd,List.prodProof uses:
List.rec,of_eq_true,List.nil,OfNat.ofNat,Eq.trans,True,implies_congr,forall_congr,False,Eq.refl,implies_true,List.cons,Odd.mul,List.Mem.head,List.Mem.tail18 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma list_prod_odd (l : List ℕ) : (∀ x ∈ l, Odd x) → Odd l.prod := by …
- theorem
Imo1998P3.k_is_oddWe begin by first proving that every value ofkmust be an odd number line 165 sourceSource documentation
We begin by first proving that every value of
kmust be an odd number.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Exists,And,Ne,OfNat.ofNat,Eq, Imo1998P3.d,HPow.hPow,HMul.hMul,HMod.hModProof uses:
Odd,Eq.mpr,Finsupp.prod,Nat.factorization,HAdd.hAdd,id,congrArg, Imo1998P3.d_n2,Finset.prod,Finsupp.support,Finsupp,Finsupp.prod.eq_1,Finset.prod_induction,Odd.mul,odd_one,Membership.mem,Finset,of_eq_true,Even,Iff.mpand 4 more50 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
theorem k_is_odd (k : ℕ) (h : ∃ n : ℕ, n ≠ 0 ∧ d (n ^ 2) = k * d n) : (k % 2 = 1) := by …Mentions: h, Imo1998P3.d
- lemma
Imo1998P3.exists_distinct_primesProof that we can picktnew and distinct primes given a list oftprimes line 177 sourceSource documentation
Proof that we can pick
tnew and distinct primes given a list oftprimes.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne,OfNat.ofNat,List,Exists,And,Membership.mem,Nat.Prime,Not,Nat.Coprime,Eq,List.length,List.NodupProof uses:
Nat.recAux,Exists.intro,List.nil,of_eq_true,Eq.trans,True,congr,congrArg,forall_congr,False,implies_congr,Eq.refl,implies_true,eq_self,and_self,HAdd.hAdd,HAppend.hAppend,List.cons,List.concat_ne_nil,List.maxand 76 more78 instances, coercions and auxiliary constants left out.
Tactic trace: 52 steps
Open to load the checked before-and-after goal states.
lemma exists_distinct_primes (t n : ℕ) (hnneq0 : n ≠ 0) (primes : List ℕ) : (∃ l : List ℕ, (∀ i ∈ l, Nat.Prime i ∧ i ∉ primes ∧ Nat.Coprime i n) ∧ List.length l = t ∧ List.Nodup l) := by … - lemma
Imo1998P3.repeated_multiplicity_of_dProof thatd(∏ᵢxᵢ) = ∏ᵢd(xᵢ)for coprimexᵢ's (repeated mulitiplicity) line 232 sourceSource documentation
Proof that
d(∏ᵢxᵢ) = ∏ᵢd(xᵢ)for coprimexᵢ's (repeated mulitiplicity).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
List,Nat,List.Pairwise,Nat.Coprime,Eq, Imo1998P3.d,List.prod,List.mapProof uses:
List.rec,List.nil,of_eq_true,Eq.trans,OfNat.ofNat,True,congr,congrArg,Finset.card,Nat.divisors,Singleton.singleton,Finset,Nat.divisors_one,Finset.card_singleton,List.map_nil,eq_self,List.cons,Membership.mem,And,Eq.mpand 10 more10 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
lemma repeated_multiplicity_of_d (l : List ℕ) (hcoprime : l.Pairwise Nat.Coprime) : d (l.prod) = (List.map (fun i ↦ d i) l).prod := by …Mentions: Imo1998P3.d
- lemma
Imo1998P3.d_of_factorizationProof thatd(∏ᵢpᵢᵏᵢ) = ∏ᵢ(kᵢ + 1)line 249 sourceSource documentation
Proof that
d(∏ᵢpᵢᵏᵢ) = ∏ᵢ(kᵢ + 1). Intuitively, we knowpsandexpsform a factorization ofx, but Lean doesn't know this, so we have to give this lemma all the properties ofx's factorization without explicitly saying so.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,List,Eq,List.length,Membership.mem,Nat.Prime,List.Nodup,GT.gt,OfNat.ofNat, Imo1998P3.d,List.prod,List.map,Prod,Imo1998P3.d_of_factorization.match_1,HPow.hPow,List.zip,HAdd.hAddProof uses:
Eq.mpr,Prod.fst,Prod.snd,id,congrArg, Imo1998P3.repeated_multiplicity_of_d,List.Nodup.pairwise_of_forall_ne,Nat.Coprime,List.Pairwise,Ne,propext,List.nodup_iff_pairwise_ne,List.pairwise_map,List.Pairwise.imp_of_mem,Prod.mk,And.left,List.of_mem_zip,And.right,dite,Notand 52 more43 instances, coercions and auxiliary constants left out.
Tactic trace: 123 steps
Open to load the checked before-and-after goal states.
lemma d_of_factorization (t : ℕ) (ps exps : List ℕ) (hlen : ps.length = exps.length) (hlent : exps.length = t) (hallprime : ∀ i ∈ ps, Nat.Prime i) (hpsnodups : List.Nodup ps) (hexpsgt0 : ∀ i ∈ exps, i > 0) : d ((ps.zip exps).map (fun (p, e) ↦ p ^ e)).prod = (List.map (fun i ↦ i + 1) exps).prod := by …Mentions: Imo1998P3.d
- theorem
Imo1998P3.odd_k_satisfiesWe now prove that every odd number satisifies the equation line 361 sourceSource documentation
We now prove that every odd number satisifies the equation.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,HMod.hMod,OfNat.ofNat,Exists,And,Ne, Imo1998P3.d,HPow.hPow,HMul.hMulProof uses:
Nat.strong_induction_on,LT.lt,Nat.casesAuxOn,False.elim,noConfusion_of_Nat,Nat.ctorIdx,HAdd.hAdd,dite,Eq.mpr,id,Exists.intro,congrArg,of_eq_true,Eq.trans,True,congr,congrFun',zero_add,one_pow,one_muland 193 more175 instances, coercions and auxiliary constants left out.
Tactic trace: 213 steps (first 200 of 213)
Open to load the checked before-and-after goal states.
theorem odd_k_satisfies (k : ℕ) (hkodd : k % 2 = 1) : (∃ n : ℕ, n ≠ 0 ∧ d (n ^ 2) = k * d n) := by …Mentions: Imo1998P3.d
- problem
Imo1998P3.imo1998_p3line 573 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Iff,Membership.mem,Set, Imo1998P3.solution_set,Exists,And,Ne,OfNat.ofNat,Eq,Finset.card,Nat.divisors,HPow.hPow,HMul.hMulProof uses:
Iff.intro,HMod.hMod,Iff.mp,Odd,Nat.odd_iff,Iff.mpr,HAdd.hAdd,odd_iff_exists_bit1, Imo1998P3.d, Imo1998P3.odd_k_satisfies,Exists.intro,id, Imo1998P3.k_is_odd33 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.