Compfiles/Imo1967P6.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
8 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1967, Problem 6
In a sports contest, there were m medals awarded on n successive days (n > 1). On the first day, one medal and 1/7 of the remaining (m − 1) medals were awarded. On the second day, two medals and 1/7 of the now remaining medals were awarded; and so on. On the n-th and last day, the remaining n medals were awarded. How many days did the contest last, and how many medals were awarded altogether?
Imports (7)
Imported by 1 file
- abbrev
Imo1967P6.MedalsProcessThe process described in the problem, from the point of view of the medals remaining:r kis the number of medals left at the start of dayk + 1(sor 0 = m) line 40 sourceSource documentation
The process described in the problem, from the point of view of the medals remaining:
r kis the number of medals left at the start of dayk + 1(sor 0 = m). On dayk(for1 ≤ k ≤ n - 1),kmedals and one seventh of the rest are awarded, which has to be a whole number of medals. On the last day the remainingnmedals are awarded, i.e.r (n - 1) = n.no axioms what this means
Statement uses:
Nat,IntProof uses:
And,Eq,OfNat.ofNat,HSub.hSub,LE.le,Dvd.dvd,HAdd.hAdd,HDiv.hDiv13 instances, coercions and auxiliary constants left out.
abbrev MedalsProcess (m n : ℕ) (r : ℕ → ℤ) : Prop := …
- theorem
Imo1967P6.rec_eqThe day-krule implies the recurrence7 * r k = 6 * (r (k - 1) - k)line 50 sourceSource documentation
The day-
krule implies the recurrence7 * r k = 6 * (r (k - 1) - k).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,Dvd.dvd,OfNat.ofNat,HSub.hSub,Eq,HAdd.hAdd,HDiv.hDiv,HMul.hMulProof uses:
Mathlib.Tactic.Linarith.eq_of_not_lt_of_not_gt,Not.intro,LT.lt,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Neg.neg,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Int.rawCast,inferInstance,Ring,Int.negOfNat,HPow.hPow,Nat.rawCast,Mathlib.Meta.NormNum.instAddMonoidWithOne,Mathlib.Tactic.Ring.Common.neg_congr,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refland 50 more93 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
theorem rec_eq {r : ℕ → ℤ} {k : ℕ} (h7 : 7 ∣ r (k - 1) - ↑k) (hk : r k = r (k - 1) - (↑k + (r (k - 1) - ↑k) / 7)) : 7 * r k = 6 * (r (k - 1) - ↑k) := by … - theorem
Imo1967P6.closed_formSolving the recurrence: afterkdays the number of remaining medals is(6/7)^k * (m - 36) + 36 - 6kline 60 sourceSource documentation
Solving the recurrence: after
kdays the number of remaining medals is(6/7)^k * (m - 36) + 36 - 6k.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Int,Eq,OfNat.ofNat,LE.le,HSub.hSub,HMul.hMul,Rat,HAdd.hAdd,HPow.hPow,HDiv.hDivProof uses:
Nat.recAux,Eq.mpr,id,congrArg,congr,Int.cast_natCast,Nat.cast_zero,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.Common.sub_congr,Mathlib.Tactic.Ring.Common.add_congr,Int.rawCast,inferInstance,Ring,Int.negOfNat,Mathlib.Tactic.Ring.Common.mul_congrand 96 more137 instances, coercions and auxiliary constants left out.
Tactic trace: 19 steps
Open to load the checked before-and-after goal states.
theorem closed_form {m n : ℕ} {r : ℕ → ℤ} (h0 : r 0 = ↑m) (hrec : ∀ k, 1 ≤ k → k ≤ n - 1 → 7 * r k = 6 * (r (k - 1) - ↑k)) : ∀ k, k ≤ n - 1 → (r k : ℚ) = (6 / 7 : ℚ) ^ k * (↑m - 36) + 36 - 6 * ↑k := by … - theorem
Imo1967P6.key_eqSpecializing the closed form atk = n - 1(wherer (n - 1) = n) gives the key Diophantine relation betweenmandnline 85 sourceSource documentation
Specializing the closed form at
k = n - 1(wherer (n - 1) = n) gives the key Diophantine relation betweenmandn.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Int,Eq,HSub.hSub,LE.le,HMul.hMul,HPow.hPowProof uses:
HAdd.hAdd,Exists,Exists.intro,Rat,HDiv.hDiv, Imo1967P6.closed_form,le_rfl,Eq.mpr,id,congrFun',congrArg,Nat.add_sub_cancel,Mathlib.Tactic.Linarith.eq_of_not_lt_of_not_gt,Not.intro,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Int.rawCast,inferInstanceand 99 more141 instances, coercions and auxiliary constants left out.
Tactic trace: 20 steps
Open to load the checked before-and-after goal states.
theorem key_eq {m n : ℕ} (hn : 1 < n) {r : ℕ → ℤ} (h0 : r 0 = ↑m) (hn1 : r (n - 1) = ↑n) (hrec : ∀ k, 1 ≤ k → k ≤ n - 1 → 7 * r k = 6 * (r (k - 1) - ↑k)) : (6 : ℤ) ^ (n - 1) * (↑m - 36) = 7 ^ n * (↑n - 6) := by … - theorem
Imo1967P6.forwardThe forward direction: the Diophantine relation forcesn = 6andm = 36, because6 ^ (n - 1)must dividen - 6while growing much faster line 109 sourceSource documentation
The forward direction: the Diophantine relation forces
n = 6andm = 36, because6 ^ (n - 1)must dividen - 6while growing much faster.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Exists,Int, Imo1967P6.MedalsProcess,Eq,Prod,Prod.mkProof uses:
And,HSub.hSub,LE.le,Dvd.dvd,HAdd.hAdd,HDiv.hDiv,HMul.hMul, Imo1967P6.rec_eq,And.left,And.right,HPow.hPow, Imo1967P6.key_eq,Exists.intro,Eq.symm,Eq.mp,congrArg,congrFun',Nat.add_sub_cancel,IsCoprime,IsCoprime.powand 104 more115 instances, coercions and auxiliary constants left out.
Tactic trace: 48 steps
Open to load the checked before-and-after goal states.
theorem forward {m n : ℕ} (hn : 1 < n) (h : ∃ r : ℕ → ℤ, MedalsProcess m n r) : (m, n) = (36, 6) := by …Mentions: h, Imo1967P6.MedalsProcess
- theorem
Imo1967P6.backwardThe converse direction: withm = 36andn = 6exactly six medals are awarded on each of the six days line 152 sourceSource documentation
The converse direction: with
m = 36andn = 6exactly six medals are awarded on each of the six days.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Exists,Nat,Int, Imo1967P6.MedalsProcess,OfNat.ofNatProof uses:
Exists.intro,ite,LE.le,HSub.hSub,HMul.hMul,And.intro,Eq,And,Dvd.dvd,HAdd.hAdd,HDiv.hDiv,of_eq_true,Eq.trans,True,congr,congrArg,ite_eq_left_of_eq_true,eq_true,Mathlib.Meta.NormNum.isNat_le_true,Mathlib.Meta.NormNum.isNat_ofNatand 26 more37 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.
theorem backward : ∃ r : ℕ → ℤ, MedalsProcess 36 6 r := by …
Mentions: Imo1967P6.MedalsProcess
- determine
Imo1967P6.solutionline 162 sourceno axioms what this means
Statement uses:
Prod,NatProof uses:
Prod.mk,OfNat.ofNat1 instances, coercions and auxiliary constants left out.
- problem
Imo1967P6.imo1967_p6line 164 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LT.lt,OfNat.ofNat,Iff,Exists,Int, Imo1967P6.MedalsProcess,Eq,Prod,Prod.mk, Imo1967P6.solutionProof uses:
Iff.intro,Eq.mpr,id,congrArg,Imo1967P6.solution.eq_1, Imo1967P6.forward,And,Eq.mp,Prod.mk.injEq, Imo1967P6.backward,Eq.symm6 instances, coercions and auxiliary constants left out.
Tactic trace: 10 steps
Open to load the checked before-and-after goal states.