← Back to Pull requests

feat(Cslib/Logics/LinearLogic/CLL/PhaseSemantics/Basic.lean): phase semantics of linear logic #64

Closed
unknown closed this pull request without merging on Oct 06, 2025 11:12 UTC
View on GitHub
unknown unknown commented on Sep 18, 2025 22:21 UTC
Author

Phase semantics for Classical Linear Logic

This file develops the phase semantics for Classical Linear Logic (CLL), providing an
algebraic interpretation of linear logic propositions in terms of phase spaces.

Phase semantics is a denotational semantics for linear logic where
propositions are interpreted as subsets of a commutative monoid, and logical operations
correspond to specific set-theoretic operations.

Main definitions

PhaseSpace: A commutative monoid equipped with a distinguished subset ⊥
PhaseSpace.orthogonal: The orthogonal X⫠ of a set X
PhaseSpace.isFact: A fact is a set that equals its biorthogonal closure
Fact: The type of facts in a phase space
Fact.neg: The negation/dual of a fact (Gᗮ)
Fact.tensor, Fact.parr: The multiplicative connectives (⊗, ⅋)
Fact.linImpl: Linear implication between facts (⊸)
Fact.withh, Fact.oplus: The additive connectives (&, ⊕)
Fact.bang, Fact.quest: The exponentials (!, ʔ)
PhaseSpace.I: The set of idempotents belonging to 1
PhaseSpace.interpProp: Interpretation of CLL propositions as facts in a phase space

Main results

PhaseSpace.triple_orth: The triple orthogonal equals the orthogonal (X⫠⫠⫠ = X⫠)
PhaseSpace.biorthogonalClosure: The biorthogonal operation forms a closure operator
PhaseSpace.orth_iUnion: Orthogonal of union equals intersection of orthogonals
PhaseSpace.sInf_isFact: Facts are closed under arbitrary intersections
PhaseSpace.biorth_least_fact: The biorthogonal closure gives the smallest fact containing a set
Fact.tensor_of_par, Fact.par_of_tensor: De Morgan duality between tensor and par

TODO


  • Soundness theorem

  • Completeness theorem
  • References

    [J.-Y. Girard, Linear logic][Girard1987]
    [J.-Y. Girard, Linear Logic: its syntax and semantics*][Girard1995]

    Diff: 235 lines (+176 / -59) across 2 files Reviewer: tannerduve Review duration: 25251m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 235 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.327
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #64"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.7% · Safe to merge
    14.7%