cfahlgren1's picture
download
raw
11.6 kB
import Mathlib
import OAI.Combinatorics.IndependentSets.Expansion.PreprocessingRegularTables
import OAI.Combinatorics.IndependentSets.Expansion.PreprocessingPaddingTables
import OAI.Combinatorics.IndependentSets.Expansion.PreprocessingOverlayTables
import OAI.Combinatorics.IndependentSets.Expansion.LazySpectral
namespace OAI
namespace IndependentSetsGames.Foundations.PCP.PreprocessingTables
open PreprocessingRegularTables
abbrev BaseTable := PreprocessingRegularTables.BaseTable
def degree : Nat := 2 * ((internalDegree + 1) + internalDegree)
theorem degree_eq : degree = Preprocessing.degree := by
unfold degree internalDegree Preprocessing.degree
rw [pow_two]
omega
def regularVertices (t : GraphTables.Table) : Nat := vertexCount t (padding t)
def vertices (t : GraphTables.Table) : Nat := PreprocessingLevels.paddedSize (regularVertices t)
def padded (H : BaseTable) (t : GraphTables.Table) :
PortTables.Table (vertices t) (internalDegree + 1) :=
PreprocessingPaddingTables.pad (regularize H t)
(PreprocessingLevels.le_paddedSize (regularVertices t))
def overlayFamily (H : BaseTable) (t : GraphTables.Table) :
ExpanderTables.Table (vertices t) internalDegree :=
resizeTable (PreprocessingLevels.table_vertexCount_eq_paddedSize (regularVertices t))
(ExpanderTables.family H (PreprocessingLevels.boundedLevel (regularVertices t)))
def preprocess (H : BaseTable) (t : GraphTables.Table) :
PortTables.Table (vertices t) degree :=
PreprocessingOverlayTables.lazy
(PreprocessingOverlayTables.overlay (padded H t) (overlayFamily H t))
def output (H : BaseTable) (t : GraphTables.Table) : PortTables.Input degree :=
⟨vertices t, preprocess H t⟩
def graphTable (H : BaseTable) (t : GraphTables.Table) : GraphTables.Table :=
PortTables.graphTable (preprocess H t)
def outputBits (H : BaseTable) (t : GraphTables.Table) : List Bool :=
PortTables.tableBits (preprocess H t)
theorem regularVertices_ge_darts (t : GraphTables.Table) : t.darts ≤ regularVertices t := by
change t.darts ≤ t.darts + _
omega
theorem regularVertices_le (t : GraphTables.Table) :
regularVertices t ≤ ExpanderFamily.growth * t.darts := vertexCount_le t
theorem vertices_positive (t : GraphTables.Table) : 0 < vertices t :=
PreprocessingLevels.paddedSize_positive _
theorem vertices_le_of_positive (t : GraphTables.Table) (ht : 0 < t.darts) :
vertices t ≤ ExpanderFamily.growth ^ 2 * t.darts := by
have hr : 0 < regularVertices t := ht.trans_le (regularVertices_ge_darts t)
calc
_ ≤ ExpanderFamily.growth * regularVertices t :=
(PreprocessingLevels.paddedSize_bounds hr).2
_ ≤ ExpanderFamily.growth * (ExpanderFamily.growth * t.darts) :=
Nat.mul_le_mul_left _ (regularVertices_le t)
_ = _ := by ring
theorem vertices_eq_one_of_no_darts (t : GraphTables.Table) (ht : t.darts = 0) :
vertices t = 1 := by
unfold vertices regularVertices
rw [vertexCount_eq_zero_of_no_darts t ht, PreprocessingLevels.paddedSize_zero]
theorem vertices_le (t : GraphTables.Table) :
vertices t ≤ ExpanderFamily.growth ^ 2 * (t.darts + 1) := by
by_cases ht : t.darts = 0
· rw [vertices_eq_one_of_no_darts t ht, ht]
have hg : 0 < ExpanderFamily.growth := Nat.zero_lt_one.trans ExpanderFamily.growth_gt_one
have hp : 0 < ExpanderFamily.growth ^ 2 := Nat.pow_pos hg
simpa using Nat.succ_le_of_lt hp
· exact (vertices_le_of_positive t (Nat.pos_of_ne_zero ht)).trans
(Nat.mul_le_mul_left _ (Nat.le_succ _))
theorem darts_eq (H : BaseTable) (t : GraphTables.Table) :
(graphTable H t).darts = vertices t * degree := rfl
theorem darts_le (H : BaseTable) (t : GraphTables.Table) :
(graphTable H t).darts ≤ Preprocessing.sizeFactor * (t.darts + 1) := by
rw [darts_eq]
calc
_ ≤ (ExpanderFamily.growth ^ 2 * (t.darts + 1)) * degree :=
Nat.mul_le_mul_right _ (vertices_le t)
_ = _ := by rw [degree_eq]; unfold Preprocessing.sizeFactor; ring
theorem vertices_le_inputBits (t : GraphTables.Table) :
vertices t ≤ ExpanderFamily.growth ^ 2 * ((GraphTables.tableBits t).length + 1) :=
(vertices_le t).trans (Nat.mul_le_mul_left _
(Nat.add_le_add_right (GraphTables.darts_le_tableBits_length t) 1))
theorem darts_le_inputBits (H : BaseTable) (t : GraphTables.Table) :
(graphTable H t).darts ≤
Preprocessing.sizeFactor * ((GraphTables.tableBits t).length + 1) :=
(darts_le H t).trans (Nat.mul_le_mul_left _
(Nat.add_le_add_right (GraphTables.darts_le_tableBits_length t) 1))
end IndependentSetsGames.Foundations.PCP.PreprocessingTables
namespace IndependentSetsGames.Foundations.PCP.PreprocessingRegularSoundness
open PoweringWalks DegreeReplacement SpectralReturn PreprocessingRegularTables
theorem internalDegree_ge_eight : 8 ≤ internalDegree := by
simpa only [ExpanderFamily.card_port, internalDegree, pow_two] using
ExpanderFamily.port_degree_ge_eight
theorem baseDegree_ne_zero : Expanders.baseDegree ≠ 0 := by
intro h
have hdegree := internalDegree_ge_eight
simp only [internalDegree, h, Nat.zero_mul] at hdegree
omega
theorem resizeTable_certificate {n m q : Nat} (h : n = m)
(table : ExpanderTables.Table n q) (lambda : ℝ)
(certificate : SpectralCertificate (ExpanderTables.graph table) lambda) :
SpectralCertificate (ExpanderTables.graph (resizeTable h table)) lambda := by
cases h
exact certificate
theorem familyCloudTable_certificate_of_pos (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table) (v : Fin t.vertices)
(hk : 0 < PreprocessingCloudIndex.cloudSize t v) :
SpectralCertificate (ExpanderTables.graph (familyCloudTable H t v)) (1 / 2 : ℝ) := by
let : NeZero Expanders.baseDegree := ⟨baseDegree_ne_zero⟩
unfold familyCloudTable
rw [dite_eq_right (Nat.ne_of_gt hk)]
apply resizeTable_certificate
exact ExpanderTables.family_certificate H certificate _
theorem cloudGraphs_certificate_of_pos (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table) (v : Fin t.vertices)
(hk : 0 < PreprocessingCloudIndex.cloudSize t v) :
SpectralCertificate (cloudGraphs t (padding t) (familyCloudTable H t) v)
(1 / 2 : ℝ) := by
exact GraphTransport.reindex_spectralCertificate _ _ _ _
(familyCloudTable_certificate_of_pos H certificate t v hk)
theorem cloud_expansion (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table) (v : Fin t.vertices)
(S : Finset (PreprocessingCloudIndex.PaddedCloud t (padding t) v))
(hsmall : S.card ≤
Fintype.card (PreprocessingCloudIndex.PaddedCloud t (padding t) v) / 2) :
2 * S.card ≤ (CloudRounding.directedCut
(fun ed => ((cloudGraphs t (padding t) (familyCloudTable H t) v).rot ed).1) S).card := by
by_cases hk : PreprocessingCloudIndex.cloudSize t v = 0
· have hzero : Fintype.card (PreprocessingCloudIndex.PaddedCloud t (padding t) v) = 0 := by
rw [PreprocessingCloudIndex.card_paddedCloud, cloudSize_add_padding, hk]
rfl
have hs : S.card = 0 := by omega
simp only [hs, mul_zero, Nat.zero_le]
· exact SpectralCut.cut_card_ge_twice
(cloudGraphs t (padding t) (familyCloudTable H t) v)
(cloudGraphs_certificate_of_pos H certificate t v (Nat.pos_of_ne_zero hk))
(by simpa only [Fintype.card_fin] using internalDegree_ge_eight) S (by
change 2 * S.card ≤
Fintype.card (PreprocessingCloudIndex.PaddedCloud t (padding t) v)
omega)
noncomputable def roundLabels (t : GraphTables.Table)
(labels : Fin (vertexCount t (padding t)) → GraphTables.Label) :
Fin t.vertices → GraphTables.Label :=
CloudRounding.roundLabels
(paddedGraph (GraphTables.semantics t) (fun v => Fin (padding t v)))
(fun z => labels (vertexOrder t (padding t) z))
theorem soundness (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table)
(labels : Fin (vertexCount t (padding t)) → GraphTables.Label) :
(GraphTables.semantics t).rejectionCount (roundLabels t labels) ≤
(PortTables.baseGraph (regularize H t)).rejectionCount labels := by
rw [regularize, rejectionCount_ofCloudTables]
exact CloudRounding.padded_replacement_soundness (GraphTables.semantics t)
(fun v => Fin (padding t v)) (cloudGraphs t (padding t) (familyCloudTable H t))
(cloud_expansion H certificate t) (fun z => labels (vertexOrder t (padding t) z))
theorem exists_rounding (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table)
(labels : Fin (vertexCount t (padding t)) → GraphTables.Label) :
∃ original : Fin t.vertices → GraphTables.Label,
(GraphTables.semantics t).rejectionCount original ≤
(PortTables.baseGraph (regularize H t)).rejectionCount labels :=
⟨roundLabels t labels, soundness H certificate t labels⟩
theorem lift_rejectionCount (H : BaseTable) (t : GraphTables.Table)
(labels : Fin t.vertices → GraphTables.Label) :
(PortTables.baseGraph (regularize H t)).rejectionCount
(liftedLabel t (padding t) labels) = (GraphTables.semantics t).rejectionCount labels :=
rejectionCount_liftedLabel t (padding t) (familyCloudTable H t) labels
theorem completeness (H : BaseTable) (t : GraphTables.Table)
(h : (GraphTables.semantics t).Satisfiable) :
(PortTables.baseGraph (regularize H t)).Satisfiable := by
obtain ⟨labels, hlabels⟩ := h
refine ⟨liftedLabel t (padding t) labels, ?_⟩
intro e
obtain ⟨z, rfl⟩ :=
(Equiv.prodCongr (vertexOrder t (padding t)) (portOrder internalDegree)).surjective e
rcases z with ⟨v, p⟩
change (PortTables.baseGraph (regularize H t)).edgeSatisfied
(liftedLabel t (padding t) labels)
(vertexOrder t (padding t) v, portOrder internalDegree p) = true
rw [regularize, edgeSatisfied_ofCloudTables]
simp only [liftedLabel, Equiv.symm_apply_apply]
have hcomplete := replacement_complete
(paddedGraph (GraphTables.semantics t) (fun v => Fin (padding t v)))
(cloudGraphs t (padding t) (familyCloudTable H t)) labels
(padded_complete (GraphTables.semantics t) (fun v => Fin (padding t v)) labels hlabels)
(v, p)
convert hcomplete using 1
rfl
theorem soundness_of_uniform_lower_bound (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table) (k : Nat)
(lower : ∀ original : Fin t.vertices → GraphTables.Label,
k ≤ (GraphTables.semantics t).rejectionCount original)
(labels : Fin (vertexCount t (padding t)) → GraphTables.Label) :
k ≤ (PortTables.baseGraph (regularize H t)).rejectionCount labels :=
(lower (roundLabels t labels)).trans (soundness H certificate t labels)
theorem soundness_of_uniform_real_lower_bound (H : BaseTable)
(certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ))
(t : GraphTables.Table) (k : ℝ)
(lower : ∀ original : Fin t.vertices → GraphTables.Label,
k ≤ ((GraphTables.semantics t).rejectionCount original : ℝ))
(labels : Fin (vertexCount t (padding t)) → GraphTables.Label) :
k ≤ ((PortTables.baseGraph (regularize H t)).rejectionCount labels : ℝ) :=
(lower (roundLabels t labels)).trans (Nat.cast_le.mpr (soundness H certificate t labels))
end IndependentSetsGames.Foundations.PCP.PreprocessingRegularSoundness
end OAI

Xet Storage Details

Size:
11.6 kB
·
Xet hash:
a2b738cf9cf1bfd2831a68197fefd5161924aa1d0b54d42b0735197be78763dd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.