Strassen row join: concatenated values in fresh storage
ProvedCLRS.MatrixStrassenHelpers.join_row_contractGiven two allocated integer rows and natural segment length , the compiled row join terminates with a fresh allocated row containing the first entries of the first input followed by the first entries of the second:
All previously allocated rows, outer arrays, and objects are preserved.
Exactly units are added to copied_cells, with every other clock
unchanged. The two inputs may be the same row and is permitted.
Platform namespace. The imported Chapter 4 source declarations live under CLRS in this upload to avoid collisions with independently published compiler versions. The immutable source reference retains the original declaration names.
Catalog organization (2026-10-11). This record was retired from the active Chapter 4 catalog to focus the presentation on three algorithms and four reusable recurrence results. Its mathematical statement and proof status are unchanged, and existing imports and links remain valid. The retained results are CLRS.Chapter4Publication.Strassen.correctness_and_running_time. Supporting lemmas needed by the retained results are included in their accepted proof files.
import Definitions.Def_CLRS_Chapter4_Algo2Lean import Definitions.Def_CLRS_Chapter4_Algo2LeanExamples_MatrixStrassen import Definitions.Def_CLRS_Chapter4_Algo2LeanExamples_MatrixStrassenGenerated import Definitions.Def_CLRS_Chapter4_Algo2LeanExamples_MatrixStrassenPoints import Definitions.Def_CLRS_Chapter4_Algo2LeanLib_MatrixHeap import Std set_option autoImplicit false set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true namespace CLRS end CLRS open CLRS open MatrixStrassenLibrary MatrixStrassenLibrary.Algo2LeanGenerated open Algo2LeanCore Algo2LeanGenerated Algo2LeanCore.MatrixHeap namespace CLRS.MatrixStrassenHelpers end CLRS.MatrixStrassenHelpers open CLRS.MatrixStrassenHelpers open MatrixStrassenAnalysis
theorem CLRS.MatrixStrassenHelpers.join_row_contract (heap : Heap) (a b : SeqRef) (count : Nat)
(validA : a < heap.nextRef) (validB : b < heap.nextRef) :
∃ after result, matrix_join_row.Call heap (a,b,(count:Int)) after result ∧
Extends heap after ∧ result < after.nextRef ∧ heap.nextRef ≤ result ∧
after.store result = (fun index => if 0 ≤ index ∧ index < 2*(count:Int)
then if index < (count:Int) then heap.read a index else heap.read b (index-count) else 0) ∧
(∀ name, after.clocks name = heap.clocks name + Clocks.single "copied_cells" (2*count) name) := by sorry