Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Separation.TowerPlan.Counts

The tower plan: numbers of units #

The numbers of the tower plan of [Ant26] (proof of Theorem H.2; modules Nc.Tow.Flow and Nc.Tow.Tree) are functions of the numbers n of initial units and of the outcomes o of the moves, the number of units on every channel. A unit is alive when the plan still moves it: all units of a channel of a relay with the expected outcome, and all units but the last of a channel of a law move with a short outcome. The load of a target is the number of alive units with that target. A move uses a number of units that is determined by the loads of the targets of earlier moves: a relay takes the load of its input when it is active, and a law move takes the least number of units into which the end segments at its vertex fit, for the first kind of law that attains it. Whether a relay of a stage is active depends on the type that the loads of the edges of the stage (edgeLoads) choose in the tree of the tower (Cslib.CoveringTower.Tower.IsChosenType).

Main definitions #

Main results #

References #

def Cslib.Circuits.Arithmetic.Separation.TowerPlan.edgeLoads {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) (j : ℕ) :
T.Ed j → ℕ

The loads of the edges of the level j, from the loads of the targets; 0 above the last level.

theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.edgeLoads_of_lt {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) {j : ℕ} (hj : j < J + 1) (e : T.Ed j) :
edgeLoads L j e = L (Target.edge ⟨j, hj⟩ e)

The loads of the edges of a level j ≤ J.

def Cslib.Circuits.Arithmetic.Separation.TowerPlan.Relay.Active {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) :
Relay T m A → Prop

The relay is used: an inner relay goes through the hosts of the chosen type of the loads of the edges of its stage (Cslib.CoveringTower.Tower.IsChosenType), and the way through the next level is taken by the edges of the chosen type.

Instances For
    theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.Relay.active_congr {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} {L L' : Target T m A → ℕ} {x : Relay T m A} (hL : ∀ (τ : Target T m A), τ.time ≤ time m x → L τ = L' τ) :
    Active L x ↔ Active L' x

    Whether a relay is used depends on the loads of earlier targets only.

    def Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.Fits {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) {FL : VertexLaws F T} (l : VertexMove FL) (t : ℕ) :

    The end segments at the vertex fit into t units at every slot of the law.

    Instances For
      @[instance_reducible]
      instance Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.instDecidableFits {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) {FL : VertexLaws F T} (l : VertexMove FL) (t : ℕ) :
      Decidable (Fits L l t)
      noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.minUnits {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) {FL : VertexLaws F T} (l : VertexMove FL) :

      The number of units at a vertex: the least number into which the end segments fit, for some kind of law.

      def Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.IsPicked {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) {FL : VertexLaws F T} (l : VertexMove FL) :

      The kind of law that is used at a vertex: the first one into which the end segments fit with the least number of units.

      Instances For
        @[instance_reducible]
        noncomputable instance Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.instDecidableIsPicked {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} (L : Target T m A → ℕ) {FL : VertexLaws F T} (l : VertexMove FL) :
        theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.isPicked_congr {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} {L L' : Target T m A → ℕ} {FL : VertexLaws F T} {l : VertexMove FL} (hL : ∀ (q : Sym2 T.Fl), L (Target.segment l.stage l.type l.vertex q) = L' (Target.segment l.stage l.type l.vertex q)) :

        Which kind of law is used at a vertex depends on the end segments at the vertex only.

        theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.kind_eq_of_isPicked {F : Type u_1} [CommSemiring F] {h b D J r m A : ℕ} {T : CoveringTower.Tower h b D J r} {L : Target T m A → ℕ} {FL : VertexLaws F T} {l : VertexMove FL} {d : FL.Kind} (h1 : IsPicked L l) (h2 : IsPicked L (l.withKind d)) :
        l.kind = d

        The kind of law that is used at a vertex is unique.

        noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.countOfLoad {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (L : Target T m A → ℕ) :
        Move R ch FL → ℕ

        The number of units of a move, from the loads: a relay that is used takes the units of its input, and the law move of the kind that is used takes the number of units at its vertex.

        Every base party has at most lhat units at the beginning.

        Instances For
          @[instance_reducible]
          noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.initialLoad {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} (R : CoveringTower.Routes T m Uu) (ch : Fin A ↪ T.X 0) (lhat : ℕ) (n : Fin A → Fin A → ℕ) (τ : Target T m A) :

          The number of initial units with the target τ; there are none if a base party has too many units.

          def Cslib.Circuits.Arithmetic.Separation.TowerPlan.VertexMove.OutcomeShort {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (o : MoveChannel R ch FL → ℕ) (l : VertexMove FL) (t : ℕ) :

          The outcome of a law move is short for t units.

          Instances For
            @[instance_reducible]
            instance Cslib.Circuits.Arithmetic.Separation.TowerPlan.instDecidableOutcomeShort {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (o : MoveChannel R ch FL → ℕ) (l : VertexMove FL) (t : ℕ) :
            def Cslib.Circuits.Arithmetic.Separation.TowerPlan.aliveGiven {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (o : MoveChannel R ch FL → ℕ) :
            MoveChannel R ch FL → ℕ → ℕ

            The number of alive units of a channel, if t units are given in its move: the units of a channel of a relay if their number is t; all units but the last of a channel of a law move if the outcome is short, and at most t of them otherwise.

            noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.loadGiven {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (lhat : ℕ) (n : Fin A → Fin A → ℕ) (o : MoveChannel R ch FL → ℕ) (N : Move R ch FL → ℕ) (τ : Target T m A) :

            The number of alive units with the target τ, if the moves use the numbers N of units.

            noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.countBefore {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (lhat : ℕ) (n : Fin A → Fin A → ℕ) (o : MoveChannel R ch FL → ℕ) :
            ℕ → Move R ch FL → ℕ

            The numbers of units of the moves with times less than t; the other moves have none.

            noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.moveCount {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (lhat : ℕ) (n : Fin A → Fin A → ℕ) (o : MoveChannel R ch FL → ℕ) (mv : Move R ch FL) :

            The number of units of a move.

            noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.alive {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (lhat : ℕ) (n : Fin A → Fin A → ℕ) (o : MoveChannel R ch FL → ℕ) (ν : MoveChannel R ch FL) :

            The number of alive units of a channel.

            noncomputable def Cslib.Circuits.Arithmetic.Separation.TowerPlan.load {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (lhat : ℕ) (n : Fin A → Fin A → ℕ) (o : MoveChannel R ch FL → ℕ) (τ : Target T m A) :

            The load of a target: the number of alive units with the target τ.

            def Cslib.Circuits.Arithmetic.Separation.TowerPlan.GoodOutcome {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} (lhat : ℕ) (n : Fin A → Fin A → ℕ) (o : MoveChannel R ch FL → ℕ) :
            Move R ch FL → Prop

            The outcome of a move is good: exact for a relay; short, and with at least as many units on every channel as the move uses, for a law move.

            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.aliveGiven_le {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {o : MoveChannel R ch FL → ℕ} (ν : MoveChannel R ch FL) (t : ℕ) :
            aliveGiven o ν t ≤ o ν
            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.aliveGiven_zero {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {o : MoveChannel R ch FL → ℕ} (hr : 0 < r) (hb : 0 < b) (ν : MoveChannel R ch FL) :
            aliveGiven o ν 0 = 0

            If no units are given in a move, none of the units of its channels are alive.

            @[simp]
            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.countBefore_zero {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o : MoveChannel R ch FL → ℕ} (mv : Move R ch FL) :
            countBefore lhat n o 0 mv = 0
            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.countBefore_succ {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o : MoveChannel R ch FL → ℕ} (t : ℕ) (mv : Move R ch FL) :
            countBefore lhat n o (t + 1) mv = if mv.time = t then countOfLoad (loadGiven lhat n o (countBefore lhat n o t)) mv else countBefore lhat n o t mv
            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.countBefore_eq {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o : MoveChannel R ch FL → ℕ} (t : ℕ) (mv : Move R ch FL) :
            countBefore lhat n o t mv = if mv.time < t then moveCount lhat n o mv else 0

            The numbers of units of the moves before the time t.

            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.moveCount_eq {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o : MoveChannel R ch FL → ℕ} (mv : Move R ch FL) :
            moveCount lhat n o mv = countOfLoad (load lhat n o) mv

            The numbers of units: the number of units of a move is determined by the loads.

            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.aliveGiven_congr {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {o o' : MoveChannel R ch FL → ℕ} {ν : MoveChannel R ch FL} (hν : ∀ (ν' : MoveChannel R ch FL), ν'.fst = ν.fst → o ν' = o' ν') (t : ℕ) :
            aliveGiven o ν t = aliveGiven o' ν t

            The alive units of a channel depend on the outcome of its move only.

            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.moveCount_congr {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o o' : MoveChannel R ch FL → ℕ} (hr : 0 < r) (hb : 0 < b) {mv : Move R ch FL} (ho : ∀ (ν : MoveChannel R ch FL), ν.fst.time < mv.time → o ν = o' ν) :
            moveCount lhat n o mv = moveCount lhat n o' mv

            The number of units of a move depends on the outcomes of earlier moves only.

            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.load_congr {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o o' : MoveChannel R ch FL → ℕ} (hr : 0 < r) (hb : 0 < b) {τ : Target T m A} {t : ℕ} (hτ : τ.time ≤ t) (ho : ∀ (ν : MoveChannel R ch FL), ν.fst.time < t → o ν = o' ν) :
            load lhat n o τ = load lhat n o' τ

            The load of a target depends on the outcomes of the moves before its time only.

            theorem Cslib.Circuits.Arithmetic.Separation.TowerPlan.goodOutcome_congr {F : Type u_1} [CommSemiring F] {h b D J r m Uu A : ℕ} {T : CoveringTower.Tower h b D J r} {R : CoveringTower.Routes T m Uu} {ch : Fin A ↪ T.X 0} {FL : VertexLaws F T} {lhat : ℕ} {n : Fin A → Fin A → ℕ} {o o' : MoveChannel R ch FL → ℕ} (hr : 0 < r) (hb : 0 < b) {mv : Move R ch FL} (ho : ∀ (ν : MoveChannel R ch FL), ν.fst.time < mv.time → o ν = o' ν) (ho' : ∀ (ν : MoveChannel R ch FL), ν.fst = mv → o ν = o' ν) :
            GoodOutcome lhat n o mv ↔ GoodOutcome lhat n o' mv

            Whether an outcome of a move is good depends on the outcomes up to that move only.