Learning.Environment.comap_id
Lemma
No docstring.
Types
-
𝓞 : Type u_1m𝓞 : MeasurableSpace 𝓞A measurable space is a space equipped with a σ-algebra. -
𝓐 : Type u_4m𝓐 : MeasurableSpace 𝓐 -
𝓨 : Type u_7m𝓨 : MeasurableSpace 𝓨
Given
-
env : Environment 𝓞 𝓐 𝓨A stochastic environment.
Then
env.comap (fun x => id) ⋯ id ⋯ = envMeasurableSpace : Type u_6 → Type u_6A measurable space is a space equipped with a σ-algebra.
Learning.Environment : (𝓞 : Type u_5) →
(𝓐 : Type u_6) →
(𝓨 : Type u_7) → [MeasurableSpace 𝓞] → [MeasurableSpace 𝓐] → [MeasurableSpace 𝓨] → Type (max (max u_5 u_6) u_7)A stochastic environment. At each round, an observation is drawn prior to the algorithm taking an action. Then the environment provides feedback based on the observation and the action.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`.Learning.Environment.comap : {𝓞 : Type u_1} →
{𝓐 : Type u_4} →
{𝓐' : Type u_5} →
{𝓨 : Type u_7} →
{m𝓞 : MeasurableSpace 𝓞} →
{m𝓐 : MeasurableSpace 𝓐} →
{m𝓐' : MeasurableSpace 𝓐'} →
{m𝓨 : MeasurableSpace 𝓨} →
Learning.Environment 𝓞 𝓐 𝓨 →
(F : (n : ℕ) → Learning.Hist 𝓞 𝓐' 𝓨 n → Learning.Hist 𝓞 𝓐 𝓨 n) →
(∀ (n : ℕ), Measu…The environment that reads the summary `F n` of the past rounds and reads `f a` when the algorithm plays `a` in the current round. This is the primitive transport operation on environments, dual to `Algorithm.comap`: `Environment.comapAction` is the special case in which `F n` is the round-wise map of the actions. Only the action can change type, since the observations and the feedbacks are outputs of the environment; `F n` can nonetheless forget or summarize the past rounds, as an environment that reads only the last round does.Go to its page
id : {α : Sort u} → α → αThe identity function. `id` takes an implicit argument `α : Sort u` (a type in any universe), and an argument `a : α`, and returns `a`. Although this may look like a useless function, one application of the identity function is to explicitly put a type on an expression. If `e` has type `T`, and `T'` is definitionally equal to `T`, then `@id T' e` typechecks, and Lean knows that this expression has type `T'` rather than `T`. This can make a difference for typeclass inference, since `T` and `T'` may have different typeclass instances on them. `show T' from e` is sugar for an `@id T' e` expression.
Code
lemma Environment.comap_id (env : Environment 𝓞 𝓐 𝓨) :
env.comap (fun _ ↦ id) (fun _ ↦ measurable_id) id measurable_id = envProof
rfl
Meaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10).
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: 4 project declarations, 16 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.