Compfiles/Imo2001P4.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
5 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2001, Problem 4
Let $n > 1$ be an odd integer and let $c_1, c_2, \dots, c_n$ be integers. For each permutation $a = (a_1, a_2, \dots, a_n)$ of $\{1, 2, \dots, n\}$, define $S(a) = \sum_{i=1}^n c_i a_i$. Prove that there exist two permutations $a ≠ b$ of $\{1, 2, \dots, n\}$ such that $n!$ is a divisor of $S(a) - S(b)$.
Imports (6)
Imported by 1 file
- def
Imo2001Q4.SThe functionSin the problem line 44 sourceSource documentation
The function
Sin the problem. As implemented here it accepts a permutation ofFin nrather thanIcc 1 n, and as such contains+ 1to compensate.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Int,Equiv.PermProof uses:
Finset.sum,Finset.univ,HMul.hMul,HAdd.hAdd,OfNat.ofNat13 instances, coercions and auxiliary constants left out.
def S (c : Fin n → ℤ) (a : Perm (Fin n)) : ℤ := ∑ i, c i * (a i + 1) …
- lemma
Imo2001Q4.sum_range_modEq_sum_of_contraAssuming the opposite of what is to be proved, the sum ofSover all permutations is congruent to the sum of all residues modulon!, i.e. `n! line 59 sourceSource documentation
Assuming the opposite of what is to be proved, the sum of
Sover all permutations is congruent to the sum of all residues modulon!, i.e.n! * (n! - 1) / 2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Int,Not,Exists,Equiv.Perm,And,Ne,Dvd.dvd,Nat.factorial,HSub.hSub, Imo2001Q4.S,Int.ModEq,HDiv.hDiv,HMul.hMul,OfNat.ofNat,Finset.sum,Finset.univProof uses:
Membership.mem,Finset,Finset.Ico,HMod.hMod,Eq.mpr,LE.le,LT.lt,id,Eq,congrArg,propext,Finset.mem_Ico,And.intro,Int.emod_nonneg,ne_of_gt,Iff.mpr,Nat.cast_pos',Nat.factorial_pos,Int.emod_lt_of_pos,Subtypeand 57 more105 instances, coercions and auxiliary constants left out.
Tactic trace: 43 steps
Open to load the checked before-and-after goal states.
lemma sum_range_modEq_sum_of_contra (hS : ¬∃ a b, a ≠ b ∧ (n ! : ℤ) ∣ S c a - S c b) : n ! * ((n ! : ℤ) - 1) / 2 ≡ ∑ a, S c a [ZMOD n !] := by …Mentions: Imo2001Q4.S
- lemma
Imo2001Q4.sum_perm_add_oneThe sum over all permutations ofIcc 1 nof the entry at any fixed position is `(n - 1)! line 87 sourceSource documentation
The sum over all permutations of
Icc 1 nof the entry at any fixed position is(n - 1)! * (n * (n + 1) / 2).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,LE.le,OfNat.ofNat,Eq,Finset.sum,Equiv.Perm,Finset.univ,HAdd.hAdd,HMul.hMul,Nat.factorial,HSub.hSub,HDiv.hDivProof uses:
Exists,Eq.mp,congrArg,propext,le_iff_exists_add',Eq.mpr,Equiv,Equiv.mulRight,Equiv.swap,id,Eq.symm,Equiv.sum_comp,Function.comp,congrFun',Finset.sum_congr,Eq.refl,Finset,Membership.mem,add_tsub_cancel_right,Equiv.swap_apply_leftand 29 more86 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
lemma sum_perm_add_one {i : Fin n} (hn : 1 ≤ n) : ∑ a : Perm (Fin n), ((a i).1 + 1) = (n - 1)! * (n * (n + 1) / 2) := by … - lemma
Imo2001Q4.sum_modEq_zero_of_oddFor oddn, the sum ofSover all permutations is divisible byn!line 101 sourceSource documentation
For odd
n, the sum ofSover all permutations is divisible byn!.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Int,Odd,Int.ModEq,Nat.factorial,Finset.sum,Equiv.Perm,Finset.univ, Imo2001Q4.S,OfNat.ofNatProof uses:
id,Eq.mpr,HMul.hMul,HAdd.hAdd,Eq,congrArg,Finset.sum_comm,Eq.rec,Eq.refl,funext,Eq.trans,Eq.symm,Nat.cast_one,Nat.cast_add,congrFun',Finset.sum_congr,Finset,Membership.mem,HSub.hSub,HDiv.hDivand 16 more80 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.
lemma sum_modEq_zero_of_odd (hn : Odd n) : ∑ a, S c a ≡ 0 [ZMOD n !] := by …
Mentions: Imo2001Q4.S
- problem
Imo2001Q4.imo2001_p4line 114 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Int,And,Odd,LT.lt,OfNat.ofNat,Exists,Equiv.Perm,Ne,Dvd.dvd,Nat.factorial,HSub.hSub, Imo2001Q4.SProof uses:
Decidable.byContradiction,Eq,Not,Int.ModEq,HDiv.hDiv,HMul.hMul,Int.ModEq.trans,Finset.sum,Finset.univ, Imo2001Q4.sum_range_modEq_sum_of_contra, Imo2001Q4.sum_modEq_zero_of_odd,And.left,False,Eq.mp,congrArg,propext,dvd_def,Int.modEq_zero_iff_dvd,cast,Eq.symmand 20 more95 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.