Compfiles/Imo1990P2.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
11 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1990, Problem 2
Take n ≥ 3 and consider a set E of 2n - 1 distinct points on a circle. Suppose that exactly k of these points are to be colored black. Such a coloring is said to be "good" if there is at least one pair of black points such that the interior of one of the arcs between them contains exactly n points from E. Find the smallest value of k so that every such coloring of k points of E is good.
Imports (2)
Imported by 1 file
- determine
Imo1990P2.solutionline 29 sourceno axioms what this means
Statement uses:
NatProof uses:
ite,Eq,HMod.hMod,OfNat.ofNat,HSub.hSub6 instances, coercions and auxiliary constants left out.
- def
Imo1990P2.IsGoodLabel the points byZMod (2 * n - 1)line 35 sourceSource documentation
Label the points by
ZMod (2 * n - 1). A setBof black points is good if it contains two pointsxandywithy - x = n + 1orx - y = n + 1, which is exactly the condition that one of the two arcs between them containsnpoints ofEin its interior.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,ZMod,HSub.hSub,HMul.hMul,OfNat.ofNatProof uses:
Exists,And,Membership.mem,Or,Eq,HAdd.hAdd23 instances, coercions and auxiliary constants left out.
def IsGood (n : ℕ) (B : Finset (ZMod (2 * n - 1))) : Prop := …
- theorem
Imo1990P2.IsGood.monoline 41 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,ZMod,HSub.hSub,HMul.hMul,OfNat.ofNat,LE.le, Imo1990P2.IsGoodProof uses:
And,Membership.mem,Exists,Or,Eq,HAdd.hAdd,Exists.intro,And.intro31 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1990P2.bad_disjoint_translateA bad (i.e. not good) coloring and its translate byn + 1are disjoint line 47 sourceSource documentation
A bad (i.e. not good) coloring and its translate by
n + 1are disjoint.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,ZMod,HSub.hSub,HMul.hMul,OfNat.ofNat,Not, Imo1990P2.IsGood,Disjoint,Finset.image,HAdd.hAddProof uses:
Eq.mpr,Membership.mem,id,Eq,congrArg,propext,Finset.disjoint_left,And,Exists,False,Eq.mp,Finset.mem_image,Exists.intro,Or,And.intro,Or.inl,Eq.symm,add_sub_cancel_left,Eq.refl53 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
theorem bad_disjoint_translate {n : ℕ} {B : Finset (ZMod (2 * n - 1))} (hbad : ¬ IsGood n B) : Disjoint B (B.image (· + ((n + 1 : ℕ) : ZMod (2 * n - 1)))) := by …Mentions: Imo1990P2.IsGood
- theorem
Imo1990P2.card_range_filter_mod_eqExactlytof the numbers0, ..., 3 * t - 1are congruent tojmod 3 line 59 sourceSource documentation
Exactly
tof the numbers0, ..., 3 * t - 1are congruent tojmod 3.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Eq,Finset.card,Finset.filter,HMod.hMod,Finset.range,HMul.hMulProof uses:
Finset.card_bij,Membership.mem,Finset,HDiv.hDiv,Eq.mpr,id,congrArg,propext,Finset.mem_range,Eq.mp,And,Finset.mem_filter,Exists.intro,Exists,HAdd.hAdd,Finset.card_range24 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
theorem card_range_filter_mod_eq (t j : ℕ) (hj : j < 3) : ((Finset.range (3 * t)).filter (· % 3 = j)).card = t := by … - theorem
Imo1990P2.card_univ_filter_val_mod_eqWhen3 ∣ N, exactlyN / 3elements ofZMod Nhave a givenvalresidue mod 3 line 79 sourceSource documentation
When
3 ∣ N, exactlyN / 3elements ofZMod Nhave a givenvalresidue mod 3.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Dvd.dvd,OfNat.ofNat,LT.lt,Eq,Finset.card,ZMod,Finset.filter,HMod.hMod,ZMod.val,Finset.univ,HDiv.hDivProof uses:
Finset,Finset.image,Finset.range,Finset.ext,Eq.mpr,Iff,Membership.mem,And,id,congrArg,propext,Finset.mem_filter,Exists,Finset.mem_image,congr,Eq.trans,True,congrFun',true_and,funextand 19 more42 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
theorem card_univ_filter_val_mod_eq {N : ℕ} [NeZero N] (hN : 3 ∣ N) (j : ℕ) (hj : j < 3) : ((Finset.univ : Finset (ZMod N)).filter (fun x => x.val % 3 = j)).card = N / 3 := by … - theorem
Imo1990P2.val_mod_translateTranslation byn + 1preservesval % 3when3 ∣ n + 1and3 ∣ 2 * n - 1line 104 sourceSource documentation
Translation by
n + 1preservesval % 3when3 ∣ n + 1and3 ∣ 2 * n - 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,HSub.hSub,HMul.hMul,OfNat.ofNat,Dvd.dvd,HAdd.hAdd,ZMod,Eq,HMod.hMod,ZMod.valProof uses:
Nat.ModEq,Eq.mpr,id,congrArg,Eq.symm,propext,ZMod.natCast_eq_natCast_iff,Nat.cast_add,ZMod.natCast_rightInverse,Nat.ModEq.of_dvd,Iff.mpr,Nat.add_modEq_left_iff,Nat.ModEq.trans45 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
theorem val_mod_translate {n : ℕ} [NeZero (2 * n - 1)] (h3n : 3 ∣ n + 1) (h3N : 3 ∣ 2 * n - 1) (x : ZMod (2 * n - 1)) : (x + ((n + 1 : ℕ) : ZMod (2 * n - 1))).val % 3 = x.val % 3 := by … - theorem
Imo1990P2.coprime_auxIfn % 3 ≠ 2then2 * n - 1andn + 1are coprime line 119 sourceSource documentation
If
n % 3 ≠ 2then2 * n - 1andn + 1are coprime.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Ne,HMod.hMod,Nat.Coprime,HSub.hSub,HMul.hMul,HAdd.hAddProof uses:
Eq.mpr,Eq,Nat.gcd,id,congrArg,propext,Nat.coprime_iff_gcd_eq_one,Dvd.dvd,dvd_trans,Nat.gcd_dvd_right,dvd_mul_left,Nat.gcd_dvd_left,Nat.dvd_sub,Eq.mp,Or,Iff.mp,Nat.dvd_prime,Mathlib.Meta.NormNum.isNat_prime_2,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refland 9 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
theorem coprime_aux {n : ℕ} (hn : 3 ≤ n) (h3 : n % 3 ≠ 2) : Nat.Coprime (2 * n - 1) (n + 1) := by … - theorem
Imo1990P2.card_le_of_badUpper bound: a bad coloring has at mostsolution n - 1black points line 136 sourceSource documentation
Upper bound: a bad coloring has at most
solution n - 1black points.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Finset,ZMod,HSub.hSub,HMul.hMul,Not, Imo1990P2.IsGood,Finset.card, Imo1990P2.solutionProof uses:
NeZero,NeZero.mk,Disjoint,Finset.image,HAdd.hAdd, Imo1990P2.bad_disjoint_translate,Function.Injective,Eq,add_right_cancel,dite,HMod.hMod,Exists,Exists.intro,HDiv.hDiv,id,Eq.mpr,ite,congrArg,ite_eq_left,Dvd.dvdand 71 more90 instances, coercions and auxiliary constants left out.
Tactic trace: 50 steps
Open to load the checked before-and-after goal states.
theorem card_le_of_bad {n : ℕ} (hn : 3 ≤ n) {B : Finset (ZMod (2 * n - 1))} (hbad : ¬ IsGood n B) : B.card ≤ solution n - 1 := by …Mentions: Imo1990P2.IsGood, Imo1990P2.solution
- theorem
Imo1990P2.exists_badLower bound: there is a bad coloring withsolution n - 1black points line 202 sourceSource documentation
Lower bound: there is a bad coloring with
solution n - 1black points.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Exists,Finset,ZMod,HSub.hSub,HMul.hMul,And,Eq,Finset.card, Imo1990P2.solution,Not, Imo1990P2.IsGoodProof uses:
NeZero,NeZero.mk,dite,HMod.hMod,Exists.intro,Finset.image,Finset.Icc,And.intro,id,Eq.mpr,ite,congrArg,ite_eq_left,Finset.card_image_of_injOn,Membership.mem,Set,Nat.ModEq,Iff.mp,ZMod.natCast_eq_natCast_iff,Eq.mpand 99 more147 instances, coercions and auxiliary constants left out.
Tactic trace: 127 steps
Open to load the checked before-and-after goal states.
theorem exists_bad {n : ℕ} (hn : 3 ≤ n) : ∃ B : Finset (ZMod (2 * n - 1)), B.card = solution n - 1 ∧ ¬ IsGood n B := by …Mentions: Imo1990P2.solution, Imo1990P2.IsGood
- problem
Imo1990P2.imo1990_p2line 317 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,IsLeast,Set.ofPred,Finset,ZMod,HSub.hSub,HMul.hMul,Eq,Finset.card, Imo1990P2.IsGood, Imo1990P2.solutionProof uses:
And.intro,Membership.mem,Set,lowerBounds,Classical.byContradiction,Not, Imo1990P2.card_le_of_bad,dite,False,HMod.hMod,Eq.mp,ite,congrArg,ite_eq_left,ite_eq_right,And,Exists, Imo1990P2.exists_bad,Decidable.byContradiction,Nat.one_le_of_ltand 3 more29 instances, coercions and auxiliary constants left out.
Tactic trace: 24 steps
Open to load the checked before-and-after goal states.