Documentation

LeanPool.OrderMaintenance.Proof.Top.InsViews

M5: the state after a chunk split, with the path copy completed #

insFin s x: the top structure after insertAround x y z (y, z the new chunks) on the linked core, with the job's path copy completed. Its views, field by field.

The split's job.

Equations
Instances For

    The core with the two new chunks linked around x.

    Equations
    Instances For

      The core after insertAround.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        The top structure after the split, path copy completed.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The core after insertAround #

          theorem OrderMaintenance.Proof.Top.insFinS_P (t : Model.Core) (x y z : ℕ) (f : ℕ → ℕ × ℕ) :
          (insFinS t x y z f).P = t.P
          theorem OrderMaintenance.Proof.Top.insFinS_C (t : Model.Core) (x y z : ℕ) (f : ℕ → ℕ × ℕ) :
          (insFinS t x y z f).C = t.C
          theorem OrderMaintenance.Proof.Top.insFinS_cin (t : Model.Core) (x y z : ℕ) (f : ℕ → ℕ × ℕ) :
          (insFinS t x y z f).cin = (t.cin.setX y (t.cin.getX x)).setX z (t.cin.getX x)
          theorem OrderMaintenance.Proof.Top.insFinS_lpar (t : Model.Core) (x y z : ℕ) (f : ℕ → ℕ × ℕ) :
          (insFinS t x y z f).lpar = (t.lpar.setX y (t.lpar.getX x)).setX z (t.lpar.getX x)
          theorem OrderMaintenance.Proof.Top.insFinS_nodes (t : Model.Core) (x y z : ℕ) (f : ℕ → ℕ × ℕ) :
          (insFinS t x y z f).nodes = (List.foldl (fun (ns : Array Model.Node) (T : ℕ) => ns.modify T (aroundF t x y z f T)) t.nodes (t.cin.getX x)).modify (t.lpar.getX x) fun (n : Model.Node) => { height := n.height, livePar := n.livePar, children := n.children.replace1 x [y, x, z], weight := n.weight, table := n.table, inTables := n.inTables, first := n.first, last := n.last, draining := n.draining, t1 := n.t1, t2 := n.t2, side := n.side, overflowOf := n.overflowOf, alive := n.alive }
          theorem OrderMaintenance.Proof.Top.tagsS_top (t : Model.Core) (y z a b : ℕ) :
          (tagsS t y z a b).P = t.P ∧ (tagsS t y z a b).path = t.path ∧ (tagsS t y z a b).cin = t.cin ∧ (tagsS t y z a b).lpar = t.lpar ∧ (tagsS t y z a b).nodes = t.nodes ∧ (tagsS t y z a b).C = (t.C.modify y fun (C : Model.Chunk) => { next := C.next, prev := C.prev, first := C.first, last := C.last, size := C.size, st := C.st, src := C.src, l := C.l, r := C.r, tag := a, alive := C.alive }).modify z fun (C : Model.Chunk) => { next := C.next, prev := C.prev, first := C.first, last := C.last, size := C.size, st := C.st, src := C.src, l := C.l, r := C.r, tag := b, alive := C.alive }
          theorem OrderMaintenance.Proof.Top.ins0_top (s : Model.Core) (x : ℕ) :
          (ins0 s x).nodes = s.nodes ∧ (ins0 s x).path = s.path ∧ (ins0 s x).cin = s.cin ∧ (ins0 s x).lpar = s.lpar ∧ (ins0 s x).P = s.P ∧ (ins0 s x).C.size = s.C.size + 2
          theorem OrderMaintenance.Proof.Top.ins0_tag (s : Model.Core) (x : ℕ) {c : ℕ} (hc : c < s.C.size) :
          ((ins0 s x).C.getX c).tag = (s.C.getX c).tag
          @[reducible, inline]

          The core right before insertAroundFinish: both tags written.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem OrderMaintenance.Proof.Top.ins3_eq (s : Model.Core) (x f1x i1 : ℕ) :
            ins3 s x f1x i1 = insFinS (ins2 s x f1x i1) x s.C.size (s.C.size + 1) (insF s x)
            theorem OrderMaintenance.Proof.Top.ins2_top (s : Model.Core) (x f1x i1 : ℕ) :
            (ins2 s x f1x i1).P = s.P ∧ (ins2 s x f1x i1).path = s.path ∧ (ins2 s x f1x i1).cin = s.cin ∧ (ins2 s x f1x i1).lpar = s.lpar ∧ (ins2 s x f1x i1).nodes = s.nodes
            theorem OrderMaintenance.Proof.Top.ins3_P (s : Model.Core) (x f1x i1 : ℕ) :
            (ins3 s x f1x i1).P = s.P
            theorem OrderMaintenance.Proof.Top.ins3_cin (s : Model.Core) (x f1x i1 : ℕ) :
            (ins3 s x f1x i1).cin = (s.cin.setX s.C.size (s.cin.getX x)).setX (s.C.size + 1) (s.cin.getX x)
            theorem OrderMaintenance.Proof.Top.ins3_lpar (s : Model.Core) (x f1x i1 : ℕ) :
            (ins3 s x f1x i1).lpar = (s.lpar.setX s.C.size (s.lpar.getX x)).setX (s.C.size + 1) (s.lpar.getX x)
            theorem OrderMaintenance.Proof.Top.ins3_nodes (s : Model.Core) (x f1x i1 : ℕ) :
            (ins3 s x f1x i1).nodes = (List.foldl (fun (ns : Array Model.Node) (T : ℕ) => ns.modify T (aroundF (ins2 s x f1x i1) x s.C.size (s.C.size + 1) (insF s x) T)) s.nodes (s.cin.getX x)).modify (s.lpar.getX x) fun (n : Model.Node) => { height := n.height, livePar := n.livePar, children := n.children.replace1 x [s.C.size, x, s.C.size + 1], weight := n.weight, table := n.table, inTables := n.inTables, first := n.first, last := n.last, draining := n.draining, t1 := n.t1, t2 := n.t2, side := n.side, overflowOf := n.overflowOf, alive := n.alive }
            theorem OrderMaintenance.Proof.Top.ins3_tag (s : Model.Core) (x f1x i1 c : ℕ) :
            (ts (ins3 s x f1x i1)).tag c = if c = s.C.size + 1 then tagZ (ins0 s x) x f1x i1 else if c = s.C.size then tagY (ins0 s x) x f1x i1 else (s.C.getX c).tag

            The top structure after the split, copy completed #

            The new tables: entries y, z around x in every table holding x.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem OrderMaintenance.Proof.Top.ins3_getX (s : Model.Core) (x f1x i1 : ℕ) (hnd : (s.cin.getX x).Nodup) (u : ℕ) :
              (ins3 s x f1x i1).nodes.getX u = insNode s x u

              The new chunks take over the first and last range pointers along the split chunk path.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                A node's range endpoint after inserting replacement chunks along the copied path.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  structure OrderMaintenance.Proof.Top.InsFrame (s : Model.Core) (x f1x i1 : ℕ) (t : TS) :

                  The views of the top structure after the split, with the copy completed.

                  Instances For
                    theorem OrderMaintenance.Proof.Top.insFin_frame (s : Model.Core) (x f1x i1 : ℕ) (hxs : x < s.C.size) (hnd : (s.cin.getX x).Nodup) (hdist : ∀ (i i' : ℕ), 1 ≤ i → i ≤ s.P.H → 1 ≤ i' → i' ≤ s.P.H → pth (ts s) x i = pth (ts s) x i' → i = i') (hex : ∀ (i : ℕ), 1 ≤ i → i ≤ s.P.H → pth (ts s) x i < s.nodes.size) :
                    InsFrame s x f1x i1 (insFin s x f1x i1)