NLA-lib Explorer

NLAlib.Ops.Geometry.allocated

Library · theorem

The geometry after a scratch allocation: if the views have their geometry in μ, and the store s extends μ's store (unchanged below its length L) by fresh buffers L, \dots, L + k - 1 of the lengths ns (k the length of ns), then the views followed by the fresh views (L + i, 0) have their geometry, with the lengths lens ++ ns, in s.

NLAlib.Ops.Geometry.allocated {K : Type} {views : List (ℕ × ℕ)} {lens : List ℕ} {μ : Ops.Mem K}
  (h : Ops.Geometry views lens μ) {ns : List ℕ} {s : Ops.Store K}
  (hs : List.length s = List.length μ.store + ns.length)
  (hlens : ∀ (i : ℕ) (hi : i < ns.length), s.len (List.length μ.store + i) = ns[i])
  (hBelow : Ops.Store.Below (List.length μ.store) μ.store s) :
  Ops.Geometry (views ++ List.map (fun i ↦ (List.length μ.store + i, 0)) (List.range ns.length))
    (lens ++ ns) { store := s, pos := μ.pos }

Full source on GitHub

Import NLAlib.Ops.Logic.Geometry.