@@ -183,28 +183,68 @@ instance GenMapOF_instOFunctor (F : OFunctorPre) [OFunctor F] :
183183 OFunctor (GenMapOF Nat F) where
184184 cofe {A B _ _} := GenMap_instOFE Nat (F A B)
185185 map f₁ f₂ := GenMap.lift <| OFunctor.map (F := F) f₁ f₂
186- map_ne.ne := sorry -- _ _ _ Hx _ _ Hy _ _ := by apply OFunctor.map_ne.ne Hx Hy
187- map_id := by sorry
188- map_comp := sorry -- by apply OFunctor.map_comp
186+ map_ne.ne {n x1 x2} Hx {y1 y2} Hy k γ := by
187+ simp only [OFE.Dist, Option.Forall₂, Option.map]
188+ cases _ : k.car γ <;> simp
189+ exact OFunctor.map_ne.ne Hx Hy _
190+ map_id {α β _ _} x γ := by
191+ simp only [Option.map]
192+ cases _ : x.car γ <;> simp
193+ exact OFunctor.map_id _
194+ map_comp _ _ _ _ x γ := by
195+ simp only [Option.map]
196+ cases _ : x.car γ <;> simp
197+ exact OFunctor.map_comp _ _ _ _ _
189198
190199instance GenMapOF_instURFunctor (F : COFE.OFunctorPre) [RFunctor F] :
191200 URFunctor (GenMapOF Nat F) where
192201 map f g := {
193202 toHom := GenMap.lift <| COFE.OFunctor.map f g
194- validN hv := by
195- let X := RFunctor.map (F := F) f g
196- dsimp [GenMap.lift]
197- sorry -- (URFunctor.map f g).validN (hv _)
198- pcore := sorry -- simpa [ CMRA.pcore_eq_core ] using (URFunctor.map f g).pcore _
199- op _ := sorry -- (URFunctor.map f g).op _ _
203+ validN {n x} hv := by
204+ rcases hv with ⟨hv, ⟨e, Hf, Hi⟩⟩
205+ refine ⟨fun z => ?_, ⟨e, @fun n => ?_, Hi⟩⟩
206+ · cases h : x.car z <;> simp [Option.map, CMRA.ValidN, optionValidN, h]
207+ rename_i _ α₁ α₂ β₁ β₂ _ _ _ _ v
208+ let Hvalid := @(URFunctor.map (F := OptionOF F) f g).validN n v
209+ simp [CMRA.ValidN, optionValidN, h, URFunctor.map] at Hvalid
210+ specialize Hvalid ?_
211+ · specialize hv z
212+ simp [CMRA.ValidN, optionValidN] at hv
213+ simp [h] at hv
214+ exact hv
215+ exact Hvalid
216+ · specialize @Hf n
217+ simp [IsFree, Option.map] at Hf ⊢
218+ simp [Hf]
219+ pcore x γ := by
220+ let Hcore := @(URFunctor.map (F := OptionOF F) f g).pcore (x.car γ)
221+ simp [Option.map] at Hcore ⊢
222+ cases h : (x.car γ) <;> simp [CMRA.core, Option.getD, optionCore] at Hcore ⊢
223+ rename_i v
224+ simp [OFE.Equiv, Option.Forall₂, URFunctor.map, Option.bind, h, optionCore, OFunctor.map, optionMap, Option.map] at Hcore
225+ cases h' : CMRA.pcore v
226+ · simp_all [h']
227+ cases h'' : CMRA.pcore ((OFunctor.map f g).f v) <;> simp_all
228+ sorry
229+ · simp_all [h']
230+ sorry
231+ op z x γ := by
232+ let Hop := @(URFunctor.map (F := OptionOF F) f g).pcore (z.car γ)
233+ sorry -- (URFunctor.map f g).op _ _
200234 }
201235 map_ne.ne := sorry -- COFE.OFunctor.map_ne.ne
202236 map_id := sorry -- COFE.OFunctor.map_id
203237 map_comp := sorry -- COFE.OFunctor.map_comp
204238
205- instance GenMapOF_instURFC {C} (F : COFE.OFunctorPre) [HURF : RFunctorContractive F] :
206- URFunctorContractive (GenMapOF C F) := sorry
207- -- map_contractive.1 h _ _ := URFunctorContractive.map_contractive.distLater_dist h _
239+ instance GenMapOF_instURFC (F : COFE.OFunctorPre) [HURF : RFunctorContractive F] :
240+ URFunctorContractive (GenMapOF Nat F) where
241+ map_contractive.1 h x n := by
242+ rename_i n x' y'
243+ let Heqv := @(URFunctorContractive.map_contractive (F := OptionOF F)).1 _ x' y' h (x.car n)
244+ simp [Function.uncurry, URFunctor.map, Option.map] at Heqv ⊢
245+ cases h : x.car n <;> simp
246+ rw [h] at Heqv
247+ exact Heqv
208248
209249end OFunctors
210250
0 commit comments