Compfiles/Imo1991P3.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
22 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1991, Problem 3
Let S = {1, 2, ..., 280}. Find the smallest natural number n such that every n-element subset of S contains five numbers which are pairwise relatively prime.
Imports (2)
Imported by 1 file
- determine
Imo1991P3.solutionline 26 sourceno axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
- def
Imo1991P3.badSetThe elements of{1, ..., 280}divisible by2,3,5or7line 32 sourceSource documentation
The elements of
{1, ..., 280}divisible by2,3,5or7. Among any five of them, two share a common prime factor.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Finset.filter,Or,Dvd.dvd,OfNat.ofNat,Finset.Icc6 instances, coercions and auxiliary constants left out.
def badSet : Finset ℕ := (Finset.Icc 1 280).filter fun x => 2 ∣ x ∨ 3 ∣ x ∨ 5 ∣ x ∨ 7 ∣ x
- def
Imo1991P3.coprimeSet11together with all primes in{1, ..., 280}; pairwise coprime line 35 sourceSource documentation
1together with all primes in{1, ..., 280}; pairwise coprime.standard axioms: Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Insert.insert,OfNat.ofNat,Singleton.singleton4 instances, coercions and auxiliary constants left out.
def coprimeSet1 : Finset ℕ := …
- def
Imo1991P3.coprimeSet2{2·41, 3·37, 5·31, 7·29, 11·23, 13·19}; pairwise coprime line 42 sourceSource documentation
{2·41, 3·37, 5·31, 7·29, 11·23, 13·19}; pairwise coprime.standard axioms: Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Insert.insert,OfNat.ofNat,Singleton.singleton4 instances, coercions and auxiliary constants left out.
def coprimeSet2 : Finset ℕ := {82, 111, 155, 203, 253, 247} - def
Imo1991P3.coprimeSet3{2·37, 3·31, 5·29, 7·23, 11·19, 13·17}; pairwise coprime line 45 sourceSource documentation
{2·37, 3·31, 5·29, 7·23, 11·19, 13·17}; pairwise coprime.standard axioms: Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Insert.insert,OfNat.ofNat,Singleton.singleton4 instances, coercions and auxiliary constants left out.
def coprimeSet3 : Finset ℕ := {74, 93, 145, 161, 209, 221} - def
Imo1991P3.coprimeSet4{2·31, 3·29, 5·23, 7·19, 11·17, 13·13}; pairwise coprime line 48 sourceSource documentation
{2·31, 3·29, 5·23, 7·19, 11·17, 13·13}; pairwise coprime.standard axioms: Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Insert.insert,OfNat.ofNat,Singleton.singleton4 instances, coercions and auxiliary constants left out.
def coprimeSet4 : Finset ℕ := {62, 87, 115, 133, 187, 169} - def
Imo1991P3.coprimeSet5{2·29, 3·23, 5·19, 7·17, 11·13}; pairwise coprime line 51 sourceSource documentation
{2·29, 3·23, 5·19, 7·17, 11·13}; pairwise coprime.standard axioms: Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Insert.insert,OfNat.ofNat,Singleton.singleton4 instances, coercions and auxiliary constants left out.
def coprimeSet5 : Finset ℕ := {58, 69, 95, 119, 143} - def
Imo1991P3.coprimeSet6{2·23, 3·19, 5·17, 7·13, 11·11}; pairwise coprime line 54 sourceSource documentation
{2·23, 3·19, 5·17, 7·13, 11·11}; pairwise coprime.standard axioms: Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Insert.insert,OfNat.ofNat,Singleton.singleton4 instances, coercions and auxiliary constants left out.
def coprimeSet6 : Finset ℕ := {46, 57, 85, 91, 121} - def
Imo1991P3.bigUnionThe union of the six pairwise coprime families, all inside{1, ..., 280}line 57 sourceSource documentation
The union of the six pairwise coprime families, all inside
{1, ..., 280}.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Union.union, Imo1991P3.coprimeSet1, Imo1991P3.coprimeSet2, Imo1991P3.coprimeSet3, Imo1991P3.coprimeSet4, Imo1991P3.coprimeSet5, Imo1991P3.coprimeSet62 instances, coercions and auxiliary constants left out.
def bigUnion : Finset ℕ := …
- lemma
Imo1991P3.bigUnion_cardline 61 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat,Finset.card, Imo1991P3.bigUnion,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl3 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.bigUnion_subsetline 64 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.bigUnion,Finset.Icc,OfNat.ofNatProof uses:
of_decide_eq_true,id,Eq,Bool,Decidable.decide,Bool.true,Eq.refl13 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.coprimeSet1_pairwiseline 67 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.coprimeSet1,Ne,Eq,Nat.gcd,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.coprimeSet2_pairwiseline 70 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.coprimeSet2,Ne,Eq,Nat.gcd,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.coprimeSet3_pairwiseline 73 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.coprimeSet3,Ne,Eq,Nat.gcd,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.coprimeSet4_pairwiseline 76 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.coprimeSet4,Ne,Eq,Nat.gcd,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.coprimeSet5_pairwiseline 79 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.coprimeSet5,Ne,Eq,Nat.gcd,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.coprimeSet6_pairwiseline 82 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.coprimeSet6,Ne,Eq,Nat.gcd,OfNat.ofNatProof uses:
of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.five_of_subsetIfP ∩ Thas at least5elements and the elements ofPare pairwise coprime, thenTcontains five pairwise coprime numbers line 87 sourceSource documentation
If
P ∩ Thas at least5elements and the elements ofPare pairwise coprime, thenTcontains five pairwise coprime numbers.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LE.le,OfNat.ofNat,Finset.card,Inter.inter,Membership.mem,Ne,Eq,Nat.gcd,Exists,And,Set.Pairwise,Nat.CoprimeProof uses:
Finset.exists_subset_card_eq,Exists.intro,And.intro,And.right,Iff.mp,Finset.mem_inter,Set,And.left,Eq.mp,congrArg,propext,Finset.mem_coe23 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma five_of_subset {T P : Finset ℕ} (h : 5 ≤ (P ∩ T).card) (hp : ∀ a ∈ P, ∀ b ∈ P, a ≠ b → Nat.gcd a b = 1) : ∃ U ⊆ T, U.card = 5 ∧ (U : Set ℕ).Pairwise Nat.Coprime := by … - def
Imo1991P3.smallPrimeFactorA prime in{2, 3, 5, 7}dividingx, whenever one exists line 97 sourceSource documentation
A prime in
{2, 3, 5, 7}dividingx, whenever one exists.standard axioms: propext what this means
Statement uses:
NatProof uses:
ite,Dvd.dvd,OfNat.ofNat3 instances, coercions and auxiliary constants left out.
def smallPrimeFactor (x : ℕ) : ℕ := if 2 ∣ x then 2 else if 3 ∣ x then 3 else if 5 ∣ x then 5 else 7
- lemma
Imo1991P3.smallPrimeFactor_memline 99 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset,Insert.insert,OfNat.ofNat,Singleton.singleton, Imo1991P3.smallPrimeFactorProof uses:
id,dite,ite,Dvd.dvd,Eq.mpr,Eq,congrArg,ite_eq_left,of_eq_true,Eq.trans,Or,True,False,congr,eq_self,eq_false_of_decide,Eq.refl,Bool,Bool.false,or_selfand 4 more17 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- lemma
Imo1991P3.smallPrimeFactor_dvdline 103 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset, Imo1991P3.badSet,Dvd.dvd, Imo1991P3.smallPrimeFactorProof uses:
And,Finset.Icc,OfNat.ofNat,Or,Iff.mp,Finset.filter,Finset.mem_filter,id,dite,ite,Eq.mpr,Eq,congrFun',congrArg,ite_eq_left,Not,ite_eq_right,And.right,absurd12 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
- problem
Imo1991P3.imo1991_p3line 118 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsLeast,Nat,Set.ofPred,Finset,LE.le,Finset.Icc,OfNat.ofNat,Eq,Finset.card,Exists,And,Set.Pairwise,Nat.Coprime, Imo1991P3.solutionProof uses:
Eq.mpr,id,congrArg,rfl,And.intro,Membership.mem,Set,lowerBounds,SDiff.sdiff,HSub.hSub,Finset.card_sdiff_of_subset,Eq.refl,Inter.inter, Imo1991P3.bigUnion,HAdd.hAdd,Finset.card_inter_add_card_sdiff,Eq.symm,Finset.card_le_card,Not,propextand 55 more61 instances, coercions and auxiliary constants left out.
Tactic trace: 71 steps
Open to load the checked before-and-after goal states.