Compfiles/Imo2022P3.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
36 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 2022, Problem 3
Let k be a positive integer and let S be a finite set of odd prime integers. Prove that there is at most one way (up to rotation and reflection) to place the elements of S around a circle such that the product of any two neighbors is of the form x² + x + k for some positive integer x.
(formalization note: S is assumed to be nonempty; the statement would be
false for S = ∅ because the rotations are indexed by the empty type Fin #S.)
Imports (7)
Imported by 1 file
- def
Imo2022P3.ConditionThe condition of the problem on a placement of numbers round a circle line 44 sourceSource documentation
The condition of the problem on a placement of numbers round a circle.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Equiv,Fin,Finset.card,Subtype,Membership.memProof uses:
NeZero,Exists,And,LT.lt,OfNat.ofNat,Eq,HMul.hMul,HAdd.hAdd,HPow.hPow23 instances, coercions and auxiliary constants left out.
def Condition (k : ℕ) (S : Finset ℕ) (p : Fin #S ≃ S) : Prop := …
Mentions: S
- def
Imo2022P3.goodAuxiliary condition:m * nis of the formx ^ 2 + x + kfor a nonnegative integerxline 53 sourceSource documentation
Auxiliary condition:
m * nis of the formx ^ 2 + x + kfor a nonnegative integerx. The problem uses positivex, but uniqueness of placements for the weaker (nonnegative) condition implies uniqueness for the stronger one.standard axioms: propext what this means
Statement uses:
NatProof uses:
Exists,Eq,HMul.hMul,HAdd.hAdd,HPow.hPow,OfNat.ofNat9 instances, coercions and auxiliary constants left out.
def good (k m n : ℕ) : Prop := ∃ x : ℕ, m * n = x ^ 2 + x + k
- lemma
Imo2022P3.lt_of_good_of_ltA product belowM ^ 2that is good forces the witnessxto be belowMline 56 sourceSource documentation
A product below
M ^ 2that is good forces the witnessxto be belowM.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,Eq,HMul.hMul,HAdd.hAdd,HPow.hPow,OfNat.ofNatProof uses:
Nat.Prime.pos,Nat.mul_lt_mul_of_pos_left,lt_of_not_ge,LE.le,Mathlib.Tactic.Linarith.lt_irrefl,Int,Eq.mp,Neg.neg,HSub.hSub,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,Int.rawCast,inferInstance,Ring,Int.negOfNat,Mathlib.Meta.NormNum.instAddMonoidWithOne,Mathlib.Tactic.Ring.Common.mul_congr,Mathlib.Tactic.Ring.cast_posand 69 more106 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma lt_of_good_of_lt {k M q x : ℕ} (hM : Nat.Prime M) (hq : q < M) (hx : M * q = x ^ 2 + x + k) : x < M := by … - lemma
Imo2022P3.add_eq_of_dvd_of_dvdTwo distinct roots ofT ^ 2 + T + kbelow the primeMsum toM - 1line 63 sourceSource documentation
Two distinct roots of
T ^ 2 + T + kbelow the primeMsum toM - 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,Ne,Dvd.dvd,HAdd.hAdd,HPow.hPow,OfNat.ofNat,EqProof uses:
Nat.Prime.pos,Fact,Fact.mk,ZMod,Iff.mpr,ZMod.natCast_eq_zero_iff,Eq.mp,congrFun',congrArg,Eq.trans,Nat.cast_add,Nat.cast_pow,HMul.hMul,HSub.hSub,Mathlib.Tactic.LinearCombination.eq_of_eq,Mathlib.Tactic.LinearCombination.add_eq_eq,Eq.symm,Mathlib.Tactic.LinearCombination.eq_rearrange,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.sub_congrand 79 more87 instances, coercions and auxiliary constants left out.
Tactic trace: 44 steps
Open to load the checked before-and-after goal states.
lemma add_eq_of_dvd_of_dvd {k M x y : ℕ} (hM : Nat.Prime M) (hxM : x < M) (hyM : y < M) (hxy : x ≠ y) (hx : M ∣ x ^ 2 + x + k) (hy : M ∣ y ^ 2 + y + k) : x + y + 1 = M := by … - lemma
Imo2022P3.dvd_sub_of_good_of_goodVieta for the two roots: their product is congruent tokmoduloMline 106 sourceSource documentation
Vieta for the two roots: their product is congruent to
kmoduloM.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,Ne,Eq,HMul.hMul,HAdd.hAdd,HPow.hPow,OfNat.ofNat,And,Dvd.dvd,Int,HSub.hSubProof uses:
Nat.Prime.pos,Fact,Fact.mk, Imo2022P3.lt_of_good_of_lt,False,Eq.mpr,id,congrArg,Eq.refl,Nat.eq_of_mul_eq_mul_left, Imo2022P3.add_eq_of_dvd_of_dvd,Exists.intro,Eq.symm,And.intro,ZMod,Iff.mpr,ZMod.natCast_eq_zero_iff,Eq.mp,congrFun',Eq.transand 64 more88 instances, coercions and auxiliary constants left out.
Tactic trace: 27 steps
Open to load the checked before-and-after goal states.
lemma dvd_sub_of_good_of_good {k M q r x y : ℕ} (hM : Nat.Prime M) (hq : q < M) (hr : r < M) (hqr : q ≠ r) (hx : M * q = x ^ 2 + x + k) (hy : M * r = y ^ 2 + y + k) : x + y + 1 = M ∧ (M : ℤ) ∣ (x * y : ℤ) - k := by … - lemma
Imo2022P3.good_of_good_of_goodThe key multiplicativity lemma (Chen's Claim 2): if the primeMhas two distinct smaller good partnersqandr, thenq * ris itself good line 141 sourceSource documentation
The key multiplicativity lemma (Chen's Claim 2): if the prime
Mhas two distinct smaller good partnersqandr, thenq * ris itself good.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,Ne, Imo2022P3.goodProof uses:
Eq,HMul.hMul,HAdd.hAdd,HPow.hPow,OfNat.ofNat,Dvd.dvd,Int,HSub.hSub,And, Imo2022P3.dvd_sub_of_good_of_good,cast,Eq.symm,Eq.trans,congrFun',congrArg,Nat.cast_zero,Nat.Prime.pos,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,Mathlib.Tactic.Ring.Common.mul_congrand 83 more108 instances, coercions and auxiliary constants left out.
Tactic trace: 45 steps
Open to load the checked before-and-after goal states.
lemma good_of_good_of_good {k M q r : ℕ} (hM : Nat.Prime M) (hq : q < M) (hr : r < M) (hqr : q ≠ r) (h1 : good k M q) (h2 : good k M r) : good k q r := by …Mentions: Imo2022P3.good
- lemma
Imo2022P3.card_roots_le_twoA quadratic has at most two roots below a primeM: the setTof solutionsx < MtoM ∣ x ^ 2 + x + khas at most two elements line 180 sourceSource documentation
A quadratic has at most two roots below a prime
M: the setTof solutionsx < MtoM ∣ x ^ 2 + x + khas at most two elements.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Finset,Membership.mem,LT.lt,Dvd.dvd,HAdd.hAdd,HPow.hPow,OfNat.ofNat,LE.le,Finset.cardProof uses:
dite,Finset.Nonempty,Finset.erase,Finset.min',Eq,rfl,Eq.mp,congrArg,Finset.min'_mem,Finset.mem_of_mem_erase,Ne,Finset.min'_erase_ne_self,Insert.insert,Singleton.singleton,Decidable.byContradiction,Not,And.left,And,Eq.trans,Orand 23 more67 instances, coercions and auxiliary constants left out.
Tactic trace: 32 steps
Open to load the checked before-and-after goal states.
lemma card_roots_le_two {k M : ℕ} (hM : Nat.Prime M) (T : Finset ℕ) (hT1 : ∀ x ∈ T, x < M) (hT2 : ∀ x ∈ T, M ∣ x ^ 2 + x + k) : T.card ≤ 2 := by … - lemma
Imo2022P3.card_good_le_twoChen's Claim 1: a primeMhas at most two good partners below it inside any set of smaller numbers line 220 sourceSource documentation
Chen's Claim 1: a prime
Mhas at most two good partners below it inside any set of smaller numbers.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Finset,DecidablePred, Imo2022P3.good,Membership.mem,LT.lt,LE.le,Finset.card,Finset.filter,OfNat.ofNatProof uses:
dite,Exists.choose,Eq,HMul.hMul,HAdd.hAdd,HPow.hPow,Not,rfl,And.right,Eq.mp,And,congrArg,propext,Finset.mem_filter,Exists.choose_spec,Eq.mpr,id,congrFun',congr,Eq.transand 18 more25 instances, coercions and auxiliary constants left out.
Tactic trace: 26 steps
Open to load the checked before-and-after goal states.
lemma card_good_le_two {k M : ℕ} (hM : Nat.Prime M) (S : Finset ℕ) [DecidablePred (good k M)] (hSM : ∀ q ∈ S, q < M) : (S.filter (good k M ·)).card ≤ 2 := by …Mentions: S, Imo2022P3.good
- lemma
Imo2022P3.good_commgoodis symmetric in the two factors line 248 sourceSource documentation
goodis symmetric in the two factors.standard axioms: propext what this means
Statement uses:
Nat, Imo2022P3.goodProof uses:
Eq,HMul.hMul,HAdd.hAdd,HPow.hPow,OfNat.ofNat,Exists.intro,Eq.mpr,id,congrArg,mul_comm15 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma good_comm {k m n : ℕ} (h : good k m n) : good k n m := by …Mentions: h, Imo2022P3.good
- lemma
Imo2022P3.zmod_injInjectivity of theZMod ncast onFin nline 253 sourceSource documentation
Injectivity of the
ZMod ncast onFin n.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,Eq,ZModProof uses:
Fin.ext,Nat.ModEq.eq_of_lt_of_lt,Eq.mp,Nat.ModEq,congrArg,propext,ZMod.natCast_eq_natCast_iff,Fin.isLt14 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma zmod_inj {n : ℕ} {a b : Fin n} (h : (a.val : ZMod n) = b.val) : a = b := by …Mentions: h
- lemma
Imo2022P3.zmod_addTheZMod ncast of a sum inFin nline 258 sourceSource documentation
The
ZMod ncast of a sum inFin n.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Fin,Eq,ZMod,HAdd.hAddProof uses:
Eq.mpr,HMod.hMod,id,congrArg,Fin.val_add,ZMod.natCast_mod,Nat.cast_add,Eq.refl32 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
lemma zmod_add {n : ℕ} (a b : Fin n) : ((a + b).val : ZMod n) = a.val + b.val := by … - lemma
Imo2022P3.zmod_oneTheZMod ncast of1 : Fin nline 262 sourceSource documentation
The
ZMod ncast of1 : Fin n.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Eq,ZMod,OfNat.ofNat,FinProof uses:
Eq.mpr,HMod.hMod,id,congrArg,Fin.val_one',ZMod.natCast_mod,Nat.cast_one,Eq.refl27 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
lemma zmod_one {n : ℕ} [NeZero n] : ((1 : Fin n).val : ZMod n) = 1 := by … - lemma
Imo2022P3.zmod_revTheZMod ncast ofFin.revline 266 sourceSource documentation
The
ZMod ncast ofFin.rev.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,Eq,ZMod,Fin.rev,HSub.hSub,Neg.neg,OfNat.ofNatProof uses:
HAdd.hAdd,rfl,LE.le,Fin.isLt,Eq.mpr,id,congrArg,Nat.cast_sub,ZMod.natCast_self,congrFun',Eq.trans,Nat.cast_add,Nat.cast_one,Mathlib.Tactic.Ring.of_eq,Int.rawCast,inferInstance,Ring,Int.negOfNat,HMul.hMul,HPow.hPowand 25 more66 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma zmod_rev {n : ℕ} [NeZero n] (j : Fin n) : ((Fin.rev j).val : ZMod n) = -1 - j.val := by … - def
Imo2022P3.succPermThe successor permutation of a placement: sends each element to its clockwise neighbor line 276 sourceSource documentation
The successor permutation of a placement: sends each element to its clockwise neighbor.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv,Fin,Finset.card,Subtype,Membership.mem,Equiv.PermProof uses:
Equiv.trans,Equiv.symm,finRotate4 instances, coercions and auxiliary constants left out.
def succPerm {S : Finset ℕ} (p : Fin #S ≃ S) : Equiv.Perm S := …Mentions: S
- lemma
Imo2022P3.succPerm_applyline 279 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,NeZero,Finset.card,Equiv,Fin,Subtype,Membership.mem,Eq,Equiv.Perm, Imo2022P3.succPerm,HAdd.hAdd,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,Fin.neZero,True,congrFun',congrArg,Equiv.trans,Equiv.symm,finRotate,Equiv.symm_apply_apply,finRotate_apply,eq_self20 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- def
Imo2022P3.ValidPermValidity of a permutation ofS: every element has a good product with its successor line 285 sourceSource documentation
Validity of a permutation of
S: every element has a good product with its successor.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Equiv.Perm,Subtype,Membership.memProof uses: Imo2022P3.good
8 instances, coercions and auxiliary constants left out.
def ValidPerm (k : ℕ) {S : Finset ℕ} (σ : Equiv.Perm S) : Prop := …Mentions: S
- def
Imo2022P3.ConnectedPConnectivity of a permutation ofS: it is a single cycle line 289 sourceSource documentation
Connectivity of a permutation of
S: it is a single cycle.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.memProof uses:
Exists,Eq,Nat.iterate7 instances, coercions and auxiliary constants left out.
def ConnectedP {S : Finset ℕ} (σ : Equiv.Perm S) : Prop := …Mentions: S
- lemma
Imo2022P3.validPerm_succPermline 292 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,NeZero,Finset.card,Equiv,Fin,Subtype,Membership.mem, Imo2022P3.good,HAdd.hAdd,OfNat.ofNat, Imo2022P3.ValidPerm, Imo2022P3.succPermProof uses:
Eq,Equiv.Perm,Equiv.symm,of_eq_true,Eq.trans,Fin.neZero,True,congrFun',congrArg,Equiv.trans,finRotate,finRotate_apply,eq_self,Eq.mpr,id,Eq.mp,Equiv.apply_symm_apply22 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2022P3.iterate_conjIteration of a conjugated map line 301 sourceSource documentation
Iteration of a conjugated map.
standard axioms: Quot.sound, propext what this means
Statement uses:
Equiv,Nat,Eq,Nat.iterate,Function.comp,Equiv.symmProof uses:
Nat.recAux,funext,OfNat.ofNat,of_eq_true,Eq.trans,True,congrArg,congrFun',CompTriple.comp_eq,id,Equiv.apply_symm_apply,eq_self,Eq.mpr,HAdd.hAdd,Nat.succ,Function.iterate_succ',Equiv.symm_apply_apply,Function.iterate_succ_apply',Eq.refl11 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma iterate_conj {α β : Type*} (c : α ≃ β) (τ : α → α) (m : ℕ) : (⇑c ∘ τ ∘ ⇑c.symm)^[m] = ⇑c ∘ τ^[m] ∘ ⇑c.symm := by … - lemma
Imo2022P3.iterate_finRotateline 313 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Fin,Eq,Nat.iterate,Equiv.Perm,finRotate,HAdd.hAdd,Fin.NatCast.instNatCastProof uses:
Nat.recAux,of_eq_true,OfNat.ofNat,Eq.trans,True,congrArg,Fin.instAddMonoidWithOne,Nat.cast_zero,add_zero,eq_self,Eq.mpr,id,Nat.succ,Function.iterate_succ_apply',Fin.neZero,finRotate_apply, Imo2022P3.zmod_inj,ZMod,congr, Imo2022P3.zmod_add and 15 more49 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2022P3.succPerm_iterateline 323 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,NeZero,Finset.card,Equiv,Fin,Subtype,Membership.mem,Eq,Nat.iterate,Equiv.Perm, Imo2022P3.succPerm,HAdd.hAdd,Fin.NatCast.instNatCastProof uses:
Function.comp,finRotate,Equiv.symm,funext,of_eq_true,Eq.trans,OfNat.ofNat,Fin.neZero,True,congr,congrArg,Equiv.trans,finRotate_apply,eq_self,Eq.mpr,id, Imo2022P3.iterate_conj,congrFun',Equiv.symm_apply_apply, Imo2022P3.iterate_finRotate and 1 more21 instances, coercions and auxiliary constants left out.
Tactic trace: 9 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2022P3.connectedP_succPermline 336 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Finset.Nonempty,Equiv,Fin,Finset.card,Subtype,Membership.mem, Imo2022P3.ConnectedP, Imo2022P3.succPermProof uses:
NeZero,NeZero.mk,LT.lt.ne',OfNat.ofNat,Iff.mpr,LT.lt,Finset.card_pos,Equiv.symm,Eq,Equiv.apply_symm_apply,Exists.intro,Nat.iterate,Equiv.Perm,ZMod.val,HSub.hSub,ZMod,Eq.mpr,id,congrArg,Eq.symmand 47 more50 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2022P3.zmod_eq_of_add_keyA permutation ofFin ncommuting with+ 1is a rotation line 352 sourceSource documentation
A permutation of
Fin ncommuting with+ 1is a rotation.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Equiv.Perm,Fin,Eq,HAdd.hAdd,OfNat.ofNat,ZModProof uses:
Nat.succ,Exists,Nat.exists_eq_succ_of_ne_zero,NeZero.ne,Fin.induction,of_eq_true,Eq.trans,True,congrArg,Nat.cast_zero,add_zero,eq_self,Fin.castSucc,Eq.mpr,Fin.succ,id,Eq.symm,Fin.coeSucc_eq_succ,congr, Imo2022P3.zmod_add and 16 more62 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
lemma zmod_eq_of_add_key {n : ℕ} [NeZero n] (g : Equiv.Perm (Fin n)) (key : ∀ j : Fin n, g (j + 1) = g j + 1) (j : Fin n) : ((g j).val : ZMod n) = ((g 0).val : ZMod n) + j.val := by … - lemma
Imo2022P3.zmod_eq_of_sub_keyA permutation ofFin nanti-commuting with+ 1is a reflection line 364 sourceSource documentation
A permutation of
Fin nanti-commuting with+ 1is a reflection.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,NeZero,Equiv.Perm,Fin,Eq,HAdd.hAdd,OfNat.ofNat,ZMod,HSub.hSubProof uses:
Nat.succ,Exists,Nat.exists_eq_succ_of_ne_zero,NeZero.ne,Fin.induction,of_eq_true,Eq.trans,True,congrArg,Nat.cast_zero,sub_zero,eq_self,Fin.castSucc,Eq.mpr,id,Eq.refl,Mathlib.Tactic.LinearCombination.eq_of_eq,Eq.mp, Imo2022P3.zmod_one, Imo2022P3.zmod_add and 42 more78 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma zmod_eq_of_sub_key {n : ℕ} [NeZero n] (g : Equiv.Perm (Fin n)) (key : ∀ j : Fin n, g (j + 1) + 1 = g j) (j : Fin n) : ((g j).val : ZMod n) = ((g 0).val : ZMod n) - j.val := by … - lemma
Imo2022P3.rot_of_succPerm_eqIf two placements have the same successor permutation, they differ by a rotation line 384 sourceSource documentation
If two placements have the same successor permutation, they differ by a rotation.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Finset.Nonempty,Equiv,Fin,Finset.card,Subtype,Membership.mem,Eq,Equiv.Perm, Imo2022P3.succPerm,Exists,HAdd.hAddProof uses:
NeZero,NeZero.mk,LT.lt.ne',OfNat.ofNat,Iff.mpr,LT.lt,Finset.card_pos,Equiv.trans,Equiv.symm,rfl,Equiv.injective,of_eq_true,Eq.trans,True,congrFun',congrArg,Equiv.apply_symm_apply,eq_self, Imo2022P3.succPerm_apply,Eq.mpand 20 more44 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
lemma rot_of_succPerm_eq {S : Finset ℕ} (hne : S.Nonempty) {p₁ p₂ : Fin #S ≃ S} (h : succPerm p₁ = succPerm p₂) : ∃ i, ∀ j, p₂ j = p₁ (j + i) := by …Mentions: S, h, Imo2022P3.succPerm
- lemma
Imo2022P3.ref_of_succPerm_eqIf the successor permutation of one placement is the inverse of the other's, they differ by a reflection composed with a rotation line 408 sourceSource documentation
If the successor permutation of one placement is the inverse of the other's, they differ by a reflection composed with a rotation.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Finset.Nonempty,Equiv,Fin,Finset.card,Subtype,Membership.mem,Eq,Equiv.Perm, Imo2022P3.succPerm,Inv.inv,Exists,HAdd.hAdd,Fin.revProof uses:
NeZero,NeZero.mk,LT.lt.ne',OfNat.ofNat,Iff.mpr,LT.lt,Finset.card_pos,Equiv.trans,Equiv.symm,rfl,Equiv.injective,Eq.symm, Imo2022P3.succPerm_apply,of_eq_true,Eq.trans,True,congrFun',congrArg,Equiv.apply_symm_apply,eq_selfand 47 more58 instances, coercions and auxiliary constants left out.
Tactic trace: 23 steps
Open to load the checked before-and-after goal states.
lemma ref_of_succPerm_eq {S : Finset ℕ} (hne : S.Nonempty) {p₁ p₂ : Fin #S ≃ S} (h : succPerm p₁ = (succPerm p₂)⁻¹) : ∃ i, ∀ j, p₂ j = p₁ (Fin.rev j + i) := by …Mentions: S, h, Imo2022P3.succPerm
- def
Imo2022P3.delPermDeletingMfrom a permutation: the short-circuited permutation onS.erase M, sending the predecessor ofMto the successor ofMline 436 sourceSource documentation
Deleting
Mfrom a permutation: the short-circuited permutation onS.erase M, sending the predecessor ofMto the successor ofM.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.mem,Ne,Finset.eraseProof uses:
ite,Eq,Subtype.mk,Function.Injective,Equiv.ofBijective19 instances, coercions and auxiliary constants left out.
Tactic trace: 33 steps
Open to load the checked before-and-after goal states.
noncomputable def delPerm {S : Finset ℕ} (τ : Equiv.Perm S) (M : S) (hrM : τ M ≠ M) : Equiv.Perm (S.erase M) := …Mentions: S
- lemma
Imo2022P3.delPerm_valThe computation rule fordelPermline 483 sourceSource documentation
The computation rule for
delPerm.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.mem,Ne,Finset.erase,Eq, Imo2022P3.delPerm,ite,Subtype.mk,Finset.mem_of_mem_erase,Subtype.propertyProof uses:
id,Eq.mpr,Function.Injective,Equiv.ofBijective,congrArg,Equiv,Equiv.ofBijective_apply,Eq.refl20 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma delPerm_val {S : Finset ℕ} {τ : Equiv.Perm S} {M : S} {hrM : τ M ≠ M} (s : S.erase M) : (delPerm τ M hrM s).1 = if τ ⟨s.1, Finset.mem_of_mem_erase s.2⟩ = M then (τ M).1 else (τ ⟨s.1, Finset.mem_of_mem_erase s.2⟩).1 := by …Mentions: S, Imo2022P3.delPerm
- lemma
Imo2022P3.validPerm_delPermThe deleted permutation stays valid: the one new edge is good bygood_of_good_of_goodline 493 sourceSource documentation
The deleted permutation stays valid: the one new edge is good by
good_of_good_of_good.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Equiv.Perm,Subtype,Membership.mem,Ne, Imo2022P3.ValidPerm,Nat.Prime,LT.lt,Inv.inv, Imo2022P3.good,Finset.erase, Imo2022P3.delPermProof uses:
Eq.mpr,ite,Eq,Subtype.mk,Finset.mem_of_mem_erase,Subtype.property,id,congrArg, Imo2022P3.delPerm_val,dite,ite_eq_left,Eq.symm,Equiv,Equiv.symm,Equiv.apply_symm_apply,Equiv.injective,Iff.mp,Subtype.mk_eq_mk, Imo2022P3.good_of_good_of_good,Subtype.extand 2 more19 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
lemma validPerm_delPerm {k : ℕ} {S : Finset ℕ} {τ : Equiv.Perm S} {M : S} {hrM : τ M ≠ M} (hv : ValidPerm k τ) (hMprime : Nat.Prime M.1) (hq : (τ⁻¹ M).1 < M.1) (hr : (τ M).1 < M.1) (hqr : τ⁻¹ M ≠ τ M) (hgq : good k M.1 (τ⁻¹ M).1) (hgr : good k M.1 (τ M).1) : ValidPerm k (delPerm τ M hrM) := by …Mentions: S, Imo2022P3.ValidPerm, Imo2022P3.good, Imo2022P3.delPerm
- lemma
Imo2022P3.connectedP_delPermThe deleted permutation stays connected (the "skipM" argument) line 516 sourceSource documentation
The deleted permutation stays connected (the "skip
M" argument).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.mem,Ne, Imo2022P3.ConnectedP,Finset.erase, Imo2022P3.delPermProof uses:
Eq.mpr,id,Eq,congrArg,rfl,LE.le,OfNat.ofNat,LT.lt,Nat.iterate,Subtype.mk,Finset.mem_of_mem_erase,Subtype.property,Exists,Nat.recAux,Exists.intro,HAdd.hAdd,Eq.symm,Nat.succ,Function.iterate_succ_apply',Iff.mprand 22 more25 instances, coercions and auxiliary constants left out.
Tactic trace: 68 steps
Open to load the checked before-and-after goal states.
lemma connectedP_delPerm {S : Finset ℕ} {τ : Equiv.Perm S} {M : S} {hrM : τ M ≠ M} (hc : ConnectedP τ) : ConnectedP (delPerm τ M hrM) := by …Mentions: S, Imo2022P3.ConnectedP, Imo2022P3.delPerm
- lemma
Imo2022P3.not_connectedP_of_orbit_subsetIf an orbit stays inside a set missing an element, the permutation is not connected line 612 sourceSource documentation
If an orbit stays inside a set missing an element, the permutation is not connected.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.mem, Imo2022P3.ConnectedP,Nat.iterate,Not,FalseProof uses:
Eq,Exists,Eq.rec11 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma not_connectedP_of_orbit_subset {S : Finset ℕ} {σ : Equiv.Perm S} (hc : ConnectedP σ) {x : S} {T : Finset S} (hT : ∀ m, σ^[m] x ∈ T) {y : S} (hy : y ∉ T) : False := by …Mentions: S, Imo2022P3.ConnectedP
- lemma
Imo2022P3.validPerm_invValidity passes to the inverse permutation line 618 sourceSource documentation
Validity passes to the inverse permutation.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Equiv.Perm,Subtype,Membership.mem, Imo2022P3.ValidPerm,Inv.invProof uses: Imo2022P3.good,
Eq,Equiv.apply_symm_apply, Imo2022P3.good_comm,Eq.mp,congrArg10 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
lemma validPerm_inv {k : ℕ} {S : Finset ℕ} {σ : Equiv.Perm S} (hv : ValidPerm k σ) : ValidPerm k σ⁻¹ := by …Mentions: S, Imo2022P3.ValidPerm
- lemma
Imo2022P3.connectedP_invConnectivity passes to the inverse permutation line 627 sourceSource documentation
Connectivity passes to the inverse permutation.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.mem, Imo2022P3.ConnectedP,Inv.invProof uses:
Iff,Eq,Nat.iterate,Nat.recAux,Iff.intro,OfNat.ofNat,Eq.symm,Eq.mpr,HAdd.hAdd,id,congrArg,Nat.succ,Function.iterate_succ_apply',Equiv.Perm.inv_eq_iff_eq,propext,Function.iterate_succ_apply,Iff.rfl,Exists,Exists.intro,Iff.mpr13 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
lemma connectedP_inv {S : Finset ℕ} {σ : Equiv.Perm S} (hc : ConnectedP σ) : ConnectedP σ⁻¹ := by …Mentions: S, Imo2022P3.ConnectedP
- lemma
Imo2022P3.ne_of_connectedPA connected permutation on at least two elements has no fixed point line 645 sourceSource documentation
A connected permutation on at least two elements has no fixed point.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,Equiv.Perm,Subtype,Membership.mem, Imo2022P3.ConnectedP,LE.le,OfNat.ofNat,Finset.card,NeProof uses:
Eq,Exists,False,Finset.Nonempty,Finset.erase,Iff.mp,LT.lt,Finset.card_pos,Eq.mpr,HSub.hSub,id,congrArg,Finset.card_erase_of_mem,Subtype.property,Exists.intro,Subtype.mk,Finset.mem_of_mem_erase,And.left,And,Finset.mem_eraseand 5 more21 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma ne_of_connectedP {S : Finset ℕ} {σ : Equiv.Perm S} (hc : ConnectedP σ) (h : 2 ≤ #S) (s : S) : σ s ≠ s := by …Mentions: S, Imo2022P3.ConnectedP, h
- lemma
Imo2022P3.perm_uniqueThe core uniqueness statement: two valid connected permutations ofSare equal or inverse to each other line 663 sourceSource documentation
The core uniqueness statement: two valid connected permutations of
Sare equal or inverse to each other. Proved by strong induction on#S.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Finset,Eq,Finset.card,LE.le,OfNat.ofNat,Membership.mem,And,Odd,Nat.Prime,Equiv.Perm,Subtype, Imo2022P3.ValidPerm, Imo2022P3.ConnectedP,Or,Inv.invProof uses:
Nat.strong_induction_on,LT.lt,dite,Singleton.singleton,Exists,Iff.mp,Finset.card_eq_one,Or.inl,Equiv.Perm.ext,Subtype.ext,Subtype.mk,Finset.mem_singleton_self,Finset.mem_singleton,Subtype.property,Eq.mpr,id,congrArg,Eq.refl,Eq.symm,Notand 72 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 431 steps (first 200 of 431)
Open to load the checked before-and-after goal states.
lemma perm_unique {k : ℕ} (n : ℕ) : ∀ (S : Finset ℕ) (_ : #S = n) (_ : 1 ≤ #S) (_ : ∀ p ∈ S, Odd p ∧ Nat.Prime p) (σ₁ σ₂ : Equiv.Perm S), ValidPerm k σ₁ → ValidPerm k σ₂ → ConnectedP σ₁ → ConnectedP σ₂ → σ₁ = σ₂ ∨ σ₁ = σ₂⁻¹ := by …Mentions: S, Imo2022P3.ValidPerm, Imo2022P3.ConnectedP
- problem
Imo2022P3.imo2023_p3line 1074 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Finset,Finset.Nonempty,Membership.mem,And,Odd,Nat.Prime,Equiv,Fin,Finset.card,Subtype, Imo2022P3.Condition,Or,Exists,Eq,HAdd.hAdd,Fin.revProof uses:
NeZero,NeZero.mk,LT.lt.ne',Iff.mpr,Finset.card_pos, Imo2022P3.good,HMul.hMul,HPow.hPow,Exists.intro,Equiv.Perm, Imo2022P3.succPerm,Inv.inv, Imo2022P3.perm_unique,rfl, Imo2022P3.validPerm_succPerm, Imo2022P3.connectedP_succPerm,Or.inl, Imo2022P3.rot_of_succPerm_eq,Or.inr, Imo2022P3.ref_of_succPerm_eq36 instances, coercions and auxiliary constants left out.
Tactic trace: 8 steps
Open to load the checked before-and-after goal states.