Documentation

LeanPool.OrderMaintenance.Proof.Top.RunStart

M5: running startDrain #

The data startDrain v computes from the state (children, weights, the cut, the sides, the two parts), and its run as a sequence of pure state updates.

The data #

@[reducible, inline]

Height of the node whose drain is being started.

Equations
Instances For
    @[reducible, inline]

    Live children of the node whose drain is being started.

    Equations
    Instances For
      @[reducible, inline]

      Weight of an entry at the drain source's height.

      Equations
      Instances For
        @[reducible, inline]

        The source's child weights in live-list order.

        Equations
        Instances For
          @[reducible, inline]

          The adjacent-child restriction used to choose a drain cut.

          Equations
          Instances For
            @[reducible, inline]

            Index of the selected balanced cut in the source's child list.

            Equations
            Instances For
              @[reducible, inline]

              The child at the selected cut, or zero beyond the child list.

              Equations
              Instances For
                @[reducible, inline]

                Table entries whose sides must be assigned when this drain starts.

                Equations
                Instances For
                  @[reducible, inline]

                  The checked side assignment for the source's table entries.

                  Equations
                  Instances For
                    @[reducible, inline]

                    Table entries assigned to the left drain target.

                    Equations
                    Instances For
                      @[reducible, inline]

                      Table entries assigned to the right drain target.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[reducible, inline]

                        Live children assigned to the left drain target.

                        Equations
                        Instances For
                          @[reducible, inline]

                          Live children assigned to the right drain target.

                          Equations
                          Instances For

                            The updates #

                            addTable h w e, as a state update.

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

                              setParent h w e, as a state update.

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

                                The two new nodes.

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

                                  v1, v2 around v in every table holding v.

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

                                    The tables of the two newly allocated targets.

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

                                      The entries learn their new tables.

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

                                        The children of the first target.

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

                                          The children of the second target.

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

                                            The state after starting the drain of the selected node.

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

                                              What the stages keep #

                                              theorem OrderMaintenance.Proof.Top.fold_aroundF_children (s0 : Model.Core) (e n1 n2 : ℕ) (f : ℕ → ℕ × ℕ) (u : ℕ) (l : List ℕ) (ns : Array Model.Node) :
                                              ((List.foldl (fun (ns : Array Model.Node) (T : ℕ) => ns.modify T (aroundF s0 e n1 n2 f T)) ns l).getX u).children = (ns.getX u).children

                                              The run #

                                              theorem OrderMaintenance.Proof.Top.zip_map_map {α β γ : Type} (l : List α) (f : α → β) (g : α → γ) :
                                              l.zip ((List.map f l).zip (List.map g l)) = List.map (fun (x : α) => (x, f x, g x)) l
                                              theorem OrderMaintenance.Proof.Top.startDrain_run {t : Model.Core} {v : ℕ} {side : List (ℕ × Model.Side)} (hk2 : 2 ≤ (sKids t v).length) (hk0 : ¬(sH t v > 1 ∧ sK t v = 0)) (hside : sSideO t v = some side) (hroom : ∀ T ∈ (t.nodes.getX v).inTables, RoomOK t v T) (hnd : (t.nodes.getX v).inTables.Nodup) (hall : ∀ e ∈ sKids t v, (Model.lookup side e).isSome = true) (hpar : v ∈ (t.nodes.getX (t.nodes.getX v).livePar).children) (hv : v < t.nodes.size) :