cfahlgren1's picture
download
raw
6.11 kB
import Mathlib
import OAI.Combinatorics.IndependentSets.PCP.GenericGraphTables
import OAI.Combinatorics.IndependentSets.PCP.Queries
namespace OAI
namespace IndependentSetsGames.Foundations.PCP.AlphabetTable.Relations
open Hastad
open Queries
variable {q : Nat}
variable {V E : Type*} [DecidableEq V] [DecidableEq E]
omit [DecidableEq E] in
theorem eqProfile_query_iff (G : ConstraintGraph V E (Fin q)) (e : E)
(event : AlphabetGraph.LocalEvent (Fin q)) (i j : Fin 6) :
eqProfile (decide (G.tail e = G.head e)) (query (G.accepts e) event) i j = true ↔
(AlphabetGraph.verifier G).query (e, event) i =
(AlphabetGraph.verifier G).query (e, event) j := by
rw [← globalize_query G e event i, ← globalize_query G e event j]
exact (globalize_eq_iff (G.tail e) (G.head e) e _ rfl _ _).symm
theorem canonicalSlot_eq (G : ConstraintGraph V E (Fin q)) (e : E)
(event : AlphabetGraph.LocalEvent (Fin q)) (slot : Fin 6) :
canonicalSlot (decide (G.tail e = G.head e)) (query (G.accepts e) event) slot =
QueryIncidence.canonicalSlot (AlphabetGraph.verifier G) (e, event) slot := by
unfold canonicalSlot QueryIncidence.canonicalSlot
apply Fin.find_congr'
exact eqProfile_query_iff G e event _ slot
omit [DecidableEq E] in
theorem repeatedConsistent_iff (G : ConstraintGraph V E (Fin q)) (e : E)
(event : AlphabetGraph.LocalEvent (Fin q)) (label : QueryIncidence.Label 6) :
RepeatedConsistent (decide (G.tail e = G.head e)) (query (G.accepts e) event) label ↔
QueryIncidence.RepeatedConsistent (AlphabetGraph.verifier G) (e, event) label := by
constructor
· intro h i j hij
exact h i j ((eqProfile_query_iff G e event i j).mpr hij)
· intro h i j hij
exact h i j ((eqProfile_query_iff G e event i j).mp hij)
omit [DecidableEq V] [DecidableEq E] in
theorem verifier_accepts (G : ConstraintGraph V E (Fin q)) (e : E)
(event : AlphabetGraph.LocalEvent (Fin q)) (label : QueryIncidence.Label 6) :
(AlphabetGraph.verifier G).accepts (e, event) label =
AssignmentTester.eventAccepts event.1 label := by
rcases event with ⟨kind, k, f, g, r₀, r₁, r₂⟩
rfl
theorem incidenceAccept_eq (G : ConstraintGraph V E (Fin q)) (e : E)
(event : AlphabetGraph.LocalEvent (Fin q)) (slot : Fin 6)
(left right : QueryIncidence.Label 6) :
incidenceAccept (decide (G.tail e = G.head e)) (query (G.accepts e) event)
(AssignmentTester.eventAccepts event.1) slot left right =
QueryIncidence.incidenceAccept (AlphabetGraph.verifier G) (by decide) (e, event) slot
left right := by
simp only [incidenceAccept, QueryIncidence.incidenceAccept, QueryIncidence.LeftValid,
verifier_accepts, repeatedConsistent_iff, canonicalSlot_eq,
QueryIncidence.decodeRight, QueryIncidence.zeroSlot]
rfl
theorem relationAt_relation_graph (G : ConstraintGraph V E (Fin q)) (e : E)
(event : AlphabetGraph.LocalEvent (Fin q)) (slot : Fin 6) (orientation : Bool)
(a b : GraphTables.Label) :
GraphTables.relationAt
(relation (G.accepts e) (decide (G.tail e = G.head e)) event slot orientation) a b =
(AlphabetGraph.graph G).accepts (((e, event), slot), orientation)
(Enumeration.labelEquiv.symm a) (Enumeration.labelEquiv.symm b) := by
rw [relationAt_relation]
cases orientation <;>
exact incidenceAccept_eq G e event slot _ _
end IndependentSetsGames.Foundations.PCP.AlphabetTable.Relations
namespace IndependentSetsGames.Foundations.PCP.AlphabetTable.Table
variable {q : Nat}
def rowFromDart (input : GenericGraphTables.Table q)
(dart : QueryIncidence.Dart (AlphabetGraph.Event (Fin input.darts) (Fin q)) 6) :
GraphTables.DartRow (Enumeration.vertexCount input.vertices input.darts q)
(Enumeration.dartCount input.darts q) :=
let edge := dart.1.1.1
let event := dart.1.1.2
let slot := dart.1.2
let old := input.rows[edge]
let head := input.rows[old.reverseIndex].tail
{ tail := Enumeration.vertexEquiv input.vertices input.darts q
(if dart.2 then
.inr (Queries.globalize old.tail head edge
(Queries.query (GenericGraphTables.relationAt old.relation) event slot))
else .inl (edge, event))
reverseIndex := Enumeration.dartEquiv input.darts q (dart.1, !dart.2)
relation := Relations.relationFromTable old.relation (decide (old.tail = head))
event slot dart.2 }
def rows (input : GenericGraphTables.Table q) :
GraphTables.Rows (Enumeration.vertexCount input.vertices input.darts q)
(Enumeration.dartCount input.darts q) :=
Vector.ofFn (fun index =>
rowFromDart input ((Enumeration.dartEquiv input.darts q).symm index))
@[simp] theorem rows_at (input : GenericGraphTables.Table q)
(index : Fin (Enumeration.dartCount input.darts q)) :
(rows input)[index] =
rowFromDart input ((Enumeration.dartEquiv input.darts q).symm index) := by
simp [rows]
theorem rows_reverseIndex (input : GenericGraphTables.Table q)
(index : Fin (Enumeration.dartCount input.darts q)) :
(rows input)[index].reverseIndex =
Enumeration.dartEquiv input.darts q
(((Enumeration.dartEquiv input.darts q).symm index).1,
!((Enumeration.dartEquiv input.darts q).symm index).2) := by
simp [rows, rowFromDart]
theorem dartRow_ext {n m : Nat} {left right : GraphTables.DartRow n m}
(ht : left.tail = right.tail) (hr : left.reverseIndex = right.reverseIndex)
(hp : left.relation = right.relation) : left = right := by
cases left
cases right
cases ht
cases hr
cases hp
rfl
theorem relation_ext {left right : GraphTables.RelationTable}
(h : ∀ a b, GraphTables.relationAt left a b = GraphTables.relationAt right a b) :
left = right := by
apply Vector.ext
intro i hi
let labels := GraphTables.relationIndex.symm (⟨i, hi⟩ : Fin 4096)
have index : GraphTables.relationIndex labels = (⟨i, hi⟩ : Fin 4096) :=
GraphTables.relationIndex.apply_symm_apply _
have point := h labels.1 labels.2
simpa only [GraphTables.relationAt, index, Fin.getElem_fin] using point
end IndependentSetsGames.Foundations.PCP.AlphabetTable.Table
end OAI

Xet Storage Details

Size:
6.11 kB
·
Xet hash:
f28e23dbabb87a7d50e13b76688f5b58a15f23c506bd98aec368a375ea765783

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