File size: 3,944 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 | import Mathlib
import OAI.Computability.VertexCover.Reduction.IncrementNorm
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.LabelCover
def gridRational (d : ℕ) (v : Fin (2*d+1)) : ℚ :=
2 * ((v.val : ℚ) - d) / (2*d+1)
abbrev Vertex (Φ : LabelCover) (d : ℕ) :=
Φ.Seeds d × (Fin d → Fin (Φ.WeightDimension d) → Fin (2*d+1))
noncomputable def sumVector (Φ : LabelCover) {d : ℕ} (v : Φ.Vertex d) :
Φ.Coordinate d → ℝ :=
∑ j, Φ.increment (Φ.query v.1 j) (fun k => (gridRational d (v.2 j k) : ℝ))
noncomputable def graph (Φ : LabelCover) (d : ℕ) (t : ℝ) : SimpleGraph (Φ.Vertex d) where
Adj v w := v ≠ w ∧ Φ.compatibilityNorm (Φ.sumVector v + Φ.sumVector w) ≤ 2*t
symm := ⟨by intro v w h; exact ⟨h.1.symm, by simpa only [add_comm] using h.2⟩⟩
loopless := ⟨by intro v h; exact h.1 rfl⟩
theorem low_norm_adjacent (Φ : LabelCover) {d : ℕ} {t : ℝ} {v w : Φ.Vertex d}
(hne : v ≠ w) (hv : Φ.compatibilityNorm (Φ.sumVector v) ≤ t)
(hw : Φ.compatibilityNorm (Φ.sumVector w) ≤ t) : (Φ.graph d t).Adj v w := by
refine ⟨hne, (Φ.norm_add_le _ _).trans ?_⟩
linarith
theorem low_norm_subsingleton (Φ : LabelCover) {d : ℕ} {t : ℝ}
(A : Set (Φ.Vertex d)) (hA : (Φ.graph d t).IsIndepSet A) :
{v ∈ A | Φ.compatibilityNorm (Φ.sumVector v) ≤ t}.Subsingleton := by
intro v hv w hw
by_contra hne
exact ((SimpleGraph.isIndepSet_iff _).mp hA hv.1 hw.1 hne)
(Φ.low_norm_adjacent hne hv.2 hw.2)
theorem honestSelection_form_increment (Φ : LabelCover) {d : ℕ}
(A : Φ.Labeling) (hA : ∀ c, Φ.Satisfies A c) (i : Φ.Query d)
(s : Fin (Φ.WeightDimension d) → ℝ) :
∑ p ∈ Φ.honestSelection A hA d, Φ.increment i s p =
s (i.slot (Φ.localOfSatisfying A hA i)) := by
classical
unfold honestSelection
rw [Finset.sum_image]
· have hz : ∀ j : Φ.Query d, Φ.increment i s ⟨j, Φ.localOfSatisfying A hA j⟩ =
if j = i then s (i.slot (Φ.localOfSatisfying A hA i)) else 0 := by
intro j
split_ifs with h
· subst j; exact Φ.increment_same _ _ _
· exact Φ.increment_other _ _ _ h
simp only [hz]
simp
· intro i _ j _ h
exact congrArg Sigma.fst h
noncomputable def honestSum (Φ : LabelCover) {d : ℕ} (A : Φ.Labeling)
(hA : ∀ c, Φ.Satisfies A c) (v : Φ.Vertex d) : ℝ :=
∑ j, (gridRational d (v.2 j ((Φ.query v.1 j).slot
(Φ.localOfSatisfying A hA (Φ.query v.1 j)))) : ℝ)
theorem honestSelection_form_sumVector (Φ : LabelCover) {d : ℕ}
(A : Φ.Labeling) (hA : ∀ c, Φ.Satisfies A c) (v : Φ.Vertex d) :
∑ p ∈ Φ.honestSelection A hA d, Φ.sumVector v p = Φ.honestSum A hA v := by
classical
simp only [sumVector, Finset.sum_apply]
rw [Finset.sum_comm]
simp only [honestSelection_form_increment, honestSum]
theorem honest_large_sum_independent (Φ : LabelCover) {d : ℕ} (t : ℝ)
(A : Φ.Labeling) (hA : ∀ c, Φ.Satisfies A c) :
(Φ.graph d t).IsIndepSet {v | t < Φ.honestSum A hA v} := by
rw [SimpleGraph.isIndepSet_iff]
intro v hv w hw _ hadj
have hform := Φ.form_le_norm (Φ.sumVector v + Φ.sumVector w)
(Φ.honestSelection A hA d) (Φ.honestSelection_compatible A hA d)
simp only [Pi.add_apply, Finset.sum_add_distrib, honestSelection_form_sumVector] at hform
have hsum := (le_abs_self (Φ.honestSum A hA v + Φ.honestSum A hA w)).trans
(hform.trans hadj.2)
change t < Φ.honestSum A hA v at hv
change t < Φ.honestSum A hA w at hw
linarith
end VertexCover.LabelCover
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
|