Skip to content

Formalize source-bound CK cleanup-prefix scalar reordering in Lean - #1086

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
Hope7Happiness:contribution/seed76-independent-verification
Oct 16, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
Hope7Happiness:contribution/seed76-independent-verification

Conversation

@Hope7Happiness

Copy link
Copy Markdown
Contributor

This adds a source-bound Lean proof of the scalar cleanup-prefix rewrite used by the CK hyperplane_end constructor. It proves that moving selected gates to the front in recipe order preserves the scalar program, including arbitrary input states, disjoint self-adds, and unsorted selections.

The concrete instance checks all 2,869 original instructions, 34 selected cleanup gates, and 19,084 original-prefix commutation pairs. Its original selection certificate (#626 at 66849e1475c930fd7732b1a0067ffee7e1e95f60) is retained byte-for-byte, so advancing the repository selection does not invalidate this historical audit. All actual constructor, recipe, and inventory inputs remain hash-pinned. Changes are confined to research/cleanup-prefix-lean/.

Validation:

  • A separate Codex reviewer reproduced a clean Lean 4.27.0 build and audited the axioms; no sorry, native_decide, or additional axioms were found.
  • Independent exact arithmetic checks cover all 716 source input columns, reproduce the original constructor output, and reject corrupted artifacts and weakened-rule counterexamples.
  • Generator checks compare every instruction and coefficient against the source-bound fixture. Targeted runner tests reject prerelease and other non-exact Lean versions.
  • Frozen-certificate portability controls require later or absent live selection metadata to leave the audit unchanged and corrupted frozen metadata to fail; independent publication review accepted with no remaining findings.
  • Isolated clean application and source/generator replay passed against both the original base and upstream abdc6a7002abdbcd9e21bfc5e1a795784deacfdf; final patch application and all 28 resulting files were checked again after documentation finalization.

Scope and trust: this proves a scalar reordering theorem with associative/commutative addition and arbitrary multiplication, with an Int instance supplied. Python source/JSON binding and generation remain an explicit trusted bridge. Rational/complex interpretations, the complete multiplication theorem, frame/accounting and all-size/analytic-transfer obligations are outside this contribution. No new κ or frontier change is claimed.

This builds on the commuting-prefix constructors in #601/#608, HPE formal interfaces in #593/#599, and the #622/#623/#626 construction lineage. Substantial OpenAI Codex assistance was used for implementation and separate-agent review; no human review is claimed. See README.md, REVIEW.md, FINAL-REVIEW.json and ACCEPTANCE.json in the package for reproducible commands, exact pins, evidence, limitations and finding resolutions.

@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

100-PR batch review at 89a2dac3e8f84703110e00a231079c96fa4a9dd3.

This remains open after scoped triage. Next review step: Source check is only part of this formalization; requires Lean 4.27.0 kernel build and complete axiom/statement coverage. Installed toolchains differ.

This is a specific continuation point, not a rejection or a request to redo already recorded checks. Completed local evidence is retained separately from outstanding whole-head obligations.

Batch review, attribution and evidence. Thank you for the contribution.

@Hope7Happiness

Copy link
Copy Markdown
Contributor Author

Follow-up to the review continuation in #1086 (comment).

At head 89a2dac3e8f84703110e00a231079c96fa4a9dd3, the retained contributor evidence includes a clean Lean 4.27.0 kernel build beyond the Python source check: build output and exact-version build and theorem receipts. Both Lean sources, fixtures, generator and build configuration match that build. The runner-version finding was subsequently resolved in ACCEPTANCE.json; frozen-baseline source binding has its own publication review.

Our follow-up found two omissions in the explicit named axiom inventory and has now recorded all 22 theorem statements and axiom sets using the exact official Lean 4.27.0 release. run_append has no axioms; cross_prefix uses only propext and Quot.sound. All 20 previous mappings agree, and the complete observed union is propext, Quot.sound. The original runner remains unchanged and requires only five roots; this all-22 listing is a separate supplementary audit.

The targeted audit imported retained build artifacts after source/configuration SHA256 and Lake trace/sidecar checks; it did not rebuild or independently kernel-recheck the proof sources. The restored compiler matches the historical executable SHA256 and release commit. Historical artifact SHA256 values were not independently retained; Lake cache hashes are noncryptographic local provenance, not signed attestations. The retained clean build remains the source-level kernel-build evidence.

For a maintainer clean replay, use python3 -B research/cleanup-prefix-lean/run.py --lean-bin "$LEAN427_BIN" in an isolated checkout of the exact head, with the Lean 4.27.0 release. The supplementary StatementAxiomCoverage.lean imports CKFixture and prints each of the 22 types and axiom sets. These are contributor/independent AI receipts, not maintainer whole-head acceptance. Scope remains scalar cleanup reordering and its full 2,869-gate CK bridge, excluding rational/complex instances, physical accounting and the full multiplication theorem.

The supplementary evidence is included below so it is available without local files. The original preparation-only comment has been omitted from the displayed audit script; executable lines are unchanged.

Toolchain: Lean (version 4.27.0, x86_64-unknown-linux-gnu, commit db93fe1608548721853390a10cd40580fe7d22ae, Release) from the official release. Compiler SHA256: 8fadc3ed92cc9decb94c96ee9c0876e91e03a3a5e69138f32114f02789e2766c, matching the historical build receipt. Supplementary audit exited 0 with empty stderr. Raw stdout SHA256: 2f856990e2605ee36bb3405e8a04d98b17b7d871c1bfab6be3be146474134578.

To reproduce after the pinned build above, save the displayed script as StatementAxiomCoverage.lean and, from research/cleanup-prefix-lean, run PATH="$LEAN427_BIN:$PATH" "$LEAN427_BIN/lake" env lean /absolute/path/to/StatementAxiomCoverage.lean with external LEAN_PATH and LEAN_SRC_PATH unset. The 11 anonymous examples are compiled controls rather than separately named audited contracts. This follow-up was prepared and checked with AI assistance.

Audit script: all 22 named theorem statements and axiom sets
import CKFixture
set_option pp.universes true
set_option pp.explicit true
#check CleanupPrefix.commute_sound
#print axioms CleanupPrefix.commute_sound
#check CleanupPrefix.disjoint_commute
#print axioms CleanupPrefix.disjoint_commute
#check CleanupPrefix.run_append
#print axioms CleanupPrefix.run_append
#check CleanupPrefix.cross_prefix
#print axioms CleanupPrefix.cross_prefix
#check CleanupPrefix.pull_sound
#print axioms CleanupPrefix.pull_sound
#check CleanupPrefix.pull_split
#print axioms CleanupPrefix.pull_split
#check CleanupPrefix.extract_sound
#print axioms CleanupPrefix.extract_sound
#check CleanupPrefix.extract_recipe_order
#print axioms CleanupPrefix.extract_recipe_order
#check CleanupPrefix.extract_disjoint
#print axioms CleanupPrefix.extract_disjoint
#check CleanupPrefix.sourceExtract_sound
#print axioms CleanupPrefix.sourceExtract_sound
#check CleanupPrefix.extract_in_context
#print axioms CleanupPrefix.extract_in_context
#check CleanupPrefix.sourceExtract_in_context
#print axioms CleanupPrefix.sourceExtract_in_context
#check CleanupPrefix.suffix_unselected_of_bounds
#print axioms CleanupPrefix.suffix_unselected_of_bounds
#check CleanupPrefix.CK.checked
#print axioms CleanupPrefix.CK.checked
#check CleanupPrefix.CK.selected_order
#print axioms CleanupPrefix.CK.selected_order
#check CleanupPrefix.CK.prefix_filter
#print axioms CleanupPrefix.CK.prefix_filter
#check CleanupPrefix.CK.recipe_below_cut
#print axioms CleanupPrefix.CK.recipe_below_cut
#check CleanupPrefix.CK.suffix_above_cut
#print axioms CleanupPrefix.CK.suffix_above_cut
#check CleanupPrefix.CK.suffix_unselected
#print axioms CleanupPrefix.CK.suffix_unselected
#check CleanupPrefix.CK.stable_remainder
#print axioms CleanupPrefix.CK.stable_remainder
#check CleanupPrefix.CK.scalar_rewrite
#print axioms CleanupPrefix.CK.scalar_rewrite
#check CleanupPrefix.CK.source_coefficient_rewrite
#print axioms CleanupPrefix.CK.source_coefficient_rewrite
Complete supplementary output (22 statements, 22 axiom records)
CleanupPrefix.commute_sound {α : Type} [CleanupPrefix.Scalar α] (a b : CleanupPrefix.Shape) (p q : α)
  (h : @Eq.{1} Bool (CleanupPrefix.commute a b) true) (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α) (@CleanupPrefix.eval α inst✝ b q (@CleanupPrefix.eval α inst✝ a p σ))
    (@CleanupPrefix.eval α inst✝ a p (@CleanupPrefix.eval α inst✝ b q σ))
'CleanupPrefix.commute_sound' depends on axioms: [propext, Quot.sound]
CleanupPrefix.disjoint_commute (a b : CleanupPrefix.Shape) (h : @Eq.{1} Bool (CleanupPrefix.disjoint a b) true) :
  @Eq.{1} Bool (CleanupPrefix.commute a b) true
'CleanupPrefix.disjoint_commute' depends on axioms: [propext, Quot.sound]
CleanupPrefix.run_append {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α)
  (xs ys : List.{0} CleanupPrefix.Instruction) (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        xs ys)
      σ)
    (@CleanupPrefix.run α inst✝ coeff ys (@CleanupPrefix.run α inst✝ coeff xs σ))
'CleanupPrefix.run_append' does not depend on any axioms
CleanupPrefix.cross_prefix {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α) (g : CleanupPrefix.Instruction)
  (xs : List.{0} CleanupPrefix.Instruction)
  (h :
    ∀ (x : CleanupPrefix.Instruction),
      @Membership.mem.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction)
          (@List.instMembership.{0} CleanupPrefix.Instruction) xs x →
        @Eq.{1} Bool (CleanupPrefix.commute x.shape g.shape) true)
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α)
    (@CleanupPrefix.eval α inst✝ g.shape (coeff g.index) (@CleanupPrefix.run α inst✝ coeff xs σ))
    (@CleanupPrefix.run α inst✝ coeff xs (@CleanupPrefix.eval α inst✝ g.shape (coeff g.index) σ))
'CleanupPrefix.cross_prefix' depends on axioms: [propext, Quot.sound]
CleanupPrefix.pull_sound {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α) (i : Nat)
  (xs : List.{0} CleanupPrefix.Instruction) (g : CleanupPrefix.Instruction) (rest : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.pull i xs)
      (@some.{0} (Prod.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction) g rest)))
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α) (@CleanupPrefix.run α inst✝ coeff xs σ)
    (@CleanupPrefix.run α inst✝ coeff (@List.cons.{0} CleanupPrefix.Instruction g rest) σ)
'CleanupPrefix.pull_sound' depends on axioms: [propext, Quot.sound]
CleanupPrefix.pull_split (i : Nat) (xs : List.{0} CleanupPrefix.Instruction) (g : CleanupPrefix.Instruction)
  (rest : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.pull i xs)
      (@some.{0} (Prod.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction) g rest))) :
  And (@Eq.{1} Nat g.index i)
    (@Exists.{1} (List.{0} CleanupPrefix.Instruction) fun pre =>
      @Exists.{1} (List.{0} CleanupPrefix.Instruction) fun post =>
        And
          (@Eq.{1} (List.{0} CleanupPrefix.Instruction) xs
            (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
              (List.{0} CleanupPrefix.Instruction)
              (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
                (@List.instAppend.{0} CleanupPrefix.Instruction))
              pre (@List.cons.{0} CleanupPrefix.Instruction g post)))
          (And
            (@Eq.{1} (List.{0} CleanupPrefix.Instruction) rest
              (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
                (List.{0} CleanupPrefix.Instruction)
                (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
                  (@List.instAppend.{0} CleanupPrefix.Instruction))
                pre post))
            (∀ (x : CleanupPrefix.Instruction),
              @Membership.mem.{0, 0} CleanupPrefix.Instruction (List.{0} CleanupPrefix.Instruction)
                  (@List.instMembership.{0} CleanupPrefix.Instruction) pre x →
                @Eq.{1} Bool (CleanupPrefix.commute x.shape g.shape) true)))
'CleanupPrefix.pull_split' depends on axioms: [propext, Quot.sound]
CleanupPrefix.extract_sound {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α) (recipe : List.{0} Nat)
  (xs selected tail : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.extract recipe xs)
      (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction) selected tail)))
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α) (@CleanupPrefix.run α inst✝ coeff xs σ)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        selected tail)
      σ)
'CleanupPrefix.extract_sound' depends on axioms: [propext, Quot.sound]
CleanupPrefix.extract_recipe_order (recipe : List.{0} Nat) (xs selected tail : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.extract recipe xs)
      (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction) selected tail))) :
  @Eq.{1} (List.{0} Nat) (@List.map.{0, 0} CleanupPrefix.Instruction Nat CleanupPrefix.Instruction.index selected)
    recipe
'CleanupPrefix.extract_recipe_order' depends on axioms: [propext, Quot.sound]
CleanupPrefix.extract_disjoint (recipe : List.{0} Nat) (xs selected tail : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.extract recipe xs)
      (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction) selected tail))) :
  @List.Pairwise.{0} CleanupPrefix.Instruction (fun a b => @Eq.{1} Bool (CleanupPrefix.disjoint a.shape b.shape) true)
    selected
'CleanupPrefix.extract_disjoint' depends on axioms: [propext, Quot.sound]
CleanupPrefix.sourceExtract_sound {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α) (recipe : List.{0} Nat)
  (xs selected tail : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.sourceExtract recipe xs)
      (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction) selected tail)))
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α) (@CleanupPrefix.run α inst✝ coeff xs σ)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        selected tail)
      σ)
'CleanupPrefix.sourceExtract_sound' depends on axioms: [propext, Quot.sound]
CleanupPrefix.extract_in_context {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α) (recipe : List.{0} Nat)
  (xs selected tail before after : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.extract recipe xs)
      (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction) selected tail)))
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
          (List.{0} CleanupPrefix.Instruction)
          (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
            (@List.instAppend.{0} CleanupPrefix.Instruction))
          before xs)
        after)
      σ)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
          (List.{0} CleanupPrefix.Instruction)
          (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
            (@List.instAppend.{0} CleanupPrefix.Instruction))
          before
          (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
            (List.{0} CleanupPrefix.Instruction)
            (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
              (@List.instAppend.{0} CleanupPrefix.Instruction))
            selected tail))
        after)
      σ)
'CleanupPrefix.extract_in_context' depends on axioms: [propext, Quot.sound]
CleanupPrefix.sourceExtract_in_context {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α) (recipe : List.{0} Nat)
  (xs selected tail before after : List.{0} CleanupPrefix.Instruction)
  (h :
    @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
      (CleanupPrefix.sourceExtract recipe xs)
      (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
        (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction) selected tail)))
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
          (List.{0} CleanupPrefix.Instruction)
          (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
            (@List.instAppend.{0} CleanupPrefix.Instruction))
          before xs)
        after)
      σ)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
          (List.{0} CleanupPrefix.Instruction)
          (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
            (@List.instAppend.{0} CleanupPrefix.Instruction))
          before
          (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
            (List.{0} CleanupPrefix.Instruction)
            (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
              (@List.instAppend.{0} CleanupPrefix.Instruction))
            selected tail))
        after)
      σ)
'CleanupPrefix.sourceExtract_in_context' depends on axioms: [propext, Quot.sound]
CleanupPrefix.suffix_unselected_of_bounds (recipe : List.{0} Nat) (suffix : List.{0} CleanupPrefix.Instruction)
  (cut : Nat)
  (hr : @Eq.{1} Bool (@List.all.{0} Nat recipe fun i => @decide (@LT.lt.{0} Nat instLTNat i cut) (i.decLt cut)) true)
  (hs :
    @Eq.{1} Bool
      (@List.all.{0} CleanupPrefix.Instruction suffix fun g =>
        @decide (@LE.le.{0} Nat instLENat cut g.index) (cut.decLe g.index))
      true) :
  @Eq.{1} Bool
    (@List.all.{0} CleanupPrefix.Instruction suffix fun g =>
      (@List.contains.{0} Nat (@instBEqOfDecidableEq.{0} Nat instDecidableEqNat) recipe g.index).not)
    true
'CleanupPrefix.suffix_unselected_of_bounds' depends on axioms: [propext, Quot.sound]
CleanupPrefix.CK.checked :
  @Eq.{1} (Option.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)))
    (CleanupPrefix.sourceExtract CleanupPrefix.CK.recipe CleanupPrefix.CK.initial)
    (@some.{0} (Prod.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction))
      (@Prod.mk.{0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        CleanupPrefix.CK.selected CleanupPrefix.CK.prefixTail))
'CleanupPrefix.CK.checked' depends on axioms: [propext]
CleanupPrefix.CK.selected_order :
  @Eq.{1} (List.{0} Nat)
    (@List.map.{0, 0} CleanupPrefix.Instruction Nat CleanupPrefix.Instruction.index CleanupPrefix.CK.selected)
    CleanupPrefix.CK.recipe
'CleanupPrefix.CK.selected_order' does not depend on any axioms
CleanupPrefix.CK.prefix_filter :
  @Eq.{1} (List.{0} CleanupPrefix.Instruction) CleanupPrefix.CK.prefixTail
    (@List.filter.{0} CleanupPrefix.Instruction
      (fun g =>
        (@List.contains.{0} Nat (@instBEqOfDecidableEq.{0} Nat instDecidableEqNat) CleanupPrefix.CK.recipe g.index).not)
      CleanupPrefix.CK.initial)
'CleanupPrefix.CK.prefix_filter' does not depend on any axioms
CleanupPrefix.CK.recipe_below_cut :
  @Eq.{1} Bool
    (@List.all.{0} Nat CleanupPrefix.CK.recipe fun i =>
      @decide (@LT.lt.{0} Nat instLTNat i (@OfNat.ofNat.{0} Nat (nat_lit 665) (instOfNatNat (nat_lit 665))))
        (i.decLt (@OfNat.ofNat.{0} Nat (nat_lit 665) (instOfNatNat (nat_lit 665)))))
    true
'CleanupPrefix.CK.recipe_below_cut' does not depend on any axioms
CleanupPrefix.CK.suffix_above_cut :
  @Eq.{1} Bool
    (@List.all.{0} CleanupPrefix.Instruction CleanupPrefix.CK.suffix fun g =>
      @decide (@LE.le.{0} Nat instLENat (@OfNat.ofNat.{0} Nat (nat_lit 665) (instOfNatNat (nat_lit 665))) g.index)
        (Nat.decLe (@OfNat.ofNat.{0} Nat (nat_lit 665) (instOfNatNat (nat_lit 665))) g.index))
    true
'CleanupPrefix.CK.suffix_above_cut' does not depend on any axioms
CleanupPrefix.CK.suffix_unselected :
  @Eq.{1} Bool
    (@List.all.{0} CleanupPrefix.Instruction CleanupPrefix.CK.suffix fun g =>
      (@List.contains.{0} Nat (@instBEqOfDecidableEq.{0} Nat instDecidableEqNat) CleanupPrefix.CK.recipe g.index).not)
    true
'CleanupPrefix.CK.suffix_unselected' depends on axioms: [propext, Quot.sound]
CleanupPrefix.CK.stable_remainder :
  @Eq.{1} (List.{0} CleanupPrefix.Instruction) CleanupPrefix.CK.remainder
    (@List.filter.{0} CleanupPrefix.Instruction
      (fun g =>
        (@List.contains.{0} Nat (@instBEqOfDecidableEq.{0} Nat instDecidableEqNat) CleanupPrefix.CK.recipe g.index).not)
      CleanupPrefix.CK.cleanup)
'CleanupPrefix.CK.stable_remainder' depends on axioms: [propext, Quot.sound]
CleanupPrefix.CK.scalar_rewrite {α : Type} [CleanupPrefix.Scalar α] (coeff : Nat → α)
  (before after : List.{0} CleanupPrefix.Instruction) (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
          (List.{0} CleanupPrefix.Instruction)
          (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
            (@List.instAppend.{0} CleanupPrefix.Instruction))
          before CleanupPrefix.CK.cleanup)
        after)
      σ)
    (@CleanupPrefix.run α inst✝ coeff
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
          (List.{0} CleanupPrefix.Instruction)
          (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
            (@List.instAppend.{0} CleanupPrefix.Instruction))
          before
          (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
            (List.{0} CleanupPrefix.Instruction)
            (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction)
              (@List.instAppend.{0} CleanupPrefix.Instruction))
            CleanupPrefix.CK.selected CleanupPrefix.CK.remainder))
        after)
      σ)
'CleanupPrefix.CK.scalar_rewrite' depends on axioms: [propext, Quot.sound]
CleanupPrefix.CK.source_coefficient_rewrite {α : Type} [CleanupPrefix.Scalar α] (interpret : Int → Nat → α)
  (σ : CleanupPrefix.State α) :
  @Eq.{1} (CleanupPrefix.State α)
    (@CleanupPrefix.run α inst✝ (@CleanupPrefix.CK.coefficients.{1} α interpret) CleanupPrefix.CK.cleanup σ)
    (@CleanupPrefix.run α inst✝ (@CleanupPrefix.CK.coefficients.{1} α interpret)
      (@HAppend.hAppend.{0, 0, 0} (List.{0} CleanupPrefix.Instruction) (List.{0} CleanupPrefix.Instruction)
        (List.{0} CleanupPrefix.Instruction)
        (@instHAppendOfAppend.{0} (List.{0} CleanupPrefix.Instruction) (@List.instAppend.{0} CleanupPrefix.Instruction))
        CleanupPrefix.CK.selected CleanupPrefix.CK.remainder)
      σ)
'CleanupPrefix.CK.source_coefficient_rewrite' depends on axioms: [propext, Quot.sound]

@Mister-Meeseeks
Mister-Meeseeks merged commit 998a33b into CrocSwap:main Oct 16, 2026
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.

2 participants