File size: 4,425 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Computability.DepthThree.HardSliceProbability
import OAI.Computability.DepthThree.HardSliceSelection

namespace OAI

noncomputable section

open scoped BigOperators Classical

namespace DepthThreeLowerBound

theorem actual_hash_coefficient_window_failure_le {d r h b : β„•}
    (p : Fin r β†’ Bool) [Fact (Irreducible (BinaryAlgebra.inputPolynomialBits p))]
    (hr : 0 < r) (hb : 1 ≀ b) (hh : 0 < h) (q : ℝ)
    (σ : Restriction (Fin d)) (hσ : restrictionWindow q σ)
    (hbound :
      (2 : ℝ) ^ Fintype.card (Live Οƒ) / (2 : ℝ) ^ r +
        sparseMomentBound (Fintype.card (Live Οƒ)) b
          (hardSliceSparseConstant b hb * Fintype.card (Live Οƒ)) h
          ((2 : ℝ) ^ (-(Fintype.card (Live Οƒ) : ℝ) / 4)) ≀
      2 * (2 : ℝ) ^ (-(q * d) / 16)) :
    finiteProb (fun Ο‰ : (Fin (d + r - 1) β†’ Bool) Γ—
        (Fin (2 * h) β†’ BinaryAlgebra.BitQuotient p) =>
      Β¬ corr b (fun z => sign (hashAcceptance p (2 * h) Ο‰.1 Ο‰.2 (fill Οƒ z))) ≀
        (2 : ℝ) ^ (-(q * d) / 16)) ≀
      2 * (2 : ℝ) ^ (-(q * d) / 16) := by
  have hlow : (q * d) / 2 ≀ (Fintype.card (Live Οƒ) : ℝ) := by
    simpa only [restrictionWindow, Fintype.card_fin] using hσ.1
  have hthreshold : (2 : ℝ) ^ (-(Fintype.card (Live Οƒ) : ℝ) / 8) ≀
      (2 : ℝ) ^ (-(q * d) / 16) :=
    Real.rpow_le_rpow_of_exponent_le (by norm_num) (by linarith)
  apply le_trans _ ((actual_hash_coefficient_failure_le p hr Οƒ b hb h hh).trans hbound)
  apply finiteProb_mono
  intro ω hω hsmall
  exact hω (hsmall.trans hthreshold)

theorem exists_good_hash_coefficients {d r h b : β„•}
    (p : Fin r β†’ Bool) [Fact (Irreducible (BinaryAlgebra.inputPolynomialBits p))]
    (hr : 0 < r) (hb : 1 ≀ b) (hh : 0 < h) (q : ℝ)
    (hq : 0 ≀ q) (hq1 : q ≀ 1)
    (hbound : βˆ€ m : β„•, (q * d) / 2 ≀ (m : ℝ) β†’ (m : ℝ) ≀ 2 * (q * d) β†’
      (2 : ℝ) ^ m / (2 : ℝ) ^ r +
        sparseMomentBound m b (hardSliceSparseConstant b hb * m) h
          ((2 : ℝ) ^ (-(m : ℝ) / 4)) ≀ 2 * (2 : ℝ) ^ (-(q * d) / 16)) :
    βˆƒ (u : Fin (d + r - 1) β†’ Bool) (Ξ² : Fin (2 * h) β†’ BinaryAlgebra.BitQuotient p),
      restrictionAvg q (fun Οƒ => if Β¬ goodRestriction q
        ((2 : ℝ) ^ (-(q * d) / 16)) b (hashAcceptance p (2 * h) u Ξ²) Οƒ
        then 1 else 0) ≀ 4 * (2 : ℝ) ^ (-(q * d) / 16) := by
  have hfixed (σ : Restriction (Fin d)) (hσ : restrictionWindow q σ) :
      finiteProb (fun Ο‰ : (Fin (d + r - 1) β†’ Bool) Γ—
          (Fin (2 * h) β†’ BinaryAlgebra.BitQuotient p) =>
        Β¬ corr b (fun z => sign (hashAcceptance p (2 * h) Ο‰.1 Ο‰.2 (fill Οƒ z))) ≀
          (2 : ℝ) ^ (-(q * d) / 16)) ≀
        2 * (2 : ℝ) ^ (-(q * d) / 16) := by
    apply actual_hash_coefficient_window_failure_le p hr hb hh q σ hσ
    apply hbound
    · simpa only [restrictionWindow, Fintype.card_fin] using hσ.1
    · simpa only [restrictionWindow, Fintype.card_fin] using hσ.2
  obtain βŸ¨Ο‰, hΟ‰βŸ© := exists_good_parameter hq hq1 b
    (fun Ο‰ : (Fin (d + r - 1) β†’ Bool) Γ— (Fin (2 * h) β†’ BinaryAlgebra.BitQuotient p) =>
      hashAcceptance p (2 * h) Ο‰.1 Ο‰.2)
    (by simpa only [Fintype.card_fin] using hfixed)
  exact βŸ¨Ο‰.1, Ο‰.2, by simpa only [Fintype.card_fin] using hΟ‰βŸ©

def coefficientInputBits {r t : β„•} (p : Fin r β†’ Bool)
    (Ξ² : Fin t β†’ BinaryAlgebra.BitQuotient p) : Fin t β†’ Fin r β†’ Bool :=
  fun j i => BinaryAlgebra.fieldBit
    (BinaryAlgebra.coordinates (fun i => BinaryAlgebra.bitValue (p i)) (Ξ² j) i)

@[simp] theorem encode_coefficientInputBits {r t : β„•} (p : Fin r β†’ Bool)
    (Ξ² : Fin t β†’ BinaryAlgebra.BitQuotient p) (j : Fin t) :
    BinaryAlgebra.encode (fun i => BinaryAlgebra.bitValue (p i))
      (fun i => BinaryAlgebra.bitValue (coefficientInputBits p Ξ² j i)) = Ξ² j := by
  simp only [coefficientInputBits, BinaryAlgebra.bitValue_fieldBit]
  exact BinaryAlgebra.encode_coordinates _ _

theorem hashAcceptance_coefficientInputBits {d r t : β„•} (p : Fin r β†’ Bool)
    [Fact (Irreducible (BinaryAlgebra.inputPolynomialBits p))]
    (u : Fin (d + r - 1) β†’ Bool) (Ξ² : Fin t β†’ BinaryAlgebra.BitQuotient p) :
    hashAcceptance p t u
      (fun j => BinaryAlgebra.encode (fun i => BinaryAlgebra.bitValue (p i))
        (fun i => BinaryAlgebra.bitValue (coefficientInputBits p Ξ² j i))) =
      hashAcceptance p t u Ξ² := by
  simp only [encode_coefficientInputBits]

end DepthThreeLowerBound

end

end OAI