Learning.pullCount_le_add
No docstring.
Learning.pullCount_le_add.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (n C : โ) (ฯ : ฮฉ) : pullCount A a n ฯ โค C + 1 + โ s โ Finset.range n, Set.indicator {s | A s ฯ = a โง C < pullCount A a s ฯ} 1 sLearning.pullCount_le_add.{u_1, u_3} {๐ : Type u_1} {ฮฉ : Type u_3} [DecidableEq ๐] {A : โ โ ฮฉ โ ๐} (a : ๐) (n C : โ) (ฯ : ฮฉ) : pullCount A a n ฯ โค C + 1 + โ s โ Finset.range n, Set.indicator {s | A s ฯ = a โง C < pullCount A a s ฯ} 1 s
Code
lemma pullCount_le_add (a : ๐) (n C : โ) (ฯ : ฮฉ) :
pullCount A a n ฯ โค C + 1 +
โ s โ range n, {s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 sProof
by
rw [pullCount_eq_sum]
calc โ s โ range n, if A s ฯ = a then 1 else 0
_ โค โ s โ range n, ({s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s +
{s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 s) := by
gcongr with s hs
simp [Set.indicator_apply]
grind
_ = โ s โ range n, {s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s +
โ s โ range n, {s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 s := by
rw [Finset.sum_add_distrib]
_ โค C + 1 + โ s โ range n, {s | A s ฯ = a โง C < pullCount A a s ฯ}.indicator 1 s := by
gcongr
have h_le n : โ s โ range n, {s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s โค
pullCount A a n ฯ := by
rw [pullCount_eq_sum]
gcongr with s hs
simp only [Set.indicator_apply, Set.mem_ofPred_eq, Pi.one_apply]
grind
induction n with
| zero => simp
| succ n hn =>
rw [Finset.sum_range_succ]
rcases le_or_gt (pullCount A a n ฯ) C with h_pc | h_pc
ยท have hn' : โ s โ range n, {s | A s ฯ = a โง pullCount A a s ฯ โค C}.indicator 1 s โค C :=
(h_le n).trans h_pc
grw [hn']
gcongr
simp only [Set.indicator_apply, Set.mem_ofPred_eq, Pi.one_apply]
grind
ยท refine le_trans ?_ hn
simp [h_pc]Actions: Source ยท Open Issue
Meaning unchanged since v4.33.0-rc1-29-gce231eb, the oldest revision on record (2026-07-30).
Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file ยท open it in the Lean web editor.
Dependency graph
Audit surface: 1 project declarations, 25 external constants
โ Proved: no sorry anywhere in its closure
This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.