Skip to content

Proof: affine discipline soundness — @linear consumed exactly once (QTT semiring + Scaled-Let) #516

Open

Description

@hyperpolymath

Parent: #513

Statement

For the quantity checker in lib/quantity.ml, prove the QTT-semiring soundness of affine consumption:

If quantity_ok(prog) accepts a program under the (0, 1, ω) semiring with Scaled-Let (ADR-002) and the Mut quantity policy, then every @linear binding is consumed exactly once on every execution trace.

Concretely

quantity_ok(prog)  ⟹  ∀ trace t of prog. ∀ binding b : QOne.  uses_in_trace(b, t) = 1

Plus the dual:

  • QZero bindings consumed = 0 times
  • QOmega bindings consumed 0..∞ times

Mechanisation

Lean 4 or Coq. Target: formal/Quantity/{Semiring.lean, ScaledLet.lean, Soundness.lean}. The (0, 1, ω) semiring is well-studied (Atkey 2018 "Syntax and Semantics of Quantitative Type Theory") — mathlib has rough scaffolding.

Recent landings:

Size

L. Estimate: 2–3 weeks. The semiring laws are mechanical; the soundness proof against the operational semantics is the work.

Status

NOT STARTED.

🤖 Generated with Claude Code

Activity

  1. added
    majorMajor issue — significant scope, broader impact than a feature/bug
    tech-debtKnown shortcut, drift, or hygiene owed - includes cleanup
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    majorMajor issue — significant scope, broader impact than a feature/bugpriority:p3Low - nice to havescope:repoConfined to this repositorystatus:readyFully specified and ready to be picked uptech-debtKnown shortcut, drift, or hygiene owed - includes cleanup

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions