Buckets:
cfahlgren1/math / lean /OAI /Combinatorics /IndependentSets /Expansion /PreprocessingTableSpectral.lean
| import Mathlib | |
| import OAI.Combinatorics.IndependentSets.PCP.Minimum | |
| import OAI.Combinatorics.IndependentSets.Expansion.PreprocessingTables | |
| namespace OAI | |
| namespace IndependentSetsGames.Foundations.PCP.PreprocessingTableSpectral | |
| open PoweringWalks SpectralReturn | |
| private theorem portGraph_ext {V D : Type*} {G H : PortGraph V D} | |
| (h : ∀ x, G.rot x = H.rot x) : G = H := by | |
| have hr : G.rot = H.rot := Equiv.ext h | |
| cases G | |
| cases H | |
| cases hr | |
| rfl | |
| theorem materialize_portGraph {n d : Nat} {D : Type*} | |
| (G : ConstraintGraph (Fin n) (Fin n × D) PortTables.Label) | |
| (ports : D ≃ Fin d) : | |
| PortTables.portGraph (PreprocessingOverlayTables.materialize G ports) = | |
| GraphTransport.reindex (Overlay.originalPortGraph G) (Equiv.refl _) ports := by | |
| apply portGraph_ext | |
| intro x | |
| rw [PortTables.portGraph_rot, PreprocessingOverlayTables.rotation_materialize] | |
| rfl | |
| theorem overlay_portGraph {n d e : Nat} (G : PortTables.Table n d) | |
| (H : ExpanderTables.Table n e) : | |
| PortTables.portGraph (PreprocessingOverlayTables.overlay G H) = | |
| GraphTransport.reindex | |
| (Overlay.portGraph (PortTables.portGraph G) (ExpanderTables.graph H)) | |
| (Equiv.refl _) (PreprocessingOverlayTables.overlayPorts d e) := by | |
| unfold PreprocessingOverlayTables.overlay | |
| rw [materialize_portGraph] | |
| rfl | |
| theorem overlay_rotation_eq {n d e : Nat} (G : PortTables.Table n d) | |
| (H : ExpanderTables.Table n e) (x : Fin n × Fin (d + e)) : | |
| PortTables.rotation (PreprocessingOverlayTables.overlay G H) x = | |
| (GraphTransport.reindex | |
| (Overlay.portGraph (PortTables.portGraph G) (ExpanderTables.graph H)) | |
| (Equiv.refl _) (PreprocessingOverlayTables.overlayPorts d e)).rot x := by | |
| change (PortTables.portGraph (PreprocessingOverlayTables.overlay G H)).rot x = _ | |
| rw [overlay_portGraph] | |
| theorem lazy_portGraph {n d : Nat} (G : PortTables.Table n d) : | |
| PortTables.portGraph (PreprocessingOverlayTables.lazy G) = | |
| GraphTransport.reindex (lazyGraph (PortTables.portGraph G)) | |
| (Equiv.refl _) (PreprocessingOverlayTables.lazyPorts d) := by | |
| unfold PreprocessingOverlayTables.lazy | |
| rw [materialize_portGraph] | |
| rfl | |
| theorem lazy_rotation_eq {n d : Nat} (G : PortTables.Table n d) | |
| (x : Fin n × Fin (2 * d)) : | |
| PortTables.rotation (PreprocessingOverlayTables.lazy G) x = | |
| (GraphTransport.reindex (lazyGraph (PortTables.portGraph G)) | |
| (Equiv.refl _) (PreprocessingOverlayTables.lazyPorts d)).rot x := by | |
| change (PortTables.portGraph (PreprocessingOverlayTables.lazy G)).rot x = _ | |
| rw [lazy_portGraph] | |
| theorem overlay_certificate_seven_eighths {n d e : Nat} | |
| (G : PortTables.Table n d) (H : ExpanderTables.Table n e) | |
| (hn : 0 < n) (hdegree : d = e + 1) (he : 8 ≤ e) | |
| (hH : SpectralCertificate (ExpanderTables.graph H) (1 / 2 : ℝ)) : | |
| SpectralCertificate (PortTables.portGraph (PreprocessingOverlayTables.overlay G H)) | |
| (7 / 8 : ℝ) := by | |
| let : Nonempty (Fin n) := ⟨⟨0, hn⟩⟩ | |
| rw [overlay_portGraph] | |
| apply GraphTransport.reindex_spectralCertificate | |
| apply Overlay.spectralCertificate_seven_eighths | |
| (PortTables.portGraph G) (ExpanderTables.graph H) | |
| · simpa only [Fintype.card_fin] using hdegree | |
| · simp only [Fintype.card_fin] | |
| omega | |
| · exact hH | |
| theorem lazy_certificate_31_32 {n d : Nat} (G : PortTables.Table n d) | |
| (hd : 0 < d) (hG : SpectralCertificate (PortTables.portGraph G) (7 / 8 : ℝ)) : | |
| SpectralCertificate (PortTables.portGraph (PreprocessingOverlayTables.lazy G)) | |
| (31 / 32 : ℝ) := by | |
| let : Nonempty (Fin d) := ⟨⟨0, hd⟩⟩ | |
| rw [lazy_portGraph] | |
| exact GraphTransport.reindex_spectralCertificate _ _ _ _ | |
| (LazySpectral.lazy_certificate_31_32 (PortTables.portGraph G) hG) | |
| end IndependentSetsGames.Foundations.PCP.PreprocessingTableSpectral | |
| noncomputable section | |
| namespace IndependentSetsGames.Foundations.PCP.PreprocessingGuarantees | |
| open PoweringWalks SpectralReturn PreprocessingTables | |
| open PreprocessingRegularTables (internalDegree regularize) | |
| variable {n d e : Nat} | |
| theorem overlay_rejectionCount (G : PortTables.Table n d) (H : ExpanderTables.Table n e) | |
| (labels : Fin n → GraphTables.Label) : | |
| (PortTables.baseGraph (PreprocessingOverlayTables.overlay G H)).rejectionCount labels = | |
| (PortTables.baseGraph G).rejectionCount labels := by | |
| rw [PreprocessingOverlayTables.overlay_semantics] | |
| calc | |
| _ = (Overlay.constraintGraph (PortTables.baseGraph G) (ExpanderTables.graph H)).rejectionCount labels := by | |
| convert ConstraintGraph.reindex_rejectionCount | |
| (Overlay.constraintGraph (PortTables.baseGraph G) (ExpanderTables.graph H)) | |
| (Equiv.refl _) (Equiv.prodCongr (Equiv.refl _) | |
| (PreprocessingOverlayTables.overlayPorts d e)) (Equiv.refl _) labels using 1 | |
| rfl | |
| _ = _ := Overlay.rejectionCount_eq _ _ rfl labels | |
| theorem lazy_rejectionCount (G : PortTables.Table n d) | |
| (labels : Fin n → GraphTables.Label) : | |
| (PortTables.baseGraph (PreprocessingOverlayTables.lazy G)).rejectionCount labels = | |
| (PortTables.baseGraph G).rejectionCount labels := by | |
| rw [PreprocessingOverlayTables.lazy_semantics] | |
| calc | |
| _ = (LazyConstraint.constraintGraph (PortTables.baseGraph G)).rejectionCount labels := by | |
| convert ConstraintGraph.reindex_rejectionCount | |
| (LazyConstraint.constraintGraph (PortTables.baseGraph G)) | |
| (Equiv.refl _) (Equiv.prodCongr (Equiv.refl _) | |
| (PreprocessingOverlayTables.lazyPorts d)) (Equiv.refl _) labels using 1 | |
| rfl | |
| _ = _ := LazyConstraint.rejectionCount_eq _ rfl labels | |
| theorem overlayFamily_certificate (H : BaseTable) | |
| (certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ)) | |
| (t : GraphTables.Table) : | |
| SpectralCertificate (ExpanderTables.graph (overlayFamily H t)) (1 / 2 : ℝ) := by | |
| let : NeZero Expanders.baseDegree := ⟨PreprocessingRegularSoundness.baseDegree_ne_zero⟩ | |
| apply PreprocessingRegularSoundness.resizeTable_certificate | |
| exact ExpanderTables.family_certificate H certificate _ | |
| theorem overlay_certificate (H : BaseTable) | |
| (certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ)) | |
| (t : GraphTables.Table) : | |
| SpectralCertificate (PortTables.portGraph | |
| (PreprocessingOverlayTables.overlay (padded H t) (overlayFamily H t))) (7 / 8 : ℝ) := | |
| PreprocessingTableSpectral.overlay_certificate_seven_eighths _ _ | |
| (vertices_positive t) rfl PreprocessingRegularSoundness.internalDegree_ge_eight | |
| (overlayFamily_certificate H certificate t) | |
| theorem spectral_certificate (H : BaseTable) | |
| (certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ)) | |
| (t : GraphTables.Table) : | |
| SpectralCertificate (PortTables.portGraph (preprocess H t)) (31 / 32 : ℝ) := by | |
| apply PreprocessingTableSpectral.lazy_certificate_31_32 | |
| · omega | |
| · exact overlay_certificate H certificate t | |
| def restrictedLabel (t : GraphTables.Table) | |
| (labels : Fin (vertices t) → GraphTables.Label) : | |
| Fin (regularVertices t) → GraphTables.Label := | |
| fun v => labels (v.castLE (PreprocessingLevels.le_paddedSize (regularVertices t))) | |
| theorem rejectionCount_eq_regularized (H : BaseTable) (t : GraphTables.Table) | |
| (labels : Fin (vertices t) → GraphTables.Label) : | |
| (PortTables.baseGraph (preprocess H t)).rejectionCount labels = | |
| (PortTables.baseGraph (regularize H t)).rejectionCount (restrictedLabel t labels) := by | |
| unfold preprocess PreprocessingTables.degree | |
| rw [lazy_rejectionCount, overlay_rejectionCount] | |
| exact PreprocessingPaddingTables.pad_rejectionCount _ _ labels | |
| def roundLabels (t : GraphTables.Table) | |
| (labels : Fin (vertices t) → GraphTables.Label) : Fin t.vertices → GraphTables.Label := | |
| PreprocessingRegularSoundness.roundLabels t (restrictedLabel t labels) | |
| theorem soundness (H : BaseTable) | |
| (certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ)) | |
| (t : GraphTables.Table) (labels : Fin (vertices t) → GraphTables.Label) : | |
| (GraphTables.semantics t).rejectionCount (roundLabels t labels) ≤ | |
| (PortTables.baseGraph (preprocess H t)).rejectionCount labels := by | |
| rw [rejectionCount_eq_regularized] | |
| exact PreprocessingRegularSoundness.soundness H certificate t (restrictedLabel t labels) | |
| theorem completeness (H : BaseTable) (t : GraphTables.Table) | |
| (h : (GraphTables.semantics t).Satisfiable) : | |
| (PortTables.baseGraph (preprocess H t)).Satisfiable := by | |
| have hp : (PortTables.baseGraph (padded H t)).Satisfiable := | |
| (PreprocessingPaddingTables.pad_satisfiable_iff _ _).mpr | |
| (PreprocessingRegularSoundness.completeness H t h) | |
| obtain ⟨labels, hlabels⟩ := hp | |
| refine ⟨labels, ?_⟩ | |
| apply (ConstraintGraph.rejectionCount_eq_zero_iff _ labels).mp | |
| unfold preprocess PreprocessingTables.degree | |
| rw [lazy_rejectionCount, overlay_rejectionCount] | |
| exact (ConstraintGraph.rejectionCount_eq_zero_iff _ labels).mpr hlabels | |
| theorem gap_transfer_real (H : BaseTable) | |
| (certificate : SpectralCertificate (ExpanderTables.graph H) (1 / 100 : ℝ)) | |
| (t : GraphTables.Table) (ht : 0 < t.darts) | |
| (epsilon : ℝ) (he : 0 ≤ epsilon) | |
| (lower : ∀ labels : Fin t.vertices → GraphTables.Label, | |
| epsilon * t.darts ≤ ((GraphTables.semantics t).rejectionCount labels : ℝ)) | |
| (labels : Fin (vertices t) → GraphTables.Label) : | |
| (epsilon / Preprocessing.sizeFactor) * | |
| Fintype.card (Fin (vertices t) × Fin PreprocessingTables.degree) ≤ | |
| ((PortTables.baseGraph (preprocess H t)).rejectionCount labels : ℝ) := by | |
| have hs : (0 : ℝ) < Preprocessing.sizeFactor := | |
| Nat.cast_pos.mpr Preprocessing.sizeFactor_positive | |
| have hcount : Fintype.card (Fin (vertices t) × Fin PreprocessingTables.degree) ≤ | |
| Preprocessing.sizeFactor * t.darts := by | |
| simp only [Fintype.card_prod, Fintype.card_fin] | |
| calc | |
| _ ≤ (ExpanderFamily.growth ^ 2 * t.darts) * PreprocessingTables.degree := | |
| Nat.mul_le_mul_right _ (vertices_le_of_positive t ht) | |
| _ = _ := by rw [PreprocessingTables.degree_eq]; unfold Preprocessing.sizeFactor; ring | |
| have hcountR : (Fintype.card (Fin (vertices t) × Fin PreprocessingTables.degree) : ℝ) ≤ | |
| (Preprocessing.sizeFactor : ℝ) * t.darts := by exact_mod_cast hcount | |
| calc | |
| _ ≤ (epsilon / Preprocessing.sizeFactor) * | |
| ((Preprocessing.sizeFactor : ℝ) * t.darts) := | |
| mul_le_mul_of_nonneg_left hcountR (div_nonneg he hs.le) | |
| _ = epsilon * t.darts := by field_simp | |
| _ ≤ ((GraphTables.semantics t).rejectionCount (roundLabels t labels) : ℝ) := lower _ | |
| _ ≤ _ := Nat.cast_le.mpr (soundness H certificate t labels) | |
| end IndependentSetsGames.Foundations.PCP.PreprocessingGuarantees | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 10.7 kB
- Xet hash:
- e27c12bd2af9a7d4730bfdcd399009c4e07530327290950e9dd62800a8596c6b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.