Compfiles/Usa1986P2.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
USA Mathematical Olympiad 1986, Problem 2
Five professors attended a lecture. Each fell asleep just twice. For each pair there was a moment when both were asleep. Show that there was a moment when three of them were asleep.
Imports (7)
Imported by 1 file
- def
Usa1986P2.AsleepEach professorp : Fin 5takes two naps, and napk : Fin 2of professorpis the closed interval[s p k, e p k]line 34 sourceSource documentation
Each professor
p : Fin 5takes two naps, and napk : Fin 2of professorpis the closed interval[s p k, e p k]. Professorpis asleep at timetiftbelongs to one of these two nap intervals.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,RealProof uses:
Exists,And,LE.le3 instances, coercions and auxiliary constants left out.
def Asleep (s e : Fin 5 → Fin 2 → ℝ) (p : Fin 5) (t : ℝ) : Prop := …
- def
Usa1986P2.pairsThe ten pairs of professors, as the 2-element subsets ofFin 5line 40 sourceSource documentation
The ten pairs of professors, as the 2-element subsets of
Fin 5.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Fin,OfNat.ofNat,NatProof uses:
Finset.powersetCard,Finset.univ3 instances, coercions and auxiliary constants left out.
def pairs : Finset (Finset (Fin 5)) := Finset.powersetCard 2 Finset.univ
- abbrev
Usa1986P2.PairSetThe type of pairs of professors line 43 sourceSource documentation
The type of pairs of professors.
standard axioms: Classical.choice, Quot.sound, propext what this means
Proof uses:
Subtype,Finset,Fin,OfNat.ofNat,Nat,Membership.mem, Usa1986P2.pairs3 instances, coercions and auxiliary constants left out.
abbrev PairSet := { A : Finset (Fin 5) // A ∈ pairs } …Mentions: Usa1986P2.pairs
- def
Usa1986P2.candsCandidate "first moments" for a setAof professors: nap-start times of members ofAat which every member ofAis asleep line 50 sourceSource documentation
Candidate "first moments" for a set
Aof professors: nap-start times of members ofAat which every member ofAis asleep.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,FinsetProof uses:
Finset.filter,Membership.mem, Usa1986P2.Asleep,Classical.propDecidable,Finset.biUnion,Finset.image,Finset.univ10 instances, coercions and auxiliary constants left out.
noncomputable def cands (s e : Fin 5 → Fin 2 → ℝ) (A : Finset (Fin 5)) : Finset ℝ := …
- lemma
Usa1986P2.mem_candsMembership incands: a nap-start time of a member ofAat which every member ofAis asleep line 56 sourceSource documentation
Membership in
cands: a nap-start time of a member ofAat which every member ofAis asleep.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Finset,Iff,Membership.mem, Usa1986P2.cands,And,Exists,Eq, Usa1986P2.AsleepProof uses:
id,of_eq_true,Finset.filter,Classical.propDecidable,Finset.biUnion,Finset.image,Finset.univ,Eq.trans,True,congrFun',congrArg,funext,true_and,iff_self16 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma mem_cands {A : Finset (Fin 5)} {u : ℝ} : u ∈ cands s e A ↔ (∃ p ∈ A, ∃ k : Fin 2, s p k = u) ∧ ∀ p ∈ A, Asleep s e p u := by …Mentions: Usa1986P2.cands, Usa1986P2.Asleep
- lemma
Usa1986P2.exists_mem_cands_leDocumented declaration: exists_mem_cands_le line 66 sourceSource documentation
If all members of a nonempty set
Aof professors are asleep at timet, then some nap-start timeu ≤ tof a member ofAis already a moment when all members ofAare asleep.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Finset,Finset.Nonempty,Membership.mem, Usa1986P2.Asleep,Exists,And, Usa1986P2.cands,LE.leProof uses:
Subtype,Subtype.property,Finset.attach,Finset.exists_max_image,Iff.mpr,Finset.attach_nonempty_iff,Exists.intro,And.intro,Eq, Usa1986P2.mem_cands,rfl,Subtype.mk,Finset.mem_attach,LE.le.trans,And.left,And.right,Classical.choose,Classical.choose_spec19 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
lemma exists_mem_cands_le {A : Finset (Fin 5)} (hA : A.Nonempty) {t : ℝ} (ht : ∀ p ∈ A, Asleep s e p t) : ∃ u ∈ cands s e A, u ≤ t := by …Mentions: Usa1986P2.Asleep, Usa1986P2.cands
- def
Usa1986P2.fThe first moment at which all members ofAare simultaneously asleep line 76 sourceSource documentation
The first moment at which all members of
Aare simultaneously asleep.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Finset,Finset.Nonempty, Usa1986P2.candsProof uses:
Finset.min'3 instances, coercions and auxiliary constants left out.
noncomputable def f (s e : Fin 5 → Fin 2 → ℝ) (A : Finset (Fin 5)) (h : (cands s e A).Nonempty) : ℝ := (cands s e A).min' hMentions: h, Usa1986P2.cands
- lemma
Usa1986P2.f_asleepAll members ofAare asleep at the first common moment line 80 sourceSource documentation
All members of
Aare asleep at the first common moment.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Finset,Finset.Nonempty, Usa1986P2.cands,Membership.mem, Usa1986P2.Asleep, Usa1986P2.fProof uses:
Finset.min',Finset.min'_mem,And.right,Exists,And,Eq,Iff.mp, Usa1986P2.mem_cands7 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma f_asleep {A : Finset (Fin 5)} {h : (cands s e A).Nonempty} : ∀ p ∈ A, Asleep s e p (f s e A h) := by …Mentions: h, Usa1986P2.cands, Usa1986P2.Asleep, Usa1986P2.f
- lemma
Usa1986P2.f_memThe first common moment is a nap-start time of some member ofAline 86 sourceSource documentation
The first common moment is a nap-start time of some member of
A.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Finset,Finset.Nonempty, Usa1986P2.cands,Exists,And,Membership.mem,Eq, Usa1986P2.fProof uses:
Finset.min',Finset.min'_mem,And.left, Usa1986P2.Asleep,Iff.mp, Usa1986P2.mem_cands,Exists.intro,And.intro,Eq.symm9 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
lemma f_mem {A : Finset (Fin 5)} {h : (cands s e A).Nonempty} : ∃ p ∈ A, ∃ k : Fin 2, f s e A h = s p k := by …Mentions: h, Usa1986P2.cands, Usa1986P2.f
- lemma
Usa1986P2.f_leThe first common moment is at most any moment at which all members ofAare asleep line 94 sourceSource documentation
The first common moment is at most any moment at which all members of
Aare asleep.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Finset,Finset.Nonempty, Usa1986P2.cands,Membership.mem, Usa1986P2.Asleep,LE.le, Usa1986P2.fProof uses:
And,Exists, Usa1986P2.exists_mem_cands_le,LE.le.trans,Finset.min',Exists.intro,Finset.min'_le12 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma f_le {A : Finset (Fin 5)} (hA : A.Nonempty) {h : (cands s e A).Nonempty} {t : ℝ} (ht : ∀ p ∈ A, Asleep s e p t) : f s e A h ≤ t := by …Mentions: h, Usa1986P2.cands, Usa1986P2.Asleep, Usa1986P2.f
- lemma
Usa1986P2.cands_nonemptyPairs of professors have candidate first moments line 100 sourceSource documentation
Pairs of professors have candidate first moments.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Ne,Exists,And, Usa1986P2.Asleep,Finset,Eq,Finset.card,Finset.Nonempty, Usa1986P2.candsProof uses:
Insert.insert,Singleton.singleton,Iff.mp,Finset.card_eq_two,Membership.mem,Or,Eq.mp,congrArg,propext,Finset.mem_singleton,Finset.mem_insert,LE.le, Usa1986P2.exists_mem_cands_le,Exists.intro,Finset.mem_insert_self,Eq.symm12 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
lemma cands_nonempty (hsleep : ∀ p q : Fin 5, p ≠ q → ∃ t, Asleep s e p t ∧ Asleep s e q t) {A : Finset (Fin 5)} (hA : A.card = 2) : (cands s e A).Nonempty := by …Mentions: Usa1986P2.Asleep, Usa1986P2.cands
- def
Usa1986P2.FThe first moment when both members of a pairAare asleep line 115 sourceSource documentation
The first moment when both members of a pair
Aare asleep.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Ne,Exists,And, Usa1986P2.Asleep, Usa1986P2.PairSetProof uses: Usa1986P2.f,
Finset,Membership.mem, Usa1986P2.pairs6 instances, coercions and auxiliary constants left out.
noncomputable def F (hsleep : ∀ p q : Fin 5, p ≠ q → ∃ t, Asleep s e p t ∧ Asleep s e q t) (A : PairSet) : ℝ := …Mentions: Usa1986P2.Asleep, Usa1986P2.PairSet
- lemma
Usa1986P2.F_asleepBoth members of a pair are asleep at the pair's first common moment line 121 sourceSource documentation
Both members of a pair are asleep at the pair's first common moment.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Ne,Exists,And, Usa1986P2.Asleep, Usa1986P2.PairSet,Membership.mem,Finset, Usa1986P2.pairs, Usa1986P2.FProof uses: Usa1986P2.f_asleep
9 instances, coercions and auxiliary constants left out.
lemma F_asleep (hsleep : ∀ p q : Fin 5, p ≠ q → ∃ t, Asleep s e p t ∧ Asleep s e q t) (A : PairSet) {p : Fin 5} (hp : p ∈ A.1) : Asleep s e p (F hsleep A) := …Mentions: Usa1986P2.Asleep, Usa1986P2.PairSet, Usa1986P2.F
- lemma
Usa1986P2.F_memA pair's first common moment is a falling-asleep event: it is the start time of a nap of one of the two members line 128 sourceSource documentation
A pair's first common moment is a falling-asleep event: it is the start time of a nap of one of the two members.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Ne,Exists,And, Usa1986P2.Asleep, Usa1986P2.PairSet,Membership.mem,Finset, Usa1986P2.pairs,Eq, Usa1986P2.FProof uses: Usa1986P2.f_mem
9 instances, coercions and auxiliary constants left out.
lemma F_mem (hsleep : ∀ p q : Fin 5, p ≠ q → ∃ t, Asleep s e p t ∧ Asleep s e q t) (A : PairSet) : ∃ p ∈ A.1, ∃ k : Fin 2, F hsleep A = s p k := …Mentions: Usa1986P2.Asleep, Usa1986P2.PairSet, Usa1986P2.F
- problem
Usa1986P2.usa1986_p2line 135 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fin,OfNat.ofNat,Nat,Real,Ne,Exists,And, Usa1986P2.AsleepProof uses:
Eq,Finset.card,Finset, Usa1986P2.pairs,Eq.mpr,Finset.powersetCard,Finset.univ,id,congrArg,Usa1986P2.pairs.eq_1,Nat.choose,Finset.card_powersetCard,Fintype.card,Finset.card_univ,Fintype.card_fin,of_decide_eq_true,Bool,Decidable.decide,Bool.true,Eq.refland 78 more52 instances, coercions and auxiliary constants left out.
Tactic trace: 90 steps
Open to load the checked before-and-after goal states.