Repository navigation
feat: the rounds, states and state-action pairs of a stationary policy are Markov chains - #295
Open
RemyDegenne wants to merge 1 commit into
Conversation
…y are Markov chains For a stationary Markov policy `π` run in `M.env μ`, the rounds of every run form a homogeneous Markov chain (Tau Ceti's `markovChainLaw`) with transition kernel `MDP.roundKernel M π`; the Markov property of runs at every time follows, and so do the Markov chains of the states (kernel `M.stateKernel π`) and of the state-action pairs (kernel `M.saKernel π`). Adapted from RemyDegenne/Essakine2026Tight (Apache 2.0). Co-Authored-By: Claude Code <noreply@github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proves that the trajectory of a stationary policy is a Markov chain, for every run of
Algorithm.markov fun _ ↦ π(π : Kernel 𝓢 𝓐a Markov kernel) inM.env μfrom a probability measureμ. The round(s, a, r)is drawn fromstateRoundKernel M π s = δ_s ⊗ₘ (π ⊗ₖ M.R), and the next round fromroundKernel M π r.hasLaw_trajectory_markovChainLawsays the rounds have path lawmarkovChainLaw (stateRoundKernel M π ∘ₘ μ) (roundKernel M π). It follows from Tau Ceti'shasLaw_markovChainLaw_iffand the step kernels of the run (stepKernel_markov_env_zero,stepKernel_markov_env_add_one). Three consequences follow, each through Tau Ceti's Markov property (HasLaw.prefix_processShift_markovChainLaw):hasCondDistrib_processShift_history: given the rounds beforen, the rounds fromnon are a trajectory ofπstarted from the law(M.env μ).obs nof the next state. Given also the statesof roundn, they have lawtrajKernel M π s(hasCondDistrib_processShift_history_obs);markovChainLaw μ (M.stateKernel π)(hasLaw_obs_markovChainLaw);markovChainLaw (μ ⊗ₘ π) (M.saKernel π)(hasLaw_obs_action_markovChainLaw).The trajectory law from a state is the kernel
trajKernel M π. It equalstrajMeasurefromδ_s(trajKernel_apply_eq_trajMeasure,trajMeasure_markov_env). For a deterministic policy it isMDP.policyMeasure(policyMeasure_eq_trajKernel, throughpolicyAlg_eq_markov), which is therefore measurable in the initial state (measurable_policyMeasure).Target: ReinforcementLearning, Layer 7.2 "Markov policies". This PR proves two of its bullets: "Under a stationary policy π in
M.env μ, prove that the state process is a Markov chain with kernelM.stateKernel π: its law is Tau Ceti'smarkovChainLaw μ (M.stateKernel π)", and "Prove that the state–action process is a Markov chain with kernelM.saKernel π… and initial lawμ ⊗ₘ π". The other two bullets (Algorithm.markovandpolicyAlg_eq_markov) are already on main. After this PR, every bullet of Layer 7.2 is on main. Next comes Layer 7.6's iterated Markov property along an episode: the paper's item R6 (hasCondDistrib_shiftRounds_stepLaw) useshasCondDistrib_processShift_history_obsinM.augmented.Placement. Three general facts go in their topic files:
ProbabilityTheory.HasCondDistrib.prodMkLeft_of_comp(Probability/HasCondDistrib.lean): from a conditional lawη ∘ₖ κgivenX, wherefreads offZthe pointηdraws from, get the conditional lawη (f Z)given(X, f Z). The hypothesis is the joint-law formη.map (fun z ↦ (f z, z)) = Kernel.id ×ₖ η, so no measurable singletons are needed on𝓢;ProbabilityTheory.Kernel.markovChainKernel_map_prodMk_eval_zeroandKernel.markovChainKernel_map_shift(Probability/MarkovChain/MarkovProperty.lean), the kernel forms of Tau Ceti's time-0 Markov property and ofmarkovChainLaw_map_shift_iterateat one step;Learning.MDP.feedbackZero_env(MarkovDecisionProcess/Basic.lean, next toobsZero_env).The new file is
MarkovDecisionProcess/Trajectory.lean. It is notMarkovChain.lean, so that it does not share a prefix withMarkovPolicy.lean. TheHasCondDistrib.leanadditions sit afterae_mem, away from the lines that the open PR #288 edits. No public declaration is removed or renamed.Source: adapted from the paper project RemyDegenne/Essakine2026Tight at commit 9c77165d56f81c1db7a9835068356bb14886a3be (Apache 2.0), file
Essakine2026Tight/ForLMLExplore/MarkovDecisionProcess/Markov.lean. There, the Markov propertyhasCondDistrib_shiftRound_trajMeasureis proved for deterministic stationary policies, by rebuilding the trajectory and using the uniqueness of the Ionescu–Tulcea law (policyKernel,shiftMeasure,consRound). Following itsPAPER_ROADMAP.mdnote on R5, this port states it for stochastic stationary Markov policies. It is proved instead from Tau Ceti's Markov chain theory, so the source's reconstruction machinery is not ported. The module docstring credits the source.Roadmap: ReinforcementLearning
Paper: RemyDegenne/Essakine2026Tight
Item: R5
🤖 Prepared with Claude Code