File size: 5,108 Bytes
92416a2 | 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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | import Mathlib
import OAI.Computability.VertexCover.Machines.SimpleLC
import OAI.Computability.VertexCover.Machines.PowerLC
import OAI.Computability.VertexCover.Machines.GraphOutput
import OAI.Computability.VertexCover.Machines.FinalCNFCorrect
import OAI.Computability.VertexCover.Machines.Approximation
namespace OAI
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
section
namespace VertexCover.Machine.MainReduction
open UniqueGames UniqueGames.Foundations
open ClauseProjection
noncomputable section
def gapInput (F : Target.Formula) : SimpleLC.NEFormula :=
⟨PCP.TableIteration.gapMap fixedBaseTable F,
PCP.TableIteration.gapMap_nonempty fixedBaseTable F⟩
def gapInputPoly : Poly FormulaParser.targetCode SimpleLC.code gapInput :=
(FinalCNFMachine.gapPoly fixedBaseTable).encodeCongr id (fun _ => rfl) (fun _ => rfl)
def base (input : List Bool) : FixedLC 7 2 :=
SimpleLC.output (gapInput (BinaryFormula.dense (inputFormula input)))
def basePoly : Poly id FixedLC.code base :=
(((FormulaParser.inputFormulaPoly.comp FormulaParser.densePoly).comp gapInputPoly).comp
SimpleLC.outputPoly).congr (fun _ => rfl)
theorem base_toLC (input : List Bool) :
(base input).toLC=baseReduction (BinaryFormula.dense (inputFormula input)) := rfl
def repeated (σ : ℝ) (hσ : 0<σ) (input : List Bool) :
FixedLC (7^repetitionLength σ hσ) (2^repetitionLength σ hσ) :=
(base input).power (repetitionLength σ hσ)
def repeatedPoly (σ : ℝ) (hσ : 0<σ) :
Poly id FixedLC.code (repeated σ hσ) :=
basePoly.comp (FixedLC.powerPoly (by decide) (by decide) (repetitionLength σ hσ))
def repetitionIso (σ : ℝ) (hσ : 0<σ) (input : List Bool) :
LabelCover.Iso (repeated σ hσ input).toLC (binaryReduction σ hσ input) :=
LabelCover.numberIso (base input).toLC (repetitionLength σ hσ)
theorem repeated_complete (σ : ℝ) (hσ : 0<σ) (input : List Bool) (h : ThreeSAT input) :
∃ A : (repeated σ hσ input).toLC.Labeling,
∀ e, (repeated σ hσ input).toLC.Satisfies A e := by
obtain ⟨A,hA⟩ := binaryReduction_complete σ hσ input h
exact ⟨(repetitionIso σ hσ input).symm.labeling A,
(repetitionIso σ hσ input).symm.perfect A hA⟩
theorem repeated_sound (σ : ℝ) (hσ : 0<σ) (input : List Bool) (h : ¬ThreeSAT input) :
(repeated σ hσ input).toLC.value < σ := by
rw [(repetitionIso σ hσ input).value_eq]
exact binaryReduction_sound σ hσ input h
def construct (m : ℕ) (hm : 4 ≤ m) (input : List Bool) : ExplicitGraph :=
GraphMachine.explicitGraph (repeated (Parameters.σ m) (Parameters.σ_between m hm).1 input)
(Parameters.d m) (Parameters.t m)
def constructPoly (m : ℕ) (hm : 4 ≤ m) : Poly id ExplicitGraph.bits (construct m hm) :=
(repeatedPoly (Parameters.σ m) (Parameters.σ_between m hm).1).comp
(GraphMachine.outputPoly (pow_pos (by decide) _) (pow_pos (by decide) _)
(Parameters.d m) (Parameters.t m))
theorem construct_complete (m : ℕ) (hm : 4 ≤ m) (input : List Bool) (h : ThreeSAT input) :
((construct m hm input).coverNumber:ℝ) <
(1/2+1/(m:ℝ))*(construct m hm input).n := by
let I := repeated (Parameters.σ m) (Parameters.σ_between m hm).1 input
obtain ⟨A,hA⟩ := repeated_complete (Parameters.σ m) (Parameters.σ_between m hm).1 input h
obtain ⟨C,hC,hcard⟩ := I.toLC.graph_completeness_cover m hm A hA
exact ExplicitGraph.numbered_complete _ (GraphMachine.fullEquiv I (Parameters.d m)) C hC _ hcard
theorem construct_sound (m : ℕ) (hm : 4 ≤ m) (input : List Bool) (h : ¬ThreeSAT input) :
(1-1/(m:ℝ))*(construct m hm input).n < ((construct m hm input).coverNumber:ℝ) := by
let I := repeated (Parameters.σ m) (Parameters.σ_between m hm).1 input
have hv := repeated_sound (Parameters.σ m) (Parameters.σ_between m hm).1 input h
exact ExplicitGraph.numbered_sound _ (GraphMachine.fullEquiv I (Parameters.d m)) _
(I.toLC.graph_soundness_cover m hm hv.le)
def reduction (m : ℕ) (hm : 4 ≤ m) : GapReduction m where
construct := construct m hm
computation := (constructPoly m hm).computation
finiteAlphabet := (constructPoly m hm).finiteAlphabet
completeness := construct_complete m hm
soundness := construct_sound m hm
end
end VertexCover.Machine.MainReduction
namespace VertexCover
theorem explicit_cover_gap (m : ℕ) (hm : 4 ≤ m) : Nonempty (GapReduction m) :=
⟨Machine.MainReduction.reduction m hm⟩
theorem every_fixed_factor_below_two (α : ℝ) (hα : 1 ≤ α) (hα2 : α < 2)
(algorithm : Approximation α) : Nonempty ThreeSATDecision := by
obtain ⟨m,hm,hsep⟩ := exists_separating_integer hα2
exact ⟨decisionOfGap hα m hm hsep (Machine.MainReduction.reduction m hm) algorithm⟩
end VertexCover
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end OAI
|