feat(Circuit): strengthen Shannon's bound and drop finiteness assumptions #1130
The numbers 2 ^ n / n and 2 ^ 2 ^ n should be given names conveying the significance. Also, do you have theorems about that? For example, do you have a theorem saying that the number of all possible boolean functions with n inputs is 2 ^ 2 ^ n?
Nitpick: I think the (fun n => ...) expression should be put on a single line if possible.
The numbers Nat.card U : ℝ) ^ (Nat.card U ^ n) and Nat.card U ^ n / n should be given names conveying their significance. Do you have a theorem saying that the former is the number of all possible functions with n inputs?
Nitpick: I think the (fun n => ...) expression should be put on a single line if possible. At least the line break should happen after =>, not after /.
I don't understand why you want to worry about the case [Infinite U]. The Shannon bound doesn't even make sense in that case, right? Also, doesn't this theorem require a signature with an infinite number of operation symbols? In any case, this result seems completely unrelated to the rest of this PR.
In the main commit message, shouldn't "arity at most two" be "arity at least two"?
open Nat when appropriate, so that you can write Card or Nat.Card.
Good call, will remove this.
Do you have a theorem saying that the former is the number of all possible functions with n inputs?
Not sure if that is in the tree already, I'll check and confirm.
ctchou
SamuelSchlesinger
Shows that almost all functions need more than
qⁿ/ngates.Shannon.tendsto_card_computableFunctions_divsays that, over a finite carrier withq ≥ 2elements and any finite signature of arity at most two, the fraction of functions onninputs computable withqⁿ/ngates tends to zero, andBoolean.Shannon.tendsto_card_computableFunctions_divspecializes it to De Morgan circuits. The existing counting argument already gives this once the exponent gap is taken one larger, which bounds the count byexp(-s) · q^(qⁿ)ats = ⌊qⁿ/n⌋.Shannon.exists_hard_functionno longer assumes[Finite σ.Op]: it takes its hard function from the binary full basis, which simulates every signature of arity at most two gate by gate.fullInterpretation_isCompleteand theIsCompleteinstance for full bases no longer assume[Finite U]: on an infinite carrier, a bijectionU × U ≃ Ulets binary gates pair up the inputs into one element, and one more gate decodes it and applies the function. Both only drop instance arguments, so no caller changes.Assisted by Claude.