Compfiles/Imo2011P1.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
15 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2011, Problem 1
Given any set A = {a₁, a₂, a₃, a₄} of four distinct positive integers, we denote the sum a₁ + a₂ + a₃ + a₄ by s_A. Let n_A denote the number of pairs (i, j) with 1 ≤ i < j ≤ 4 for which a_i + a_j divides s_A. Find all sets A of four distinct positive integers which achieve the largest possible value of n_A.
Imports (2)
Imported by 1 file
- def
Imo2011P1.pairCountThe number of two-element subsets ofAwhose sum divides the sum ofAline 30 sourceSource documentation
The number of two-element subsets of
Awhose sum divides the sum ofA.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,NatProof uses:
Finset.card,Finset.filter,Dvd.dvd,Finset.sum,Finset.powersetCard,OfNat.ofNat4 instances, coercions and auxiliary constants left out.
def pairCount (A : Finset ℕ) : ℕ := …
- determine
Imo2011P1.SolutionSetline 33 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Set,Finset,NatProof uses:
Set.ofPred,Exists,And,LT.lt,OfNat.ofNat,Or,Eq,Insert.insert,HMul.hMul,Singleton.singleton7 instances, coercions and auxiliary constants left out.
- lemma
Imo2011P1.mem_pairline 39 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Finset,Insert.insert,Singleton.singleton,Or,EqProof uses:
Eq.mp,Eq.trans,congrArg12 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2011P1.pair_ne_pairline 42 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Or,And,Ne,Finset,Insert.insert,Singleton.singletonProof uses:
Eq,False,Membership.mem,Eq.mpr,id,congrArg,Eq.symm,of_eq_true,Eq.trans,True,congr,eq_self,true_or, Imo2011P1.mem_pair,rfl,or_true13 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2011P1.not_dvd_betweenA natural number strictly betweenmand2 * mis not divisible bymline 56 sourceSource documentation
A natural number strictly between
mand2 * mis not divisible bym.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,HMul.hMul,OfNat.ofNat,Not,Dvd.dvdProof uses:
absurd,Eq,False,Nat.eq_of_dvd_of_lt_two_mul12 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma not_dvd_between {m s : ℕ} (h1 : m < s) (h2 : s < 2 * m) : ¬ m ∣ s := fun h ↦ …Mentions: h
- lemma
Imo2011P1.pair_mem_powersetCard_twoline 59 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Membership.mem,Ne,Finset.powersetCard,OfNat.ofNat,Insert.insert,Singleton.singletonProof uses:
Iff.mpr,And,LE.le,Eq,Finset.card,Finset.mem_powersetCard,And.intro,Finset.insert_subset,Finset.singleton_subset_iff,Finset.card_pair15 instances, coercions and auxiliary constants left out.
- lemma
Imo2011P1.sum_fourline 64 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,Eq,Finset.sum,Insert.insert,Finset,Singleton.singleton,HAdd.hAddProof uses:
Eq.mpr,id,congrArg,Finset.sum_insert,Not,Membership.mem,Or,Eq.trans,Finset.sum_singleton,Mathlib.Tactic.Ring.of_eq,HMul.hMul,HPow.hPow,Nat.rawCast,OfNat.ofNat,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.Common.add_pf_add_ltand 1 more41 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2011P1.filter_subset_targetThe two-element subsets of{a, b, c, d}whose sum divides the total, viewed insidepairCountline 74 sourceSource documentation
The two-element subsets of
{a, b, c, d}whose sum divides the total, viewed insidepairCount.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,LE.le,Finset,Finset.filter,Dvd.dvd,Finset.sum,Insert.insert,Singleton.singleton,Finset.powersetCard,OfNat.ofNat,SDiff.sdiffProof uses:
Eq,HAdd.hAdd, Imo2011P1.sum_four,Membership.mem,Eq.mpr,And,Not,id,congrArg,propext,Finset.mem_sdiff,And.intro,And.left,Eq.mp,Finset.mem_filter,And.right,Or,False,Finset.mem_singleton,Finset.mem_insertand 3 more39 instances, coercions and auxiliary constants left out.
Tactic trace: 21 steps
Open to load the checked before-and-after goal states.
lemma filter_subset_target {a b c d : ℕ} (hab : a < b) (hbc : b < c) (hcd : c < d) : ((({a, b, c, d} : Finset ℕ).powersetCard 2).filter fun p ↦ (∑ x ∈ p, x) ∣ ∑ x ∈ ({a, b, c, d} : Finset ℕ), x) ⊆ ((({a, b, c, d} : Finset ℕ).powersetCard 2) \ {({b, d} : Finset ℕ), {c, d}}) := by … - lemma
Imo2011P1.card_targetline 92 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,Eq,Finset.card,Finset,SDiff.sdiff,Finset.powersetCard,OfNat.ofNat,Insert.insert,Singleton.singletonProof uses:
LE.le,Finset.insert_subset, Imo2011P1.pair_mem_powersetCard_two,of_eq_true,Membership.mem,Eq.trans,Or,True,congrArg,congr,eq_self,true_or,or_true,Iff.mpr,Finset.singleton_subset_iff,Eq.mpr,HSub.hSub,Inter.inter,id,Finset.card_sdiffand 18 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2011P1.pairCount_le_fourline 112 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,LE.le, Imo2011P1.pairCount,Insert.insert,Finset,Singleton.singleton,OfNat.ofNatProof uses:
Eq.mpr,Finset.card,Finset.filter,Dvd.dvd,Finset.sum,Finset.powersetCard,id,Eq,congrArg,Imo2011P1.pairCount.eq_1,SDiff.sdiff,Eq.symm, Imo2011P1.card_target,Finset.card_le_card, Imo2011P1.filter_subset_target17 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2011P1.dvds_of_four_leIf the count is (at least) 4, then all four candidate pairs divide the sum line 118 sourceSource documentation
If the count is (at least) 4, then all four candidate pairs divide the sum.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,LE.le,OfNat.ofNat, Imo2011P1.pairCount,Insert.insert,Finset,Singleton.singleton,And,Dvd.dvd,HAdd.hAddProof uses:
Eq,Finset.sum, Imo2011P1.sum_four,Finset.filter,Finset.powersetCard,SDiff.sdiff,Finset.eq_of_subset_of_card_le, Imo2011P1.filter_subset_target,le_trans,Finset.card,Eq.mpr,id,congrArg, Imo2011P1.card_target,le_refl,Eq.mp,Imo2011P1.pairCount.eq_1,Membership.mem,Ne,Notand 23 more39 instances, coercions and auxiliary constants left out.
Tactic trace: 42 steps
Open to load the checked before-and-after goal states.
lemma dvds_of_four_le {a b c d : ℕ} (hab : a < b) (hbc : b < c) (hcd : c < d) (h : 4 ≤ pairCount {a, b, c, d}) : (a + b ∣ a + b + c + d) ∧ (a + c ∣ a + b + c + d) ∧ (a + d ∣ a + b + c + d) ∧ (b + c ∣ a + b + c + d) := by …Mentions: h, Imo2011P1.pairCount
- lemma
Imo2011P1.pairCount_eq_fourIf all four candidate pairs divide the sum, the count is exactly 4 line 150 sourceSource documentation
If all four candidate pairs divide the sum, the count is exactly 4.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,Dvd.dvd,HAdd.hAdd,Eq, Imo2011P1.pairCount,Insert.insert,Finset,Singleton.singleton,OfNat.ofNatProof uses:
le_antisymm, Imo2011P1.pairCount_le_four,Finset.sum, Imo2011P1.sum_four,Eq.mpr,LE.le,Finset.card,Finset.filter,Finset.powersetCard,id,congrArg,Imo2011P1.pairCount.eq_1,Membership.mem,And,propext,Finset.mem_filter,And.intro, Imo2011P1.pair_mem_powersetCard_two,Finset.sum_pair,Orand 24 more41 instances, coercions and auxiliary constants left out.
Tactic trace: 67 steps
Open to load the checked before-and-after goal states.
lemma pairCount_eq_four {a b c d : ℕ} (hab : a < b) (hbc : b < c) (hcd : c < d) (h1 : a + b ∣ a + b + c + d) (h2 : a + c ∣ a + b + c + d) (h3 : a + d ∣ a + b + c + d) (h4 : b + c ∣ a + b + c + d) : pairCount {a, b, c, d} = 4 := by …Mentions: Imo2011P1.pairCount
- lemma
Imo2011P1.classifyThe heart of the solution: if all four candidate pairs divide the sum, then the quadruple is(a, 5a, 7a, 11a)or(a, 11a, 19a, 29a)line 198 sourceSource documentation
The heart of the solution: if all four candidate pairs divide the sum, then the quadruple is
(a, 5a, 7a, 11a)or(a, 11a, 19a, 29a).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Dvd.dvd,HAdd.hAdd,Or,And,Eq,HMul.hMulProof uses:
Mathlib.Tactic.Ring.of_eq,HPow.hPow,Nat.rawCast,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.mpr,id,congrArg,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.Common.add_pf_add_lt,Mathlib.Tactic.Ring.Common.add_pf_zero_add,Mathlib.Tactic.Ring.Common.add_pf_add_gt,Mathlib.Tactic.Ring.Common.add_pf_add_zero,Iff.mp,Nat.dvd_add_right,dvd_refl,Eq.mp,Nat.dvd_add_leftand 28 more64 instances, coercions and auxiliary constants left out.
Tactic trace: 62 steps
Open to load the checked before-and-after goal states.
lemma classify {a b c d : ℕ} (ha : 0 < a) (hab : a < b) (hbc : b < c) (h1 : a + b ∣ a + b + c + d) (h2 : a + c ∣ a + b + c + d) (h3 : a + d ∣ a + b + c + d) (h4 : b + c ∣ a + b + c + d) : (b = 5 * a ∧ c = 7 * a ∧ d = 11 * a) ∨ (b = 11 * a ∧ c = 19 * a ∧ d = 29 * a) := by … - lemma
Imo2011P1.exists_sorted_fourAny 4-element finset of naturals can be listed in increasing order line 257 sourceSource documentation
Any 4-element finset of naturals can be listed in increasing order.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Eq,Finset.card,OfNat.ofNat,Exists,And,LT.lt,Insert.insert,Singleton.singletonProof uses:
List,Finset.sort,LE.le,List.cons,List.nil,Iff.mp,List.length,List.length_eq_four,Eq.mpr,id,congrArg,Finset.length_sort,Eq.refl,List.Pairwise,List.SortedLT.pairwise,Finset.sortedLT_sort,List.toFinset,Finset.sort_toFinset,Exists.intro,And.introand 17 more34 instances, coercions and auxiliary constants left out.
Tactic trace: 15 steps
Open to load the checked before-and-after goal states.
lemma exists_sorted_four {A : Finset ℕ} (hA : A.card = 4) : ∃ a b c d : ℕ, a < b ∧ b < c ∧ c < d ∧ A = {a, b, c, d} := by … - problem
Imo2011P1.imo2011_p1line 273 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Eq,Finset.card,OfNat.ofNat,Membership.mem,LT.lt,Iff,Set, Imo2011P1.SolutionSet,LE.le, Imo2011P1.pairCountProof uses:
Iff.intro,And,Or,Insert.insert,HMul.hMul,Singleton.singleton,Exists, Imo2011P1.exists_sorted_four, Imo2011P1.pairCount_eq_four,Exists.intro,HAdd.hAdd,Mathlib.Tactic.Ring.of_eq,HPow.hPow,Nat.rawCast,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.mpr,id,congrArgand 37 more50 instances, coercions and auxiliary constants left out.
Tactic trace: 44 steps
Open to load the checked before-and-after goal states.