Finite random restrictions -- proof internals #
theorem
Complexity.RandomRestriction.eventCount_coordinate_free_internal
{N : ℕ}
(q : ℕ)
(index : Fin N)
:
(eventCount q fun (restriction : Restriction.On N) => restriction index = none) = (2 * q + 1) ^ (N - 1)
Exactly (2q + 1)^(N - 1) seeds leave one prescribed coordinate
free.
theorem
Complexity.RandomRestriction.eventCount_le_internal
{N q : ℕ}
(event : Restriction.On N → Prop)
[DecidablePred event]
:
theorem
Complexity.RandomRestriction.eventCount_congr_internal
{N q : ℕ}
(left right : Restriction.On N → Prop)
[DecidablePred left]
[DecidablePred right]
(hiff : ∀ (restriction : Restriction.On N), left restriction ↔ right restriction)
:
theorem
Complexity.RandomRestriction.eventCount_mono_internal
{N q : ℕ}
(left right : Restriction.On N → Prop)
[DecidablePred left]
[DecidablePred right]
(himp : ∀ (restriction : Restriction.On N), left restriction → right restriction)
:
theorem
Complexity.RandomRestriction.eventCount_or_le_add_internal
{N q : ℕ}
(left right : Restriction.On N → Prop)
[DecidablePred left]
[DecidablePred right]
:
(eventCount q fun (restriction : Restriction.On N) => left restriction ∨ right restriction) ≤ eventCount q left + eventCount q right
theorem
Complexity.RandomRestriction.eventCount_exists_le_sum_internal
{N q : ℕ}
{ι : Type}
[Fintype ι]
(event : ι → Restriction.On N → Prop)
[(index : ι) → DecidablePred (event index)]
:
(eventCount q fun (restriction : Restriction.On N) => ∃ (index : ι), event index restriction) ≤ ∑ index : ι, eventCount q (event index)
theorem
Complexity.RandomRestriction.card_eventSeed_internal
{N q : ℕ}
(event : Restriction.On N → Prop)
[DecidablePred event]
:
theorem
Complexity.RandomRestriction.eventCount_freeVariables_nonempty_internal
(N q : ℕ)
:
(eventCount q fun (restriction : Restriction.On N) => restriction.freeVariables.Nonempty) = (2 * q + 1) ^ N - (2 * q) ^ N
theorem
Complexity.RandomRestriction.eventCount_one_le_freeVariables_internal
(N q : ℕ)
:
(eventCount q fun (restriction : Restriction.On N) => 1 ≤ restriction.freeVariables.card) = (2 * q + 1) ^ N - (2 * q) ^ N
theorem
Complexity.RandomRestriction.eventCount_mul_pow_le_of_encoding_internal
{N q : ℕ}
(event : Restriction.On N → Prop)
[DecidablePred event]
(queryCount : ℕ)
(Code : Type)
[Fintype Code]
(encode : EventSeed N q event × (Fin queryCount → Fin q) → Seed N q × Code)
(injective : Function.Injective encode)
: