Bandits.ClippedUCB.ucb_eq_ucb'
No docstring.
-
ฮฉ : Type u_1
-
K : โ -
l : โ -
u : โ -
ฯ2 : โ -
ฮด : โ -
A : โ โ ฮฉ โ Fin K -
R : โ โ ฮฉ โ โ -
O : โ โ ฮฉ โ Unit -
a : Fin K -
n : โ -
ฯ : ฮฉ
ucb A R l u ฯ2 ฮด a n ฯ = ucb' n (Learning.history O A R n ฯ) l u ฯ2 ฮด aNat : TypeThe natural numbers, starting at zero. This type is special-cased by both the kernel and the compiler, and overridden with an efficient implementation. Both use a fast arbitrary-precision arithmetic library (usually [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
Real : TypeThe type `โ` of real numbers constructed as equivalence classes of Cauchy sequences of rational numbers.
Fin : โ โ TypeNatural numbers less than some upper bound. In particular, a `Fin n` is a natural number `i` with the constraint that `i < n`. It is the canonical type with `n` elements.
Unit : TypeThe canonical type with one element. This element is written `()`. `Unit` has a number of uses: * It can be used to model control flow that returns from a function call without providing other information. * Monadic actions that return `Unit` have side effects without computing values. * In polymorphic types, it can be used to indicate that no data is to be stored in a particular field.
Eq : {ฮฑ : Sort u_1} โ ฮฑ โ ฮฑ โ PropThe equality relation. It has one introduction rule, `Eq.refl`.
We use `a = b` as notation for `Eq a b`.
A fundamental property of equality is that it is an equivalence relation.
```
variable (ฮฑ : Type) (a b c d : ฮฑ)
variable (hab : a = b) (hcb : c = b) (hcd : c = d)
example : a = d :=
Eq.trans (Eq.trans hab (Eq.symm hcb)) hcd
```
Equality is much more than an equivalence relation, however. It has the important property that every assertion
respects the equivalence, in the sense that we can substitute equal expressions without changing the truth value.
That is, given `h1 : a = b` and `h2 : p a`, we can construct a proof for `p b` using substitution: `Eq.subst h1 h2`.
Example:
```
example (ฮฑ : Type) (a b : ฮฑ) (p : ฮฑ โ Prop)
(h1 : a = b) (h2 : p a) : p b :=
Eq.subst h1 h2
example (ฮฑ : Type) (a b : ฮฑ) (p : ฮฑ โ Prop)
(h1 : a = b) (h2 : p a) : p b :=
h1 โธ h2
```
The triangle in the second presentation is a macro built on top of `Eq.subst` and `Eq.symm`, and you can enter it by typing `\t`.
For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
Conventions for notations in identifiers:
* The recommended spelling of `=` in identifiers is `eq`.Bandits.ClippedUCB.ucb : {K : โ} โ {ฮฉ : Type u_1} โ (โ โ ฮฉ โ Fin K) โ (โ โ ฮฉ โ โ) โ โ โ โ โ โ โ โ โ Fin K โ โ โ ฮฉ โ โClipped upper confidence bound used in the regret analysis of Thompson sampling.Go to its page
Bandits.ClippedUCB.ucb' : {K : โ} โ (n : โ) โ Learning.Hist Unit (Fin K) โ n โ โ โ โ โ โ โ โ โ Fin K โ โClipped upper confidence bound (history-based version).Go to its page
Learning.history : {๐ : Type u_1} โ
{๐ : Type u_2} โ
{๐จ : Type u_3} โ {ฮฉ : Type u_4} โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ ๐จ) โ (n : โ) โ ฮฉ โ Learning.Hist ๐ ๐ ๐จ nHistory of the algorithm-environment sequence before time `n`: the rounds at times `0, ..., n - 1`.Go to its page
Code
lemma ucb_eq_ucb' {O : โ โ ฮฉ โ Unit} {a : Fin K} {n : โ} {ฯ : ฮฉ} :
ucb A R l u ฯ2 ฮด a n ฯ = ucb' n (history O A R n ฯ) l u ฯ2 ฮด aProof
by have hp : pullCount A a n ฯ = pullCount' n (history O A R n ฯ) a := pullCount_eq_pullCount' have he : empMean A R a n ฯ = empMean' n (history O A R n ฯ) a := empMean_eq_empMean' rw [ucb, ucb', hp, he]
Meaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10), the 2th recorded change.
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: 13 project declarations, 52 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.