NLA-lib Explorer

NLAlib.Ops.unaryMap_wp_of_disj_or_eq

Library · theorem

The unary map writes the mapped input vector to the output buffer and preserves all other memory and the random-tape position. Inputs are stored words and the output has room; operands may coincide exactly or occupy disjoint blocks of the same buffer. The run without its frame, as an exact final memory: a step in the proof of NLAlib.Ops.unaryMap_writes_of_disj_or_eq, the common proof of the two routines of this tree, and used directly by the entry kernels of NLAlib/Ops/Blas/Hermitian.lean and the matrix copy.

NLAlib.Ops.unaryMap_wp_of_disj_or_eq {K Op Tst : Type} [Inhabited K] {o : Op} {f : K → K}
  {I : Ops.Interp Op Tst K}
  (hI : I.IsFn Ops.Mode.total o (Ops.BlockFn.un fun x ↦ some (f x)) Ops.AnyOperands) {md : Ops.Mode}
  {τ : Ops.Tape K} {n : ℕ} {x y : ℕ × ℕ} {m : Ops.Mem K} {xs : List K}
  (hxy : Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 n) (Ops.Store.inBlock y.1 y.2 n) ∨ x = y)
  (hx : m.store.readBlock x.1 x.2 n = some xs) (hy : y.2 + n ≤ m.store.len y.1)
  {Q : Ops.Mem K → Prop} (hQ : Q (m.updBlock y (List.map f xs))) :
  Ops.Wp md I τ (Ops.unaryMap o) (Ops.Env.frame [n] [x, y]) Q m

Full source on GitHub

Import NLAlib.Ops.Blas.Map.