File size: 3,733 Bytes
9dbc64e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import OAI.Computability.DepthThree.AlgebraQuotient
import OAI.Computability.DepthThree.InterpolationSigns

namespace OAI

universe uDepth1 uDepth2

noncomputable section

namespace DepthThreeLowerBound
namespace Interpolation

open BinaryAlgebra

def coefficientEncoding {r : ℕ} (p : Fin r → F2) (t : ℕ) :
    (Fin t → Fin r → Bool) ≃ (Fin t → InputQuotient p) :=
  Equiv.piCongrRight (fun _ =>
    (bitsEquivF2 (Fin r)).trans (coordinates p).toEquiv.symm)

@[simp] theorem coefficientEncoding_apply {r t : ℕ} (p : Fin r → F2)
    (β : Fin t → Fin r → Bool) (j : Fin t) :
    coefficientEncoding p t β j = encode p (fun i => bitValue (β j i)) := rfl

theorem finiteAvg_coefficientEncoding {r t : ℕ} (p : Fin r → F2)
    (Φ : (Fin t → InputQuotient p) → ℝ) :
    finiteAvg (fun β : Fin t → Fin r → Bool =>
      Φ (fun j => encode p (fun i => bitValue (β j i)))) = finiteAvg Φ :=
  finiteAvg_equiv (coefficientEncoding p t) Φ

theorem finiteAvg_degreeZero {r : ℕ} (p : Fin r → F2) (hr : 0 < r)
    (Φ : F2 → ℝ) :
    finiteAvg (fun z : InputQuotient p => Φ (degreeZero (inputPolynomial_monic p) z)) =
      finiteAvg Φ := by
  classical
  exact AlgebraFiniteFibers.finiteAvg_comp
    (degreeZero (inputPolynomial_monic p)).toAddMonoidHom
    (degreeZero_surjective (inputPolynomial_monic p)
      (by simpa only [inputPolynomial_natDegree] using hr)) Φ

section Irreducible

variable {r t : ℕ} (p : Fin r → F2)
variable [Fact (Irreducible (inputPolynomial p))]
variable (hr : 0 < r)
variable {ι : Type uDepth1} [Fintype ι] [DecidableEq ι]
variable (a : ι → InputQuotient p) (hsize : Fintype.card ι ≤ t)
variable (ha : Function.Injective a)

include hr hsize ha

theorem finiteAvg_quotient_acceptEval (Φ : (ι → Bool) → ℝ) :
    finiteAvg (fun β : Fin t → InputQuotient p =>
      Φ (acceptEval (degreeZero (inputPolynomial_monic p)) t a β)) = finiteAvg Φ := by
  exact finiteAvg_acceptEval (degreeZero (inputPolynomial_monic p))
    (degreeZero_one (inputPolynomial_monic p)
      (by simpa only [inputPolynomial_natDegree] using hr)) a hsize ha Φ

theorem finiteAvg_encoded_acceptEval (Φ : (ι → Bool) → ℝ) :
    finiteAvg (fun β : Fin t → Fin r → Bool =>
      Φ (acceptEval (degreeZero (inputPolynomial_monic p)) t a
        (fun j => encode p (fun i => bitValue (β j i))))) = finiteAvg Φ := by
  calc
    finiteAvg (fun β : Fin t → Fin r → Bool =>
        Φ (acceptEval (degreeZero (inputPolynomial_monic p)) t a
          (fun j => encode p (fun i => bitValue (β j i))))) =
        finiteAvg (fun β : Fin t → InputQuotient p =>
          Φ (acceptEval (degreeZero (inputPolynomial_monic p)) t a β)) :=
      finiteAvg_coefficientEncoding p
        (fun β : Fin t → InputQuotient p =>
          Φ (acceptEval (degreeZero (inputPolynomial_monic p)) t a β))
    _ = finiteAvg Φ := finiteAvg_quotient_acceptEval p hr a hsize ha Φ

end Irreducible

theorem finiteAvg_encoded_acceptEval_finset {r t : ℕ} (p : Fin r → F2)
    [Fact (Irreducible (inputPolynomial p))] (hr : 0 < r) {Z : Type uDepth2} [DecidableEq Z]
    (a : Z → InputQuotient p) (s : Finset Z) (hsize : s.card ≤ t)
    (ha : Set.InjOn a (↑s : Set Z)) (Φ : (s → Bool) → ℝ) :
    finiteAvg (fun β : Fin t → Fin r → Bool =>
      Φ (fun z : s => acceptEval (degreeZero (inputPolynomial_monic p)) t a
        (fun j => encode p (fun i => bitValue (β j i))) z)) = finiteAvg Φ := by
  classical
  apply finiteAvg_encoded_acceptEval p hr (fun z : s => a z)
    (by simpa only [Fintype.card_coe] using hsize)
  intro x y hxy
  exact Subtype.ext (ha x.property y.property hxy)

end Interpolation
end DepthThreeLowerBound

end

end OAI