Skip to content

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

@hyperpolymath

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    majorMajor issue — significant scope, broader impact than a feature/bugtech-debtExplicit, tracked technical debt

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions