OAI/Combinatorics/LowSpaceSubsetSum/Streams/TieGroup.lean
14 declarations, 0 contain sorry, 0 declared as axioms
A stopped Cartesian tie-group join
A single second-stream prefix buffer and optional suffix snapshot serve every first-stream occurrence with this key. Counters charge every attempted report, including executions halted inside either part of a replay. Lists occur only in the correctness specification.
- structure
OAI.LowSpaceSubsetSum.TieGroup.Stateline 21 - def
OAI.LowSpaceSubsetSum.TieGroup.stepline 28 - structure
OAI.LowSpaceSubsetSum.TieGroup.Resultline 35 - def
OAI.LowSpaceSubsetSum.TieGroup.runline 41 - theorem
OAI.LowSpaceSubsetSum.TieGroup.step_boundsline 54Source documentation
Bounds on callbacks follow from the actual suffix reporter, not from assumed trial or implementation bounds.
theorem step_bounds (read₂ : σ₂ → Option (β × σ₂)) (key₂ : β → ℤ) (K : ℤ) (report : α → β → τ → τ × Bool) (view₂ : σ₂ → List β) (hread₂ : RowMerge.IsReader read₂ view₂) (buffer : Array β) (saved : σ₂) (long : Bool) (fuel₂ : ℕ) (x : α) (a : State σ₂ τ) : (step read₂ key₂ K report buffer saved long fuel₂ x a).1.reports ≤ a.reports + (buffer.size + (TieBuffer.groupView key₂ K view₂ saved).length) ∧ (step read₂ key₂ K report buffer saved long fuel₂ x a).1.queries ≤ a.queries + (buffer.size + (TieBuffer.groupView key₂ K view₂ saved).length + 1) ∧ (step read₂ key₂ K report buffer saved long fuel₂ x a).1.restores ≤ a.restores + 1 := by …Mentions: OAI.LowSpaceSubsetSum.RowMerge.IsReader, OAI.LowSpaceSubsetSum.TieGroup.State, OAI.LowSpaceSubsetSum.TieGroup.step, OAI.LowSpaceSubsetSum.TieBuffer.groupView
- theorem
OAI.LowSpaceSubsetSum.TieGroup.run_boundsline 69 - theorem
OAI.LowSpaceSubsetSum.TieGroup.state_completeline 119Source documentation
On a continuing run every occurrence in the Cartesian tie group is reported, in first-stream order and then second-stream order.
theorem state_complete (read₁ : σ₁ → Option (α × σ₁)) (key₁ : α → ℤ) (read₂ : σ₂ → Option (β × σ₂)) (key₂ : β → ℤ) (K : ℤ) (report : α → β → τ → τ × Bool) (hreport : ∀ x y a, (report x y a).2 = false) (view₁ : σ₁ → List α) (hread₁ : RowMerge.IsReader read₁ view₁) (view₂ : σ₂ → List β) (hread₂ : RowMerge.IsReader read₂ view₂) (B fuel₁ fuel₂ : ℕ) (s₁ : σ₁) (s₂ : σ₂) (a : τ) (hfuel₁ : (TieBuffer.groupView key₁ K view₁ s₁).length ≤ fuel₁) (hfuel₂ : (TieBuffer.groupView key₂ K view₂ s₂).length ≤ fuel₂) : (run read₁ key₁ read₂ key₂ K report B fuel₁ fuel₂ s₁ s₂ a).outer.state.user = (TieBuffer.groupView key₁ K view₁ s₁).foldl (fun a x => (TieBuffer.groupView key₂ K view₂ s₂).foldl (fun a y => (report x y a).1) a) a := by …Mentions: OAI.LowSpaceSubsetSum.RowMerge.IsReader, OAI.LowSpaceSubsetSum.TieBuffer.groupView, OAI.LowSpaceSubsetSum.TieGroup.run
- theorem
OAI.LowSpaceSubsetSum.TieGroup.step_halted_falseline 150 - theorem
OAI.LowSpaceSubsetSum.TieGroup.halted_falseline 156 - theorem
OAI.LowSpaceSubsetSum.TieGroup.views_completeline 166Source documentation
Both generator cursors end immediately after this key, so a surrounding merge join can continue without losing its next different-key occurrences.
theorem views_complete (read₁ : σ₁ → Option (α × σ₁)) (key₁ : α → ℤ) (read₂ : σ₂ → Option (β × σ₂)) (key₂ : β → ℤ) (K : ℤ) (report : α → β → τ → τ × Bool) (hreport : ∀ x y a, (report x y a).2 = false) (view₁ : σ₁ → List α) (hread₁ : RowMerge.IsReader read₁ view₁) (view₂ : σ₂ → List β) (hread₂ : RowMerge.IsReader read₂ view₂) (B fuel₁ fuel₂ : ℕ) (s₁ : σ₁) (s₂ : σ₂) (a : τ) (hfuel₁ : (TieBuffer.groupView key₁ K view₁ s₁).length ≤ fuel₁) (hfuel₂ : (TieBuffer.groupView key₂ K view₂ s₂).length ≤ fuel₂) (hne : TieBuffer.groupView key₁ K view₁ s₁ ≠ []) : view₁ s₁ = TieBuffer.groupView key₁ K view₁ s₁ ++ view₁ (run read₁ key₁ read₂ key₂ K report B fuel₁ fuel₂ s₁ s₂ a).outer.cursor ∧ view₂ s₂ = TieBuffer.groupView key₂ K view₂ s₂ ++ …Mentions: OAI.LowSpaceSubsetSum.RowMerge.IsReader, OAI.LowSpaceSubsetSum.TieBuffer.groupView, OAI.LowSpaceSubsetSum.TieGroup.run
- theorem
OAI.LowSpaceSubsetSum.TieGroup.query_boundline 207 - theorem
OAI.LowSpaceSubsetSum.TieGroup.bufferSize_leline 232 - theorem
OAI.LowSpaceSubsetSum.TieGroup.restores_eq_zero_of_shortline 241Source documentation
Without a long suffix, there are no generator restores.
theorem restores_eq_zero_of_short (read₁ : σ₁ → Option (α × σ₁)) (key₁ : α → ℤ) (read₂ : σ₂ → Option (β × σ₂)) (key₂ : β → ℤ) (K : ℤ) (report : α → β → τ → τ × Bool) (B fuel₁ fuel₂ : ℕ) (s₁ : σ₁) (s₂ : σ₂) (a : τ) (hshort : TieBuffer.hasKey read₂ key₂ K (TieBuffer.fill read₂ key₂ K B s₂).cursor = false) : (run read₁ key₁ read₂ key₂ K report B fuel₁ fuel₂ s₁ s₂ a).outer.state.restores = 0 := by …Mentions: OAI.LowSpaceSubsetSum.TieBuffer.hasKey, OAI.LowSpaceSubsetSum.TieBuffer.fill, OAI.LowSpaceSubsetSum.TieGroup.run
- theorem
OAI.LowSpaceSubsetSum.TieGroup.copies_chargedline 255Source documentation
Every snapshot/restore is charged to potential partners, including partners not reached when the execution halts.
theorem copies_charged (read₁ : σ₁ → Option (α × σ₁)) (key₁ : α → ℤ) (read₂ : σ₂ → Option (β × σ₂)) (key₂ : β → ℤ) (K : ℤ) (report : α → β → τ → τ × Bool) (view₁ : σ₁ → List α) (hread₁ : RowMerge.IsReader read₁ view₁) (view₂ : σ₂ → List β) (hread₂ : RowMerge.IsReader read₂ view₂) (B fuel₁ fuel₂ : ℕ) (s₁ : σ₁) (s₂ : σ₂) (a : τ) : B * ((if (run read₁ key₁ read₂ key₂ K report B fuel₁ fuel₂ s₁ s₂ a).snapshot then 1 else 0) + (run read₁ key₁ read₂ key₂ K report B fuel₁ fuel₂ s₁ s₂ a).outer.state.restores) ≤ 2 * ((TieBuffer.groupView key₁ K view₁ s₁).length * (TieBuffer.groupView key₂ K view₂ s₂).length) := by …Mentions: OAI.LowSpaceSubsetSum.RowMerge.IsReader, OAI.LowSpaceSubsetSum.TieGroup.run, OAI.LowSpaceSubsetSum.TieBuffer.groupView