Repository navigation
Conversation
dtumad
force-pushed
the
dtumad/weighted-lens-euclidean
branch
2 times, most recently
from
November 18, 2026 00:44
dc7108a to
3257836
Compare
dtumad
force-pushed
the
dtumad/weighted-lens-euclidean
branch
from
November 25, 2026 21:36
3257836 to
9a3f947
Compare
…xing Bundle coordinate reads as a continuous linear map and use additive pairing to identify the adjoint with the weighted lens. Relate the result to the executable tree reshape and its prepared reverse buffer. Co-Authored-By: Codex <noreply@openai.com>
Import FDeriv.Basic explicitly so that both the adjoint proof and public consumers of the gather derivative retain HasFDerivAt.fderiv. Co-Authored-By: Codex <noreply@openai.com>
dtumad
force-pushed
the
dtumad/weighted-lens-euclidean
branch
from
November 25, 2026 21:52
9a3f947 to
9c97b86
Compare
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.
At a fixed shape, a polynomial lens gathers real coordinates by reading the input specified for each output.
Lens.euclideanGatherbundles this operation as a continuous linear map. Its Fréchet derivative at each labelling is the same gather. For finite direction types at the chosen shape,Lens.fderiv_euclideanGather_adjointproves that its Hilbert adjoint returns output weights throughLens.bangWMap. The proof uses the additive pairing from #479 and Mathlib’s characterization of the adjoint.Import
PolyFun.PFunctor.Lens.BangW.Euclideanfor the public API. The module explicitly re-exports Mathlib’s basic Fréchet derivative lemmas so consumers can recoverfderivfrom the publicHasFDerivAttheorem on Lean 4.36. The optional tree tutorial then proves the derivative for the executable flatten-and-gather function from #480 and identifies each coordinate of the adjoint with a lookup in the prepared buffer. The tree shape and selection are fixed throughout differentiation.The real-valued regression checks the pairing in both directions gives 244, a repeated input receives 5, an omitted input receives 0, and an empty selection gives the zero adjoint. An independent ordinary-import check also exercised cancellation. The headline proofs use only
propext,Classical.choice, andQuot.sound. The full build, lint, test, documentation, consumer and axiom checks passed with./scripts/validate.sh --lint --test --axiomson Lean 4.36 atdc7108acb2b23d677eb715de25a5ce0c16ae77a0against #480.