Counting the actual guesses and register states #
Operation symbols and their fan-in do not enter these counts. Each special occurrence contributes one guessed bit and one finite register.
theorem
Algebraic.Aggregate.card_registers_le
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → Fintype (State j)]
(p : Program (signature State) n g)
:
Fintype.card (Registers p) ≤ 2 ^ ∑ gate : SpecialGate p, Nat.clog 2 (Fintype.card (Register p gate))
theorem
Algebraic.Aggregate.budget_le_of_register_bits
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → Fintype (State j)]
(p : Program (signature State) n g)
(bits : ℕ)
(h : ∀ (gate : SpecialGate p), Nat.clog 2 (Fintype.card (Register p gate)) ≤ bits)
:
Uniform register bit bounds turn the actual-occurrence budget into a gate-count bound.
theorem
Algebraic.Aggregate.budget_le_of_register_card
{J : Type}
{State : J → Type}
{n g : ℕ}
[(j : J) → Fintype (State j)]
(p : Program (signature State) n g)
(bits : ℕ)
(h : ∀ (gate : SpecialGate p), Fintype.card (Register p gate) ≤ 2 ^ bits)
:
A uniform state-count bound supplies the corresponding register bit bound.