A fixed tester for all relations on the powered alphabet
Lax956329.UniversalTester · concepts/Lax956329/UniversalTester.lean · lax-956329
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Lemma
The same 22 query addresses work for every binary relation on a fixed finite alphabet. Each address names a shared endpoint bit, a hardwired relation bit, or a private proof bit. A rejected decoded pair fails on at least of the random strings for every private proof.
Concept map
Lean source view on GitHub
| 1 | import Lax956329.TesterDistance |
| 2 | import Mathlib.Data.ZMod.Basic |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: A fixed tester for all relations on the powered alphabet |
| 7 | type: lemma |
| 8 | --- |
| 9 | The same 22 query addresses work for every binary relation on a fixed finite |
| 10 | alphabet. Each address names a shared endpoint bit, a hardwired relation |
| 11 | bit, or a private proof bit. A rejected decoded pair fails on at least |
| 12 | of the random strings for every private proof. |
| 13 | -/ |
| 14 | |
| 15 | namespace Lax956329.UniversalTester |
| 16 | |
| 17 | abbrev Bit := ZMod 2 |
| 18 | abbrev Rel (a : ℕ) := Fin a → Fin a → Bool |
| 19 | |
| 20 | inductive Site (I V : Type) |
| 21 | | left : I → Site I V |
| 22 | | right : I → Site I V |
| 23 | | relation : I → Site I V |
| 24 | | aux : V → Site I V |
| 25 | |
| 26 | def Site.read {I V : Type} (x y r : I → Bit) (p : V → Bit) : Site I V → Bit |
| 27 | | .left i => x i |
| 28 | | .right i => y i |
| 29 | | .relation i => r i |
| 30 | | .aux v => p v |
| 31 | |
| 32 | structure Gadget (a : ℕ) where |
| 33 | Index : Type |
| 34 | Private : Type |
| 35 | Coin : Type |
| 36 | indices : Fintype Index |
| 37 | privateIndices : Fintype Private |
| 38 | coins : Fintype Coin |
| 39 | positive : Nonempty Coin |
| 40 | query : Coin → Fin 22 → Site Index Private |
| 41 | verdict : Coin → (Fin 22 → Bit) → Bool |
| 42 | code : Fin a → Index → Bit |
| 43 | decode : (Index → Bit) → Fin a |
| 44 | relation : Rel a → Index → Bit |
| 45 | |
| 46 | attribute [instance] Gadget.indices Gadget.privateIndices Gadget.coins Gadget.positive |
| 47 | |
| 48 | def Gadget.check {a : ℕ} (G : Gadget a) (r : Rel a) (x y : G.Index → Bit) |
| 49 | (p : G.Private → Bit) (z : G.Coin) : Bool := |
| 50 | G.verdict z (fun i => (G.query z i).read x y (G.relation r) p) |
| 51 | |
| 52 | axiom universal (a : ℕ) (ha : 0 < a) : ∃ G : Gadget a, |
| 53 | (∀ r u v, r u v = true → ∃ p, ∀ z, G.check r (G.code u) (G.code v) p z = true) ∧ |
| 54 | (∀ r x y, r (G.decode x) (G.decode y) = false → ∀ p, |
| 55 | Fintype.card G.Coin ≤ 32*(Finset.univ.filter (fun z => G.check r x y p z = false)).card) |
| 56 | |
| 57 | end Lax956329.UniversalTester |
| 58 |
Builds on
Used by
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments