import Mathlib import OAI.Computability.VertexCover.PCP.AssignmentTester import OAI.Computability.VertexCover.PCP.CodeComposition namespace OAI noncomputable section namespace UniqueGames.Foundations.PCP.AlphabetReduction open UniqueGames.Foundations.Hastad open CodeComposition variable {A : Type*} [Fintype A] [DecidableEq A] [Nonempty A] abbrev LegalPair (accepts : A → A → Bool) := {p : A × A // accepts p.1 p.2 = true} abbrev InputCoordinate (A : Type*) := Bool × Cube A def pairEncoding (accepts : A → A → Bool) (p : LegalPair accepts) : InputCoordinate A → Bool := pairWord (codeword p.1.1) (codeword p.1.2) def edgeTesterReject (accepts : A → A → Bool) (left right : Cube A → Bool) (F : Cube (LegalPair accepts) → Bool) : ℝ := AssignmentTester.explicitTesterReject (pairEncoding accepts) (pairWord left right) F theorem rejected_edge_tester_bound (accepts : A → A → Bool) (left right : Cube A → Bool) (F : Cube (LegalPair accepts) → Bool) (hbad : accepts (nearest left) (nearest right) = false) : 1 / 2048 ≤ edgeTesterReject accepts left right F := by have hfar (p : LegalPair accepts) : (1 / 8 : ℝ) ≤ AssignmentTester.distance (pairWord left right) (pairEncoding accepts p) := by have h := rejected_pair_far accepts left right hbad p.1.1 p.1.2 p.2 convert h using 1 rfl have h := AssignmentTester.explicit_proximity_soundness (pairEncoding accepts) (pairWord left right) F (δ := 1 / 8) (by norm_num) (by norm_num) hfar norm_num at h exact h omit [Nonempty A] in theorem honest_edge_tester (accepts : A → A → Bool) (a b : A) (hab : accepts a b = true) : edgeTesterReject accepts (codeword a) (codeword b) (fun f => f ⟨(a, b), hab⟩) = 0 := by unfold edgeTesterReject rw [AssignmentTester.explicitTesterReject_eq] exact AssignmentTester.tester_perfect_completeness (pairEncoding accepts) ⟨(a, b), hab⟩ end UniqueGames.Foundations.PCP.AlphabetReduction end end OAI