Occurrence types and the enlarged hierarchy
Lax956329.OccurrenceLayout · concepts/Lax956329/OccurrenceLayout.lean · lax-956329
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Lemma
Each occurrence type has a fixed route from the starting vertex of its test to its owner. Local equality edges only change the type. The matching goes back along the first route and forward along its partner's route. Both operations preserve the enlarged hierarchy, including when two owners coincide.
Concept map
Lean source view on GitHub
| 1 | import Lax956329.OneRound |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Occurrence types and the enlarged hierarchy |
| 6 | type: lemma |
| 7 | --- |
| 8 | Each occurrence type has a fixed route from the starting vertex of its test |
| 9 | to its owner. Local equality edges only change the type. The matching goes |
| 10 | back along the first route and forward along its partner's route. Both |
| 11 | operations preserve the enlarged hierarchy, including when two owners coincide. |
| 12 | -/ |
| 13 | |
| 14 | namespace Lax956329.OccurrenceLayout |
| 15 | |
| 16 | open Hierarchy OneRound |
| 17 | |
| 18 | structure Pattern (s : ℕ) where |
| 19 | localMove : Fin 4 → Equiv.Perm (Owner s) |
| 20 | mate : Equiv.Perm (Owner s) |
| 21 | paired : Function.Involutive mate |
| 22 | route : Owner s → List Port |
| 23 | |
| 24 | def walk {b : ℕ} (S : System b) : List Port → Equiv.Perm (Owner S.m) |
| 25 | | [] => Equiv.refl _ |
| 26 | | i :: is => (S.move i).trans (walk S is) |
| 27 | |
| 28 | /-- A low coordinate gives the occurrence type, and the high coordinate gives its owner. -/ |
| 29 | def number (s m : ℕ) : Owner s × Owner m ≃ Owner (s*m) := |
| 30 | let c : Fin m × Fin s ≃ Fin (s*m) := finProdFinEquiv.trans (finCongr (Nat.mul_comm m s)) |
| 31 | { toFun := fun (a,u) => (c (u.1,a.1),c (u.2,a.2)) |
| 32 | invFun := fun z => (((c.symm z.1).2,(c.symm z.2).2),((c.symm z.1).1,(c.symm z.2).1)) |
| 33 | left_inv := by rintro ⟨⟨a,b⟩,⟨u,v⟩⟩; simp |
| 34 | right_inv := by rintro ⟨u,v⟩; simp } |
| 35 | |
| 36 | /-- The four local, four global, matching and identity generators are followed by their inverses. -/ |
| 37 | def locals : Fin 4 → Fin 10 := ![0,1,6,7] |
| 38 | |
| 39 | axiom layout {b s : ℕ} (S : System b) (P : Pattern s) (hs : 0 < s) (branch : s*s ≤ b) |
| 40 | (test : Owner s → Owner S.m → Label → Label → Bool) : |
| 41 | ∃ T : System b, ∃ eq : T.m = s*S.m, |
| 42 | T.radices = s :: S.radices ∧ Affine T ∧ |
| 43 | let e := (number s S.m).trans ((finCongr eq.symm).prodCongr (finCongr eq.symm)) |
| 44 | (∀ i a u, T.move (forward (locals i)) (e (a,u)) = e (P.localMove i a,u)) ∧ |
| 45 | (∀ a u, T.move (forward 8) (e (a,u)) = |
| 46 | e (P.mate a,walk S (P.route (P.mate a)) ((walk S (P.route a)).symm u))) ∧ |
| 47 | (∀ i a u c d, T.accept (forward (locals i)) (e (a,u)) c d = decide (c=d)) ∧ |
| 48 | (∀ a u c d, T.accept (forward 8) (e (a,u)) c d = test a u c d) ∧ |
| 49 | (∀ i : Fin 10, (∀ j, locals j ≠ i) → i ≠ 8 → ∀ v c d, T.accept (forward i) v c d = true) |
| 50 | |
| 51 | end Lax956329.OccurrenceLayout |
| 52 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments