File size: 1,355 Bytes
2f887db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Computability.PerfectCompleteness.Machines.BinaryParsingLemmas
import OAI.Computability.PerfectCompleteness.Machines.EncodingLemmas
import OAI.Computability.PerfectCompleteness.Model
import OAI.Computability.PerfectCompleteness.Reduction.Value
import OAI.Computability.UniqueGames.Machines.MachineFiniteAlphabet

namespace OAI

section

namespace PerfectCompleteness

open Turing UniqueGamesTheorem.Foundations.Complexity

namespace BinaryGapReduction

variable {δ : ℚ} (reduction : BinaryGapReduction δ)

theorem nonempty (input : List Bool) : (reduction.construct input).edges ≠ [] :=
  (reduction.construct input).nonempty

theorem exactly_two (input : List Bool)
    (edge : Fin (reduction.construct input).edges.length) (label : Fin reduction.alphabet) :
    ((List.finRange (2 * reduction.alphabet)).filter
      (fun a => decide ((reduction.construct input).edges[edge].projection.images[a] = label))).length = 2 :=
  (reduction.construct input).edges[edge].projection.exactlyTwo label

theorem malformed_soundness (input : List Bool)
    (malformed : BinaryEncoding.decodeFormula input = none) :
    (reduction.construct input).value ≤ (δ : ℝ) := by
  apply reduction.soundness input
  rintro ⟨formula, decoded, _⟩
  rw [malformed] at decoded
  cases decoded

end BinaryGapReduction
end PerfectCompleteness

end

end OAI