Compfiles/Imo2016P4.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 2016, Problem 4
A set of positive integers is called fragrant if it contains at least two elements and each of its elements has a prime factor in common with at least one of the other elements. Let P(n) = n² + n + 1. What is the least possible value of positive integer b such that there exists a non-negative integer a for which the set
{ P(a + 1), P(a + 2), ..., P(a + b) }
is fragrant?
Imports (2)
Imported by 1 file
- abbrev
Imo2016P4.Fragrantline 34 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Set,PNatProof uses:
And,LE.le,Nat,OfNat.ofNat,Set.ncard,Membership.mem,Exists,Ne,Not,Nat.Coprime4 instances, coercions and auxiliary constants left out.
- abbrev
Imo2016P4.Pline 37 sourcestandard axioms: propext what this means
Statement uses:
NatProof uses:
HAdd.hAdd,HPow.hPow,OfNat.ofNat7 instances, coercions and auxiliary constants left out.
- lemma
Imo2016P4.P_injline 41 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Function.Injective,Nat, Imo2016P4.PProof uses:
StrictMono.injective,strictMono_nat_of_lt_succ,Eq.mpr,LT.lt,HAdd.hAdd,OfNat.ofNat,HPow.hPow,HMul.hMul,id,Eq,congr,congrArg,Eq.trans,Nat.rawCast,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.symm,Eq.refland 36 more35 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2016P4.ncard_setline 44 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,PNat,Eq,Set.ncard,Set.ofPred,Exists,And,LE.le, Imo2016P4.P,HAdd.hAddProof uses:
Set,Set.image,Subtype,LT.lt,OfNat.ofNat,Subtype.mk,add_pos',HPow.hPow,pow_pos,Right.add_pos_of_nonneg_of_pos,zero_le,PNat.pos,Mathlib.Meta.Positivity.pos_of_isNat,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Nat.ble,Set.Icc,Set.ext,idand 30 more76 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2016P4.two_not_dvd_Pline 65 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Dvd.dvd,OfNat.ofNat, Imo2016P4.PProof uses:
HMul.hMul,HAdd.hAdd,Even.two_dvd,Nat.even_mul_succ_self10 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2016P4.nine_not_dvd_Pline 69 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Dvd.dvd,OfNat.ofNat, Imo2016P4.PProof uses:
Or,Eq,HMul.hMul,HAdd.hAdd,Exists,False,Exists.intro,HDiv.hDiv,Eq.symm17 instances, coercions and auxiliary constants left out.
Tactic trace: 5 steps
Open to load the checked before-and-after goal states.
- lemma
Imo2016P4.dvd_of_dvd_two_mulline 74 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Dvd.dvd,OfNat.ofNat,HMul.hMulProof uses:
Nat.Coprime.dvd_of_dvd_mul_left,Nat.Coprime.symm,Iff.mpr,Nat.Coprime,Nat.Prime.coprime_iff_not_dvd,Nat.prime_two8 instances, coercions and auxiliary constants left out.
- lemma
Imo2016P4.gcd_P_dvd_of_eqA common divisor ofP (b + k)andP bdividescwheneverP (b + k) - P b = 2 * c, since values ofPare odd line 79 sourceSource documentation
A common divisor of
P (b + k)andP bdividescwheneverP (b + k) - P b = 2 * c, since values ofPare odd.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,HAdd.hAdd, Imo2016P4.P,HMul.hMul,OfNat.ofNat,Dvd.dvd,Nat.gcdProof uses:
Not, Imo2016P4.two_not_dvd_P,Dvd.dvd.trans,Nat.gcd_dvd_right, Imo2016P4.dvd_of_dvd_two_mul,Iff.mp,Nat.dvd_add_right,Eq.mpr,id,congrArg,Nat.gcd_dvd_left13 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma gcd_P_dvd_of_eq {b k c : ℕ} (h : P b + 2 * c = P (b + k)) : (P (b + k)).gcd (P b) ∣ c := by …Mentions: h, Imo2016P4.P
- lemma
Imo2016P4.coprime_P_succAdjacent values ofPare coprime: a common divisor divides(P (b+1) - P b) / 2 = b + 1, hence dividesP b - b*(b+1) = 1line 89 sourceSource documentation
Adjacent values of
Pare coprime: a common divisor divides(P (b+1) - P b) / 2 = b + 1, hence dividesP b - b*(b+1) = 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Coprime, Imo2016P4.P,HAdd.hAdd,OfNat.ofNatProof uses:
Eq.mpr,Eq,Nat.gcd,id,congrArg,propext,Nat.coprime_iff_gcd_eq_one,Dvd.dvd, Imo2016P4.gcd_P_dvd_of_eq,Mathlib.Tactic.Ring.of_eq,HMul.hMul,Nat.rawCast,HPow.hPow,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,rfl,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.cast_posand 35 more29 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma coprime_P_succ (b : ℕ) : Nat.Coprime (P (b + 1)) (P b) := by …
Mentions: Imo2016P4.P
- lemma
Imo2016P4.gcd_P_add_two_dvdThe gcd of values ofPat distance two divides 7 line 97 sourceSource documentation
The gcd of values of
Pat distance two divides 7.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Dvd.dvd,Nat.gcd, Imo2016P4.P,HAdd.hAdd,OfNat.ofNatProof uses:
Eq.mpr,id,Eq,congrArg,rfl,Nat.gcd_dvd_right,HMul.hMul, Imo2016P4.gcd_P_dvd_of_eq,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,HPow.hPow,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Tactic.Ring.Common.pow_add,Mathlib.Tactic.Ring.Common.single_powand 31 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
lemma gcd_P_add_two_dvd (b : ℕ) : (P (b + 2)).gcd (P b) ∣ 7 := by …
Mentions: Imo2016P4.P
- lemma
Imo2016P4.gcd_P_add_three_dvdThe gcd of values ofPat distance three divides 3 line 110 sourceSource documentation
The gcd of values of
Pat distance three divides 3.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Dvd.dvd,Nat.gcd, Imo2016P4.P,HAdd.hAdd,OfNat.ofNatProof uses:
Eq.mpr,id,Eq,congrArg,rfl,Nat.gcd_dvd_right,HMul.hMul, Imo2016P4.gcd_P_dvd_of_eq,Mathlib.Tactic.Ring.of_eq,Nat.rawCast,HPow.hPow,Mathlib.Tactic.Ring.Common.add_congr,Mathlib.Tactic.Ring.Common.pow_congr,Mathlib.Tactic.Ring.Common.atom_pf,Eq.symm,Eq.refl,Mathlib.Tactic.Ring.cast_pos,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Tactic.Ring.Common.pow_add,Mathlib.Tactic.Ring.Common.single_powand 59 more40 instances, coercions and auxiliary constants left out.
Tactic trace: 31 steps
Open to load the checked before-and-after goal states.
lemma gcd_P_add_three_dvd (b : ℕ) : (P (b + 3)).gcd (P b) ∣ 3 := by …
Mentions: Imo2016P4.P
- lemma
Imo2016P4.seven_dvd_P_of_not_coprimeIf values ofPat distance two have a common factor, that factor is 7 line 134 sourceSource documentation
If values of
Pat distance two have a common factor, that factor is 7.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Nat.Coprime, Imo2016P4.P,HAdd.hAdd,OfNat.ofNat,And,Dvd.dvdProof uses:
Eq,Nat.gcd,Or.resolve_left,Iff.mp,Or,Nat.dvd_prime,Mathlib.Meta.NormNum.isNat_prime_2,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Bool.true,Mathlib.Meta.NormNum.isNat_minFac_4,Mathlib.Meta.NormNum.IsNat.raw_refl,Mathlib.Meta.NormNum.minFacHelper_0,Bool.false, Imo2016P4.gcd_P_add_two_dvd,Eq.mp,congrArg,propext,Nat.coprime_iff_gcd_eq_oneand 4 more9 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma seven_dvd_P_of_not_coprime {b : ℕ} (h : ¬Nat.Coprime (P (b + 2)) (P b)) : 7 ∣ P (b + 2) ∧ 7 ∣ P b := by …Mentions: h, Imo2016P4.P
- lemma
Imo2016P4.three_dvd_P_of_not_coprimeIf values ofPat distance three have a common factor, that factor is 3 line 142 sourceSource documentation
If values of
Pat distance three have a common factor, that factor is 3.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Not,Nat.Coprime, Imo2016P4.P,HAdd.hAdd,OfNat.ofNat,And,Dvd.dvdProof uses:
Eq,Nat.gcd,Or.resolve_left,Iff.mp,Or,Nat.dvd_prime,Mathlib.Meta.NormNum.isNat_prime_2,Mathlib.Meta.NormNum.isNat_ofNat,Eq.refl,Bool,Bool.true,Mathlib.Meta.NormNum.isNat_minFac_4,Mathlib.Meta.NormNum.IsNat.raw_refl,Mathlib.Meta.NormNum.minFacHelper_0,Bool.false, Imo2016P4.gcd_P_add_three_dvd,Eq.mp,congrArg,propext,Nat.coprime_iff_gcd_eq_oneand 3 more9 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma three_dvd_P_of_not_coprime {b : ℕ} (h : ¬Nat.Coprime (P (b + 3)) (P b)) : 3 ∣ P (b + 3) ∧ 3 ∣ P b := by …Mentions: h, Imo2016P4.P
- determine
Imo2016P4.Solutionline 154 sourcestandard axioms: propext what this means
Statement uses:
PNatProof uses:
OfNat.ofNat2 instances, coercions and auxiliary constants left out.
- problem
Imo2016P4.imo2016_p4line 156 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
IsLeast,PNat,Set.ofPred,Exists,Nat, Imo2016P4.Fragrant,And,LE.le,Eq, Imo2016P4.P,HAdd.hAdd, Imo2016P4.SolutionProof uses:
Eq.mpr,OfNat.ofNat,id,congrArg,Imo2016P4.Solution.eq_1,And.intro,Membership.mem,Set,lowerBounds,Exists.intro,Set.ncard,Ne,Not,Nat.Coprime, Imo2016P4.ncard_set,of_eq_true,eq_true_of_decide,Eq.refl,Bool,Bool.trueand 76 more84 instances, coercions and auxiliary constants left out.
Tactic trace: 197 steps
Open to load the checked before-and-after goal states.