Refactor: Iic -> Fin - #226
Merged
Merged
Conversation
RemyDegenne
marked this pull request as ready for review
August 27, 2026 07:29
Resolve the conflict in ArrayProbSpace.lean by taking main's simplified structure (truncRow, reworked independence proofs, 𝓡 notation) and re-applying the Fin-indexed history refactor from this branch on top. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
paulorauber
reviewed
Sep 8, 2026
paulorauber
approved these changes
Sep 8, 2026
paulorauber
left a comment
Collaborator
There was a problem hiding this comment.
This is a massive improvement! Having to deal with different time conventions was indeed a sign that something was off.
I have only lightly reviewed the code.
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.
I got annoyed by the duplication that we have everywhere because of the special case of the first action and feedback. Here is the old definition of Environment:
We have to do a separate lemma for the feedback given by
ν0every time because it does not have the same shape asfeedback n. But it could have the same shape! I changed both Algorithm and Environment to have only one data field:The trick is that
Fin 0 → 𝓐 × 𝓨is a type with a unique element, soKernel ((Fin 0 → 𝓐 × 𝓨) × 𝓐) 𝓨is equivalent toKernel 𝓐 𝓨and we can recover ourν0that way (and I introduced a definition for easy access to that simpler kernel). Thenfeedback (n+1)in the new formulation corresponds tofeedback nin the old one (we already had that shifted indexing for things like obliviousEnv, which gets simpler in the new formulation). It reduces a lot of duplication of lemmas and proofs. Of course it also introduces a little friction with the Ionescu-Tulcea theorem of Mathlib that is written with Iic (which was the reason for the Iic choice in LML), but it's localized to a few files at the beginning.