Buckets:
| import Mathlib | |
| import OAI.Computability.VertexCover.PCP.PoweringTables | |
| import OAI.Computability.VertexCover.PCP.PoweringCounting | |
| namespace OAI | |
| namespace UniqueGames.Foundations.PCP.PoweringTableSemantics | |
| open PoweringWalks PoweringLabels PoweringAddresses PoweringEnumeration PoweringTables | |
| abbrev RawLabeling (vertices d n : Nat) := | |
| Fin vertices → PaddedLabel (Fin d) (n + 1) (Fin 64) | |
| abbrev EncodedLabeling (vertices d n : Nat) := | |
| Fin vertices → Fin (labelCount d n) | |
| def encodeLabeling {vertices : Nat} (d n : Nat) (labels : RawLabeling vertices d n) : | |
| EncodedLabeling vertices d n := | |
| fun v => encodeLabel d (n + 1) 64 (labels v) | |
| def decodeLabeling {vertices : Nat} (d n : Nat) (labels : EncodedLabeling vertices d n) : | |
| RawLabeling vertices d n := | |
| fun v => decodeLabel d (n + 1) 64 (labels v) | |
| @[simp] theorem decodeLabeling_encodeLabeling {vertices : Nat} (d n : Nat) | |
| (labels : RawLabeling vertices d n) : | |
| decodeLabeling d n (encodeLabeling d n labels) = labels := by | |
| funext v | |
| exact decodeLabel_encodeLabel d (n + 1) 64 (labels v) | |
| @[simp] theorem encodeLabeling_decodeLabeling {vertices : Nat} (d n : Nat) | |
| (labels : EncodedLabeling vertices d n) : | |
| encodeLabeling d n (decodeLabeling d n labels) = labels := by | |
| funext v | |
| exact encodeLabel_decodeLabel d (n + 1) 64 (labels v) | |
| theorem edgeSatisfied_encoded {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (labels : RawLabeling vertices d n) | |
| (e : PoweringTest.Dart (Fin vertices) (Fin d) n) : | |
| (GenericGraphTables.semantics (table input n)).edgeSatisfied | |
| (encodeLabeling d n labels) (encodeDart vertices d n e) = | |
| (mathematicalGraph input n).edgeSatisfied labels e := by | |
| rw [semantics_table] | |
| unfold encodeLabeling encodeLabel encodeDart | |
| exact | |
| GenericGraphTables.enumeratedGraph_edgeSatisfied (mathematicalGraph input n) | |
| (Equiv.refl _) (dartEquiv vertices d n) (paddedLabelEquiv d (n + 1) 64) labels e | |
| theorem edgeSatisfied_decoded {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (labels : EncodedLabeling vertices d n) (i : Fin (dartCount vertices d n)) : | |
| (GenericGraphTables.semantics (table input n)).edgeSatisfied labels i = | |
| (mathematicalGraph input n).edgeSatisfied (decodeLabeling d n labels) | |
| (decodeDart vertices d n i) := by | |
| have h := edgeSatisfied_encoded input n (decodeLabeling d n labels) (decodeDart vertices d n i) | |
| let G : ConstraintGraph (Fin vertices) (Fin (dartCount vertices d n)) | |
| (Fin (labelCount d n)) := GenericGraphTables.semantics (table input n) | |
| change G.edgeSatisfied (encodeLabeling d n (decodeLabeling d n labels)) | |
| (encodeDart vertices d n (decodeDart vertices d n i)) = _ at h | |
| rw [encodeLabeling_decodeLabeling] at h | |
| exact (congrArg (G.edgeSatisfied labels) | |
| (encodeDart_decodeDart vertices d n i)).symm.trans h | |
| theorem edgeSatisfied_eq_path {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (labels : EncodedLabeling vertices d n) (direction : Bool) | |
| (w : Walk (Fin vertices) (Fin d) (n + 1)) : | |
| (GenericGraphTables.semantics (table input n)).edgeSatisfied labels | |
| (encodeDart vertices d n (direction, w)) = | |
| PoweringTest.pathAccepts (PortTables.portGraph input) (PortTables.accepts input) n | |
| (finitePortSelector (PortTables.portGraph input) (n + 1)) w | |
| (decodeLabeling d n labels w.1) | |
| (decodeLabeling d n labels (endpoint (PortTables.portGraph input) w)) := by | |
| rw [edgeSatisfied_decoded input n labels (encodeDart vertices d n (direction, w)), | |
| decodeDart_encodeDart vertices d n (direction, w)] | |
| exact PoweringTest.poweredGraph_edgeSatisfied (PortTables.portGraph input) | |
| (PortTables.accepts input) n (finitePortSelector (PortTables.portGraph input) (n + 1)) | |
| (decodeLabeling d n labels) direction w | |
| theorem rejectionCount_encoded {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (labels : RawLabeling vertices d n) : | |
| (GenericGraphTables.semantics (table input n)).rejectionCount | |
| (encodeLabeling d n labels) = (mathematicalGraph input n).rejectionCount labels := by | |
| rw [semantics_table] | |
| unfold encodeLabeling encodeLabel | |
| exact | |
| GenericGraphTables.enumeratedGraph_rejectionCount (mathematicalGraph input n) | |
| (Equiv.refl _) (dartEquiv vertices d n) (paddedLabelEquiv d (n + 1) 64) labels | |
| theorem rejectionCount_decoded {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (labels : EncodedLabeling vertices d n) : | |
| (GenericGraphTables.semantics (table input n)).rejectionCount labels = | |
| (mathematicalGraph input n).rejectionCount (decodeLabeling d n labels) := by | |
| have h := rejectionCount_encoded input n (decodeLabeling d n labels) | |
| let G : ConstraintGraph (Fin vertices) (Fin (dartCount vertices d n)) | |
| (Fin (labelCount d n)) := GenericGraphTables.semantics (table input n) | |
| change G.rejectionCount (encodeLabeling d n (decodeLabeling d n labels)) = _ at h | |
| rw [encodeLabeling_decodeLabeling] at h | |
| exact h | |
| theorem card_darts_eq_table {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) : | |
| Fintype.card (PoweringTest.Dart (Fin vertices) (Fin d) n) = (table input n).darts := by | |
| change Fintype.card (PoweringTest.Dart (Fin vertices) (Fin d) n) = | |
| 2 * vertices * d ^ (n + 1) | |
| simpa only [Fintype.card_fin] using Fintype.card_congr (dartEquiv vertices d n) | |
| theorem satisfiable_iff {vertices d : Nat} (input : PortTables.Table vertices d) (n : Nat) : | |
| (GenericGraphTables.semantics (table input n)).Satisfiable ↔ | |
| (mathematicalGraph input n).Satisfiable := by | |
| constructor | |
| · rintro ⟨labels, satisfies⟩ | |
| refine ⟨decodeLabeling d n labels, ?_⟩ | |
| intro e | |
| have h := edgeSatisfied_decoded input n labels (encodeDart vertices d n e) | |
| rw [decodeDart_encodeDart] at h | |
| exact h.symm.trans (satisfies (encodeDart vertices d n e)) | |
| · rintro ⟨labels, satisfies⟩ | |
| refine ⟨encodeLabeling d n labels, ?_⟩ | |
| intro i | |
| have h := edgeSatisfied_encoded input n labels (decodeDart vertices d n i) | |
| rw [encodeDart_decodeDart vertices d n i] at h | |
| exact h.trans (satisfies (decodeDart vertices d n i)) | |
| theorem preserves_satisfiability {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (h : (PortTables.baseGraph input).Satisfiable) : | |
| (GenericGraphTables.semantics (table input n)).Satisfiable := by | |
| apply (satisfiable_iff input n).mpr | |
| exact PoweringTest.preserves_satisfiability (PortTables.portGraph input) | |
| (PortTables.accepts input) (PortTables.accepts_rotation input) n | |
| (finitePortSelector (PortTables.portGraph input) (n + 1)) h | |
| theorem path_rejection_mean_eq_table_fraction {vertices d : Nat} | |
| (input : PortTables.Table vertices d) (n : Nat) (labels : EncodedLabeling vertices d n) : | |
| SpectralReturn.mean (fun w : Walk (Fin vertices) (Fin d) (n + 1) => | |
| PoweringMoment.bit | |
| (PoweringTest.pathAccepts (PortTables.portGraph input) (PortTables.accepts input) n | |
| (finitePortSelector (PortTables.portGraph input) (n + 1)) w | |
| (decodeLabeling d n labels w.1) | |
| (decodeLabeling d n labels (endpoint (PortTables.portGraph input) w)) = false)) = | |
| ((GenericGraphTables.semantics (table input n)).rejectionCount labels : ℝ) / | |
| ((table input n).darts : ℝ) := by | |
| rw [rejectionCount_decoded input n labels, ← card_darts_eq_table input n] | |
| exact PoweringCounting.path_rejection_mean_eq_count (PortTables.portGraph input) | |
| (PortTables.accepts input) n (finitePortSelector (PortTables.portGraph input) (n + 1)) | |
| (decodeLabeling d n labels) | |
| theorem uniform_count_gap_iff {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (epsilon : ℝ) : | |
| (∀ labels : EncodedLabeling vertices d n, | |
| epsilon * ((table input n).darts : ℝ) ≤ | |
| ((GenericGraphTables.semantics (table input n)).rejectionCount labels : ℝ)) ↔ | |
| (∀ labels : RawLabeling vertices d n, | |
| epsilon * (Fintype.card (PoweringTest.Dart (Fin vertices) (Fin d) n) : ℝ) ≤ | |
| ((mathematicalGraph input n).rejectionCount labels : ℝ)) := by | |
| constructor | |
| · intro h labels | |
| calc | |
| epsilon * (Fintype.card (PoweringTest.Dart (Fin vertices) (Fin d) n) : ℝ) = | |
| epsilon * ((table input n).darts : ℝ) := by rw [card_darts_eq_table] | |
| _ ≤ ((GenericGraphTables.semantics (table input n)).rejectionCount | |
| (encodeLabeling d n labels) : ℝ) := h (encodeLabeling d n labels) | |
| _ = ((mathematicalGraph input n).rejectionCount labels : ℝ) := | |
| congrArg (fun k : ℕ => (k : ℝ)) (rejectionCount_encoded input n labels) | |
| · intro h labels | |
| rw [rejectionCount_decoded input n labels] | |
| have hlabels := h (decodeLabeling d n labels) | |
| rw [card_darts_eq_table input n] at hlabels | |
| exact hlabels | |
| theorem uniform_count_gap {vertices d : Nat} (input : PortTables.Table vertices d) | |
| (n : Nat) (epsilon : ℝ) | |
| (hgap : ∀ labels : RawLabeling vertices d n, | |
| epsilon * (Fintype.card (PoweringTest.Dart (Fin vertices) (Fin d) n) : ℝ) ≤ | |
| ((mathematicalGraph input n).rejectionCount labels : ℝ)) : | |
| ∀ labels : EncodedLabeling vertices d n, | |
| epsilon * ((table input n).darts : ℝ) ≤ | |
| ((GenericGraphTables.semantics (table input n)).rejectionCount labels : ℝ) := | |
| (uniform_count_gap_iff input n epsilon).mpr hgap | |
| end UniqueGames.Foundations.PCP.PoweringTableSemantics | |
| end OAI | |
Xet Storage Details
- Size:
- 9.53 kB
- Xet hash:
- 63a125ec5d73b6cceaab26c560878b347c410b014d85272f0ba947a5f02b692b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.