import OAI.Computability.DegreeRigidity.SetModels.EnumerationConstruction import OAI.Computability.DegreeRigidity.Representation.GlobalLocality namespace OAI namespace TuringRigidity.EnumerationTransport open SetCoding RelationCoding BoundedDecoding ArithmeticModelDecoding EnumerationDecoding open IdealInterpretation GlobalLocality noncomputable section def elem (a : Degree) : fullIdeal := ⟨a,Set.mem_univ _⟩ def liftAntichain (p : AntichainCode) : ACode fullIdeal := ⟨elem p.bound,elem p.left,elem p.right⟩ def liftSet (p : SetCode) : SCode fullIdeal := ⟨elem p.bound,liftAntichain p.tags,liftAntichain p.decorated⟩ def liftRelation {n : ℕ} (p : RelationCode n) : RCode fullIdeal n := ⟨fun i => liftSet (p.coordinates i),liftAntichain p.tuples⟩ @[simp] theorem lift_external {n : ℕ} (p : RelationCode n) : (liftRelation p).external = p := by cases p; rfl def mapRelation {n : ℕ} (π : Degree ≃o Degree) (p : RelationCode n) : RelationCode n := ((liftRelation p).map (GlobalLocality.lift π)).external theorem map_below {n : ℕ} (π : Degree ≃o Degree) (p : RelationCode n) (b : Degree) (hp : RelationBelow p b) : RelationBelow (mapRelation π p) (π b) := by exact (liftRelation p).map_below (GlobalLocality.lift π) (elem b) (by simpa only [lift_external,elem] using hp) theorem map_two (π : Degree ≃o Degree) (p : RelationCode 2) (a b : Degree) : (mapRelation π p).Holds (two (π a) (π b)) ↔ p.Holds (two a b) := by have hv (x : Degree) : ((GlobalLocality.lift π) (elem x)).val = π x := rfl have he (x : Degree) : (elem x).val = x := rfl simpa only [lift_external,hv,he,mapRelation] using (liftRelation p).transport_two (GlobalLocality.lift π) (elem a) (elem b) theorem inverse_eq (π : Degree ≃o Degree) (a b : Degree) : π.symm a = b ↔ a = π b := by constructor · intro h have hh := congrArg π h simpa only [π.apply_symm_apply] using hh · intro h rw [h,π.symm_apply_apply] def mapEnumeration (π : Degree ≃o Degree) (c : Enumeration) : Enumeration where node := fun n => π (c.node n) injective := π.injective.comp c.injective output := fun n => π (c.output n) successor := mapRelation π c.successor payload := mapRelation π c.payload successor_spec := by intro a b have hh := map_two π c.successor (π.symm a) (π.symm b) simp only [π.apply_symm_apply] at hh rw [hh,c.successor_spec] exact exists_congr (fun k => and_congr (inverse_eq π a (c.node k)) (inverse_eq π b (c.node (k+1)))) payload_spec := by intro a b have hh := map_two π c.payload (π.symm a) (π.symm b) simp only [π.apply_symm_apply] at hh rw [hh,c.payload_spec] exact exists_congr (fun k => and_congr (inverse_eq π a (c.node k)) (inverse_eq π b (c.output k))) theorem mapEnumeration_below (π : Degree ≃o Degree) (c : Enumeration) (b : Degree) (hS : RelationBelow c.successor b) (hP : RelationBelow c.payload b) : RelationBelow (mapEnumeration π c).successor (π b) ∧ RelationBelow (mapEnumeration π c).payload (π b) := ⟨map_below π _ b hS,map_below π _ b hP⟩ end end TuringRigidity.EnumerationTransport end OAI