Bandits.ArrayModel.measurable_indicator_action_eq_and_pullCount_eq
No docstring.
-
๐ : Type u_1m๐ : MeasurableSpace ๐A measurable space is a space equipped with a ฯ-algebra.Nonempty ๐StandardBorelSpace ๐A standard Borel space is a measurable space arising as the Borel sets of some Polish topology.DecidableEq ๐Countable ๐A typeฮฑis countable if there exists an injective mapฮฑ โ โ. -
๐ก : Type u_2m๐ก : MeasurableSpace ๐ก
-
alg : Learning.Algorithm Unit ๐ ๐กA stochastic, sequential algorithm. -
a : ๐ -
m : โ -
n : โ
Measurable ({ฯ | action alg n ฯ = a โง Learning.pullCount (action alg) a n ฯ = m}.indicator fun x => 1)A function f between measurable spaces is measurable if the preimage of every measurable set is measurable.MeasurableSpace : Type u_6 โ Type u_6A measurable space is a space equipped with a ฯ-algebra.
Nonempty : Sort u โ Prop`Nonempty ฮฑ` is a typeclass that says that `ฮฑ` is not an empty type, that is, there exists an element in the type. It differs from `Inhabited ฮฑ` in that `Nonempty ฮฑ` is a `Prop`, which means that it does not actually carry an element of `ฮฑ`, only a proof that *there exists* such an element. Given `Nonempty ฮฑ`, you can construct an element of `ฮฑ` *nonconstructively* using `Classical.choice`.
StandardBorelSpace : (ฮฑ : Type u_1) โ [MeasurableSpace ฮฑ] โ PropA standard Borel space is a measurable space arising as the Borel sets of some Polish topology. This is useful in situations where a space has no natural topology or the natural topology in a space is non-Polish. To endow a standard Borel space `ฮฑ` with a compatible Polish topology, use `letI := upgradeStandardBorel ฮฑ`. One can then use `eq_borel_upgradeStandardBorel ฮฑ` to rewrite the `MeasurableSpace ฮฑ` instance to `borel ฮฑ t`, where `t` is the new topology.
DecidableEq : Sort u โ Sort (max 1 u)Propositional equality is `Decidable` for all elements of a type. In other words, an instance of `DecidableEq ฮฑ` is a means of deciding the proposition `a = b` is for all `a b : ฮฑ`.
Countable : Sort u โ PropA type `ฮฑ` is countable if there exists an injective map `ฮฑ โ โ`.
Learning.Algorithm : (๐ : Type u_5) โ
(๐ : Type u_6) โ
(๐จ : Type u_7) โ [MeasurableSpace ๐] โ [MeasurableSpace ๐] โ [MeasurableSpace ๐จ] โ Type (max (max u_5 u_6) u_7)A stochastic, sequential algorithm. At each round, it sees an observation in `๐`, then takes an action in `๐`, and finally receives feedback in `๐จ`. The action is a random function of the past rounds and the current observation.Go to its page
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.
Nat : 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.
Measurable : {ฮฑ : Type u_1} โ {ฮฒ : Type u_2} โ [MeasurableSpace ฮฑ] โ [MeasurableSpace ฮฒ] โ (ฮฑ โ ฮฒ) โ PropA function `f` between measurable spaces is measurable if the preimage of every measurable set is measurable.
Set.ofPred : {ฮฑ : Type u} โ (ฮฑ โ Prop) โ Set ฮฑTurn a predicate `p : ฮฑ โ Prop` into a set, also written as `{x | p x}`Bandits.ArrayModel.action : {๐ : Type u_1} โ
{๐ก : Type u_2} โ
{m๐ : MeasurableSpace ๐} โ
{m๐ก : MeasurableSpace ๐ก} โ
[Nonempty ๐] โ
[StandardBorelSpace ๐] โ
[DecidableEq ๐] โ Learning.Algorithm Unit ๐ ๐ก โ โ โ Bandits.ArrayModel.probSpace ๐ ๐ก โ ๐Action taken at time `n` in the array model.Go to its page
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`.And : Prop โ Prop โ Prop`And a b`, or `a โง b`, is the conjunction of propositions. It can be constructed and destructed like a pair: if `ha : a` and `hb : b` then `โจha, hbโฉ : a โง b`, and if `h : a โง b` then `h.left : a` and `h.right : b`. Conventions for notations in identifiers: * The recommended spelling of `โง` in identifiers is `and`.
Learning.pullCount : {๐ : Type u_2} โ {ฮฉ : Type u_4} โ [DecidableEq ๐] โ (โ โ ฮฉ โ ๐) โ ๐ โ โ โ ฮฉ โ โNumber of times action `a` was chosen up to time `t` (excluding `t`).Go to its page
Set.indicator : {ฮฑ : Type u_1} โ {M : Type u_3} โ [Zero M] โ Set ฮฑ โ (ฮฑ โ M) โ ฮฑ โ M`Set.indicator s f a` is `f a` if `a โ s`, `0` otherwise.
Code
lemma measurable_indicator_action_eq_and_pullCount_eq [Countable ๐] (alg : Algorithm Unit ๐ ๐ก)
(a : ๐) (m n : โ) :
Measurable[MeasurableSpace.comap (truncRow a m) inferInstance]
(({ฯ | action alg n ฯ = a โง pullCount (action alg) a n ฯ = m}).indicator (fun _ โฆ 1))Proof
by
let f := ({ฯ | action alg n ฯ = a โง pullCount (action alg) a n ฯ = m}).indicator (fun _ โฆ 1)
have h_eq : f = f โ truncRow a m := by
ext ฯ
exact indicator_action_eq_and_pullCount_eq_congr alg a m n (fun _ โฆ rfl)
(fun _ _ hb โฆ by simp [truncRow, hb]) (fun i hi โฆ by simp [truncRow, show i < m by omega])
change Measurable[MeasurableSpace.comap (truncRow a m) inferInstance] f
rw [h_eq]
exact (Measurable.indicator (by fun_prop)
(measurableSet_action_eq_and_pullCount_eq alg a n m)).comp (Measurable.of_comap_le le_rfl)Meaning last changed in v4.35.0-rc2-1-g61e506b (2026-09-22), the 5th 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: 12 project declarations, 73 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.