File size: 8,188 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | import Mathlib
import OAI.GroupTheory.SimpleOvergroups.EnlargementEffective
import OAI.GroupTheory.SimpleOvergroups.MatrixEffective
import OAI.GroupTheory.SimpleOvergroups.EffectiveActions
namespace OAI
namespace SimpleFInftyOvergroups.EffectiveNames.Double
open BoundedEncoding NamedAction
noncomputable section
open scoped Classical
variable {A kβ kβ kβ Pβ Pβ : Type*}
[CommRing kβ] [CommRing kβ] [CommRing kβ]
[Primcodable A] [Primcodable kβ] [Primcodable kβ] [Primcodable kβ]
[Finite kβ] [Finite kβ] [Finite kβ]
[Primcodable Pβ] [Primcodable Pβ] [Finite Pβ] [Finite Pβ]
{n : β}
abbrev Gβ (k A : Type*) (n : β) := MatrixWords.Word k A n
abbrev Xβ (k A : Type*) (n : β) := MatrixWords.Point k A n
abbrev Gβ (P k A : Type*) (n : β) := Enlargement.Word P (Gβ k A n)
abbrev Xβ (P k A : Type*) (n : β) := Enlargement.Point P (Gβ k A n) (Xβ k A n)
abbrev Gβ (Pβ Pβ k A : Type*) (n : β) := Enlargement.Word Pβ (Gβ Pβ k A n)
abbrev Xβ (Pβ Pβ k A : Type*) (n : β) := Enlargement.Point Pβ (Gβ Pβ k A n) (Xβ Pβ k A n)
abbrev base (grade : List A β β) := MatrixWords.nameOperations (k:=kβ) (n:=n) grade
abbrev first (grade : List A β β) := Enlargement.operations (P:=Pβ) (base (kβ:=kβ) (n:=n) grade)
abbrev operations (grade : List A β β) :=
Enlargement.operations (P:=Pβ) (first (Pβ:=Pβ) (kβ:=kβ) (n:=n) grade)
variable (eβ : Pβ β Enlargement.Coeff.Name kβ) (eβ : Pβ β Enlargement.Coeff.Name kβ)
variable (grade : List A β β) (omega : List A) (f : List A β Part (List A))
def partialGroupKey : Gβ Pβ Pβ kβ A n β Part (β Γ β) :=
Enlargement.partialGroupKey (first grade) eβ
(Enlargement.partialGroupKey (base grade) eβ
(MatrixWords.partialGroupKey (k:=kβ) (n:=n) omega f))
def partialPointKey : Xβ Pβ Pβ kβ A n β Part β :=
Enlargement.partialPointKey (first grade) eβ
(Enlargement.partialPointKey (base grade) eβ
(MatrixWords.partialPointKey (k:=kβ) (n:=n) omega f))
def test (w : List (Letter (Gβ Pβ Pβ kβ A n) (Xβ Pβ Pβ kβ A n))) :
Part (Result (β Γ β) β) :=
(operations grade).test (partialGroupKey eβ eβ grade omega f)
(partialPointKey eβ eβ grade omega f) w
variable {m : β} (C : WordCalculus (FreeMonoid A) m)
attribute [local instance] WordCalculus.rawMatrixAction
abbrev calculus := Enlargement.calculus (k:=kβ)
(Enlargement.calculus (k:=kβ) (MatrixWords.calculus (k:=kβ) (n:=n) C))
variable (heβ : β p, Enlargement.Coeff.value (eβ p) * Enlargement.Coeff.value (eβ p) =
Enlargement.Coeff.value (eβ p))
(heβ : β p, Enlargement.Coeff.value (eβ p) * Enlargement.Coeff.value (eβ p) =
Enlargement.Coeff.value (eβ p))
abbrev interpretβ := Enlargement.interpretation (base (MatrixWords.grade C)) eβ
(MatrixWords.interpretation (k:=kβ) (n:=n) C) heβ
abbrev interpretation := Enlargement.interpretation (first (MatrixWords.grade C)) eβ
(interpretβ (kβ:=kβ) (n:=n) eβ C heβ) heβ
omit [Finite kβ] [Finite kβ] [Primcodable Pβ] [Primcodable Pβ] [Finite Pβ] [Finite Pβ] in
theorem partialGroupKey_full {d : β} (w : Gβ Pβ Pβ kβ A n)
(hw : (operations (MatrixWords.grade C)).gcost w β€ d)
(hf : β u, MatrixWords.grade C u β€ d β
(C.normal (FreeMonoid.ofList u)).toList β f u) :
(interpretation eβ eβ C heβ heβ).gkey w β
partialGroupKey eβ eβ (MatrixWords.grade C) C.omega.toList f w := by
apply Enlargement.partialGroupKey_full _ _ _ _ _ _ hw
intro g hg
apply Enlargement.partialGroupKey_full _ _ _ _ _ _ hg
intro h hh
exact MatrixWords.partialGroupKey_full C f h hh hf
omit [Finite kβ] [Finite kβ] [Primcodable Pβ] [Primcodable Pβ] [Finite Pβ] [Finite Pβ] in
theorem partialPointKey_full {d : β} (x : Xβ Pβ Pβ kβ A n)
(hx : (operations (MatrixWords.grade C)).xcost x β€ d)
(hf : β u, MatrixWords.grade C u β€ d β
(C.normal (FreeMonoid.ofList u)).toList β f u) :
(interpretation eβ eβ C heβ heβ).xkey x β
partialPointKey eβ eβ (MatrixWords.grade C) C.omega.toList f x := by
apply Enlargement.partialPointKey_full _ _ _ _ _ _ hx
intro y hy
apply Enlargement.partialPointKey_full _ _ _ _ _ _ hy
intro z hz
exact MatrixWords.partialPointKey_full C f z hz hf
omit [Finite kβ] [Finite kβ] [Primcodable Pβ] [Primcodable Pβ] [Finite Pβ] [Finite Pβ] in
theorem test_full {d : β} (w : List (Letter (Gβ Pβ Pβ kβ A n) (Xβ Pβ Pβ kβ A n)))
(hw : (operations (MatrixWords.grade C)).wordCost w β€ d)
(hf : β u, MatrixWords.grade C u β€ d β
(C.normal (FreeMonoid.ofList u)).toList β f u) :
(operations (MatrixWords.grade C)).totalTest
(interpretation eβ eβ C heβ heβ).gkey (interpretation eβ eβ C heβ heβ).xkey w β
test eβ eβ (MatrixWords.grade C) C.omega.toList f w := by
exact Operations.test_full _ _ _ _ _
(fun g hg => partialGroupKey_full eβ eβ f C heβ heβ g hg hf)
(fun x hx => partialPointKey_full eβ eβ f C heβ heβ x hx hf) w hw
local instance : Primcodable (Gβ Pβ Pβ kβ A n) := inferInstance
local instance : Primcodable (Xβ Pβ Pβ kβ A n) := inferInstance
theorem primrec_inv_base : Primrec ((base (kβ:=kβ) (n:=n) grade).inv) := MatrixWords.primrec_inverse
omit [Finite kβ] in
theorem primrec_act_base : Primrecβ ((base (kβ:=kβ) (n:=n) grade).act) :=
(Primrec.list_append.comp Primrec.fst (Primrec.fst.comp Primrec.snd)).pair
(Primrec.snd.comp Primrec.snd)
omit [Finite Pβ] in
theorem primrec_inv_first : Primrec ((first (Pβ:=Pβ) (kβ:=kβ) (n:=n) grade).inv) :=
Enlargement.primrec_inverse _ (primrec_inv_base grade)
omit [Finite Pβ] [Finite Pβ] in
theorem primrec_plan : Primrecβ ((operations (Pβ:=Pβ) (Pβ:=Pβ) (kβ:=kβ) (n:=n) grade).plan) :=
Enlargement.primrec_plan _ (primrec_inv_first grade)
variable {Param : Type*} [Primcodable Param] {F : Param β List A β Part (List A)}
theorem partrec_partialGroupKey (hF : Partrecβ F) :
Partrecβ (fun p : Param => partialGroupKey (kβ:=kβ) (n:=n) eβ eβ grade omega (F p)) :=
Enlargement.partrec_partialGroupKey _ eβ Primrec.list_append (primrec_inv_first grade)
(Enlargement.partrec_partialGroupKey _ eβ Primrec.list_append (primrec_inv_base grade)
(MatrixWords.partrec_partialGroupKey omega hF))
theorem partrec_partialPointKey (hF : Partrecβ F) :
Partrecβ (fun p : Param => partialPointKey (kβ:=kβ) (n:=n) eβ eβ grade omega (F p)) :=
Enlargement.partrec_partialPointKey _ eβ Primrec.list_append (Enlargement.primrec_act _)
(Enlargement.partrec_partialPointKey _ eβ Primrec.list_append (primrec_act_base grade)
(MatrixWords.partrec_partialPointKey omega hF))
theorem partrec_test (hF : Partrecβ F) :
Partrecβ (fun p : Param => test (kβ:=kβ) (n:=n) eβ eβ grade omega (F p)) :=
Operations.partrec_test _ (primrec_plan grade).to_comp
(partrec_partialGroupKey eβ eβ grade omega hF) (partrec_partialPointKey eβ eβ grade omega hF)
omit [Finite Pβ] [Finite Pβ] in
theorem primrec_gcost (hg : Primrec grade) :
Primrec ((operations (Pβ:=Pβ) (Pβ:=Pβ) (kβ:=kβ) (n:=n) grade).gcost) :=
Enlargement.primrec_gcost _ (Enlargement.primrec_gcost _ (MatrixWords.primrec_gcost hg))
omit [Finite Pβ] [Finite Pβ] in
theorem primrec_xcost (hg : Primrec grade) :
Primrec ((operations (Pβ:=Pβ) (Pβ:=Pβ) (kβ:=kβ) (n:=n) grade).xcost) :=
Enlargement.primrec_xcost _ (Enlargement.primrec_gcost _ (MatrixWords.primrec_gcost hg))
(Enlargement.primrec_xcost _ (MatrixWords.primrec_gcost hg) (MatrixWords.primrec_xcost hg))
omit [Finite Pβ] [Finite Pβ] in
theorem primrec_cost (hg : Primrec grade) :
Primrec ((operations (Pβ:=Pβ) (Pβ:=Pβ) (kβ:=kβ) (n:=n) grade).letterCost) :=
(operations grade).primrec_letterCost (primrec_gcost grade hg) (primrec_xcost grade hg)
end
end SimpleFInftyOvergroups.EffectiveNames.Double
end OAI
|