LeanMachineLearning

Learning.Algorithm.comap๐Ÿ”—

Definition

From the authors

The algorithm with observations in ๐“ž' and feedbacks in ๐“จ' obtained from alg : Algorithm ๐“ž ๐“ ๐“จ by transforming the pair (past rounds, current observation) by F n at each round n before applying the policy of alg.

This is the primitive transport operation on algorithms: Algorithm.comapObs and Algorithm.comapFeedback are the special cases in which F n is a round-wise map of the observation and of the feedback.

Types
  • ๐“ž : Type u_1m๐“ž : MeasurableSpace ๐“žA measurable space is a space equipped with a ฯƒ-algebra.
  • ๐“ž' : Type u_2m๐“ž' : MeasurableSpace ๐“ž'
  • ๐“ : Type u_4m๐“ : MeasurableSpace ๐“
  • ๐“จ : Type u_7m๐“จ : MeasurableSpace ๐“จ
  • ๐“จ' : Type u_8m๐“จ' : MeasurableSpace ๐“จ'
Given
  • alg : Algorithm ๐“ž ๐“ ๐“จA stochastic, sequential algorithm.
  • F : (n : โ„•) โ†’ Hist ๐“ž' ๐“ ๐“จ' n ร— ๐“ž' โ†’ Hist ๐“ž ๐“ ๐“จ n ร— ๐“ž
Assuming
  • hF : โˆ€ (n : โ„•), Measurable (F n)A function f between measurable spaces is measurable if the preimage of every measurable set is measurable.
Result
Algorithm ๐“ž' ๐“ ๐“จ'
Body
{ policy := fun n => (alg.policy n).comap (F n) โ‹ฏ, isMarkovKernel_policy := โ‹ฏ }
Code
def Algorithm.comap (alg : Algorithm ๐“ž ๐“ ๐“จ)
    (F : (n : โ„•) โ†’ Hist ๐“ž' ๐“ ๐“จ' n ร— ๐“ž' โ†’ Hist ๐“ž ๐“ ๐“จ n ร— ๐“ž) (hF : โˆ€ n, Measurable (F n)) :
    Algorithm ๐“ž' ๐“ ๐“จ' where
  policy n := (alg.policy n).comap (F n) (hF n)

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: 3 project declarations, 10 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.