@@ -195,11 +195,6 @@ def isPure {α : Type _} : OracleComp spec α → Bool
195195@[simp] lemma pure_ne_query : (pure u : OracleComp spec _) ≠ query t := by simp [query_def]
196196@[simp] lemma query_ne_pure : (query t : OracleComp spec _) ≠ pure u := by simp [query_def]
197197
198- -- @[ simp ] lemma pure_ne_query_bind : pure x ≠ (query t : OracleComp spec _) >>= ou := fun h => by
199- -- simp [query_def, OracleComp.bind_def] at h
200- -- @[ simp ] lemma query_bind_ne_pure : (query t : OracleComp spec _) >>= ou ≠ pure x := fun h => by
201- -- simp [query_def, OracleComp.bind_def] at h
202-
203198lemma pure_eq_query_iff_false : pure u = (query t : OracleComp spec _) ↔ False := by simp
204199lemma query_eq_pure_iff_false : (query t : OracleComp spec _) = pure u ↔ False := by simp
205200
@@ -224,14 +219,6 @@ section inj
224219@[simp] lemma pure_inj (x y : α) : pure (f := OracleComp spec) x = pure y ↔ x = y :=
225220 PFunctor.FreeM.pure_inj x y
226221
227- -- /-- Doing something with a query result is equal iff they query the same oracle
228- -- and perform identical computations on the output. -/
229- -- @[ simp ] lemma queryBind_inj (t t' : spec.Domain) (ob : spec.Range t → OracleComp spec β)
230- -- (ob' : spec.Range t' → OracleComp spec β) :
231- -- (query t : OracleComp spec _) >>= ob = (query t' : OracleComp spec _) >>= ob' ↔
232- -- ∃ h : t = t', h ▸ ob = ob' := by
233- -- convert PFunctor.FreeM.roll_inj t t' ob ob'
234-
235222/-- Binding two computations gives a pure operation iff the first computation is pure
236223and the second computation does something pure with the result. -/
237224@[simp] lemma bind_eq_pure_iff (oa : OracleComp spec α) (ob : α → OracleComp spec β) (y : β) :
@@ -252,34 +239,4 @@ alias ⟨_, pure_eq_bind⟩ := pure_eq_bind_iff
252239
253240end inj
254241
255- -- /-- If the oracle indexing-type `ι`, output type `α`, and domains of all oracles have
256- -- `DecidableEq` then `OracleComp spec α` also has `DecidableEq`. -/
257- -- protected instance instDecidableEq [ spec.Fintype ] [hd : DecidableEq (spec.Domain)]
258- -- [hι : DecidableEq ι] [h : DecidableEq α] : DecidableEq (OracleComp spec α) := fun
259- -- | _ => sorry
260- -- | FreeMonad.pure (Option.some x), FreeMonad.pure (Option.some y) =>
261- -- match h x y with
262- -- | isTrue rfl => isTrue rfl
263- -- | isFalse h => isFalse λ h' ↦ h (by rwa [FreeMonad.pure.injEq, Option.some_inj] at h')
264- -- | FreeMonad.pure Option.none, FreeMonad.pure (Option.some y) => isFalse λ h ↦
265- -- Option.some_ne_none y (by rwa [FreeMonad.pure.injEq, eq_comm] at h)
266- -- | FreeMonad.pure (Option.some x), FreeMonad.pure Option.none => isFalse λ h ↦
267- -- Option.some_ne_none x (by rwa [ FreeMonad.pure.injEq ] at h)
268- -- | FreeMonad.pure Option.none, FreeMonad.pure Option.none => isTrue rfl
269- -- | FreeMonad.pure x, FreeMonad.roll q r => isFalse <| by simp
270- -- | FreeMonad.roll q r, FreeMonad.pure x => isFalse <| by simp
271- -- | FreeMonad.roll (OracleQuery.query i t) r, FreeMonad.roll (OracleQuery.query i' t') s =>
272- -- match hι i i' with
273- -- | isTrue h => by
274- -- induction h
275- -- rw [FreeMonad.roll.injEq, heq_eq_eq, OracleQuery.query.injEq, eq_self, true_and, heq_eq_eq]
276- -- refine @instDecidableAnd _ _ (hd i t t') ?_
277- -- suffices Decidable (∀ u, r u = s u) from decidable_of_iff' _ funext_iff
278- -- suffices ∀ u, Decidable (r u = s u) from Fintype.decidableForallFintype
279- -- exact λ u ↦ OracleComp.instDecidableEq (r u) (s u)
280- -- | isFalse h => isFalse λ h' ↦ h <|
281- -- match FreeMonad.roll.inj h' with
282- -- | ⟨h1, h2, _⟩ => @congr_heq _ _ ι OracleQuery.index OracleQuery.index
283- -- (query i t) (query i' t') (h1 ▸ HEq.rfl) h2
284-
285242end OracleComp
0 commit comments