Bandits.ArrayModel.action_eq_and_pullCount_eq_congr
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 π -
π‘ : Type u_2mπ‘ : MeasurableSpace π‘
-
alg : Learning.Algorithm Unit π π‘A stochastic, sequential algorithm. -
a : π -
m : β -
n : β -
Ο : probSpace π π‘Probability space for the array model of stochastic bandits. -
Ο' : probSpace π π‘
-
hΟ1 : β (i : β), Ο.1 i = Ο'.1 i -
hΟ2_ne : β (i : β) (b : π), b β a β Ο.2 i b = Ο'.2 i b -
hΟ2_eq : β (i : β), i + 1 β€ m β Ο.2 i a = Ο'.2 i a
action alg n Ο = a β§ Learning.pullCount (action alg) a n Ο = m β
action alg n Ο' = a β§ Learning.pullCount (action alg) a n Ο' = mMeasurableSpace : 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 : Ξ±`.
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.
Bandits.ArrayModel.probSpace : Type u_1 β Type u_2 β Type (max u_1 u_2)Probability space for the array model of stochastic bandits.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`.Ne : {Ξ± : Sort u} β Ξ± β Ξ± β Prop`a β b`, or `Ne a b` is defined as `Β¬ (a = b)` or `a = b β False`, and asserts that `a` and `b` are not equal. Conventions for notations in identifiers: * The recommended spelling of `β ` in identifiers is `ne`.
HAdd.hAdd : {Ξ± : Type u} β {Ξ² : Type v} β {Ξ³ : outParam (Type w)} β [self : HAdd Ξ± Ξ² Ξ³] β Ξ± β Ξ² β Ξ³`a + b` computes the sum of `a` and `b`. The meaning of this notation is type-dependent. Conventions for notations in identifiers: * The recommended spelling of `+` in identifiers is `add`.
LE.le : {Ξ± : Type u} β [self : LE Ξ±] β Ξ± β Ξ± β PropThe less-equal relation: `x β€ y` Conventions for notations in identifiers: * The recommended spelling of `β€` in identifiers is `le`.
Iff : Prop β Prop β PropIf and only if, or logical bi-implication. `a β b` means that `a` implies `b` and vice versa. By `propext`, this implies that `a` and `b` are equal and hence any expression involving `a` is equivalent to the corresponding expression with `b` instead. Conventions for notations in identifiers: * The recommended spelling of `β` in identifiers is `iff`. * The recommended spelling of `<->` in identifiers is `iff` (prefer `β` over `<->`).
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
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
Code
lemma action_eq_and_pullCount_eq_congr (alg : Algorithm Unit π π‘) (a : π) (m n : β)
{Ο Ο' : probSpace π π‘}
(hΟ1 : β i, Ο.1 i = Ο'.1 i) (hΟ2_ne : β i b, b β a β Ο.2 i b = Ο'.2 i b)
(hΟ2_eq : β i, i + 1 β€ m β Ο.2 i a = Ο'.2 i a) :
(action alg n Ο = a β§ pullCount (action alg) a n Ο = m) β
(action alg n Ο' = a β§ pullCount (action alg) a n Ο' = m)Proof
β¨action_eq_and_pullCount_eq_congr_aux alg a m n hΟ1 hΟ2_ne hΟ2_eq,
action_eq_and_pullCount_eq_congr_aux alg a m n (by grind) (by grind) (by grind)β©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: 11 project declarations, 65 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.