Compfiles/Usa2006P1.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
USA Mathematical Olympiad 2006, Problem 1
Let p be a prime number and let s be an integer with 0 < s < p. Prove that there exist integers m and n with 0 < m < n < p and
{sm/p} < {sn/p} < s/p,
where {x} = x − ⌊x⌋ denotes the fractional part of x, if and only if s is not a divisor of p − 1.
Imports (5)
Imported by 1 file
- lemma
Usa2006P1.residue_ne_zeroIfpis prime and0 < s, k < p, thens * k ≢ 0 (mod p)line 59 sourceSource documentation
If
pis prime and0 < s, k < p, thens * k ≢ 0 (mod p).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,OfNat.ofNat,Ne,HMod.hMod,HMul.hMulProof uses:
Eq,Dvd.dvd,Nat.dvd_of_mod_eq_zero,Or,False,Iff.mp,Nat.Prime.dvd_mul,absurd,LE.le,Nat.le_of_dvd,not_le_of_gt16 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
lemma residue_ne_zero {p s : ℕ} (hp : p.Prime) (hs0 : 0 < s) (hs1 : s < p) {k : ℕ} (hk0 : 0 < k) (hk1 : k < p) : (s * k) % p ≠ 0 := by … - def
Usa2006P1.gThe residue of1 + k * tmodulopline 68 sourceSource documentation
The residue of
1 + k * tmodulop.no axioms what this means
Statement uses:
NatProof uses:
HMod.hMod,HAdd.hAdd,OfNat.ofNat,HMul.hMul7 instances, coercions and auxiliary constants left out.
def g (p t k : ℕ) : ℕ := (1 + k * t) % p
- lemma
Usa2006P1.fract_iff_modThe fractional part inequalities are equivalent to inequalities of residues line 71 sourceSource documentation
The fractional part inequalities are equivalent to inequalities of residues.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,Iff,Exists,And,LT.lt,OfNat.ofNat,Rat,Int.fract,HDiv.hDiv,HMul.hMul,HMod.hModProof uses:
cast,Eq.symm,Eq.trans,congrFun',congrArg,Nat.cast_zero,Nat.Prime.pos,Eq.mpr,id,Eq,Nat.cast_mul,Int.fract_div_natCast_eq_div_natCast_mod,propext,div_lt_div_iff_of_pos_right,Nat.cast_lt,Iff.rfl,Iff.intro,Exists.intro,And.intro,Iff.mpand 1 more80 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma fract_iff_mod (p s : ℕ) (hp : p.Prime) : (∃ m n : ℕ, 0 < m ∧ m < n ∧ n < p ∧ Int.fract ((s : ℚ) * m / p) < Int.fract ((s : ℚ) * n / p) ∧ Int.fract ((s : ℚ) * n / p) < (s : ℚ) / p) ↔ ∃ m n : ℕ, 0 < m ∧ m < n ∧ n < p ∧ (s * m) % p < (s * n) % p ∧ (s * n) % p < s := by … - lemma
Usa2006P1.mod_iff_not_dvdCore statement: suitable residues exist iffsdoes not dividep - 1line 92 sourceSource documentation
Core statement: suitable residues exist iff
sdoes not dividep - 1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,OfNat.ofNat,Iff,Exists,And,HMod.hMod,HMul.hMul,Not,Dvd.dvd,HSub.hSubProof uses:
Nat.Prime.pos,LE.le,Nat.Prime.two_le,NeZero,NeZero.mk,LT.lt.ne',Fact,Fact.mk,Ne,ZMod,Eq,ZMod.val,congrArg,Eq.mp,ZMod.val_zero,Nat.mod_eq_of_lt,ZMod.val_natCast,Neg.neg,Inv.inv,Exists.introand 106 more159 instances, coercions and auxiliary constants left out.
Tactic trace: 230 steps (first 200 of 230)
Open to load the checked before-and-after goal states.
lemma mod_iff_not_dvd {p s : ℕ} (hp : p.Prime) (hs0 : 0 < s) (hs1 : s < p) : (∃ m n : ℕ, 0 < m ∧ m < n ∧ n < p ∧ (s * m) % p < (s * n) % p ∧ (s * n) % p < s) ↔ ¬ s ∣ p - 1 := by … - problem
Usa2006P1.usa2006_p1line 306 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Nat.Prime,LT.lt,OfNat.ofNat,Iff,Exists,And,Rat,Int.fract,HDiv.hDiv,HMul.hMul,Not,Dvd.dvd,HSub.hSubProof uses:
Eq.mpr,HMod.hMod,id,Eq,congrArg,propext, Usa2006P1.fract_iff_mod, Usa2006P1.mod_iff_not_dvd35 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.