Skip to content

Add named projections of parallel typed resources - #475

Open
MarcIlunga wants to merge 1 commit into
mainfrom
feat/parallel-projections
Open

MarcIlunga wants to merge 1 commit into
mainfrom
feat/parallel-projections

Conversation

@MarcIlunga

Copy link
Copy Markdown
Collaborator

Adds named projection converters TypedConverter.projectLeft and TypedConverter.projectRight for binary parallel typed resources, together with their attachment, retained-draw marginalization, and naturality laws across both RandomSystems.Typed.Context and the instance/notation layers.

Main changes

  • src/RandomSystems/Typed/Context.lean:
    • eq_discard, comp_discard, rightUnitor_inv_attach, leftUnitor_inv_attach, comp_rightUnitor_inv, comp_leftUnitor_inv.
    • TypedConverter.projectLeft ((ρ_ A).inv ≫ (id A ⊗ discard B)) and TypedConverter.projectRight ((λ_ B).inv ≫ (discard A ⊗ id B)).
    • Attachment on parallel resources (projectLeft_smul_parallel, projectRight_smul_parallel), retained-draw marginalization (projectLeft_smul_sample_parallel, projectRight_smul_sample_parallel), converter naturality (projectLeft_comp_parallel, projectRight_comp_parallel, projectLeft_comp_parallel_id, projectRight_comp_parallel_id), and attachment naturality (projectLeft_smul_parallel_smul, projectRight_smul_parallel_smul).
  • src/ConstructiveCryptography/Instances/Algebra.lean and src/ConstructiveCryptography/Notation.lean: exposes the instance-level Interface.projectLeft_* / Interface.projectRight_* laws (∥, ≫, ⊗ₘ, ▷, ◁) and registers them in cc_normalization.
  • src/RandomSystems/Typed/README.md: documents the projection converters and laws with updated anchors.
  • src/Tests/ParallelProjections.lean (exported from src/Tests.lean): tests unequal interfaces and query allowances, retained shared randomness (consistent vs. conflicting masses without resampling), and naturality with nontrivial converters, plus #print axioms on all 18 exported declarations.

Validation

  • lake build --wfail (3160 jobs)
  • scripts/check-sources.sh and scripts/check-axioms.sh (14496 declarations in 384 modules, 0 outside standard axioms)
  • lake env lean -Dweak.linter.mathlibStandardSet=true clean on all touched files

Dependencies: none (standalone off main).

Closes #213.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Name projections of parallel resources

1 participant