refactor: retire setoids - #533
Conversation
|
Short summary: deprecated OFE.Equiv, maps to/from equality, congruence rules wrt OFE.Equiv, then went fixing the downstream proofs, until none of the code is using those. At this point, OFE.Equiv should be safely deleted (can also do it now, but I would wait a week or two in case any downstream project continues to use it). The proofs are mostly the same, and I'll make a separate pass to use simp/rw in them instead of manual chains of equalities. |
|
Don't worry about breaking downstream projects (a week or two changes nothing since they should be using the versioned releases anyways). I'll do my best to review this promptly! |
markusdemedeiros
left a comment
There was a problem hiding this comment.
The usual nits. Read them, but I'll leave the final say to you on if you want the edits.
I'd suggest removing the deprecated stuff now, or in a follow-up PR. No need to keep that around.
| @[rocq_alias to_dfrac_agree_discrete] | ||
| instance mk_discrete {d : DFrac} {a : A} [DiscreteE a] : DiscreteE (mk d a) := | ||
| ⟨fun h n => ⟨(is_discrete.discrete h.1) n, (Agree.toAgree.is_discrete.discrete h.2) n⟩⟩ | ||
| ⟨fun h => OFE.eq_dist.mpr <| by |
There was a problem hiding this comment.
| ⟨fun h => OFE.eq_dist.mpr <| by | |
| ⟨fun h => OFE.eq_dist.mpr <| fun n => ⟨(is_discrete.discrete h.1).dist, (Agree.toAgree.is_discrete.discrete h.2).dist⟩⟩ |
| simp | ||
| theorem bigOpL_snoc_eq (Φ : Nat → A → M) (l : List A) (a : A) : | ||
| ([^ op list] k ↦ x ∈ l ++ [a], Φ k x) = op ([^ op list] k ↦ x ∈ l, Φ k x) (Φ l.length a) := by | ||
| rw [bigOpL_append_eq]; simp [op_right_id] |
There was a problem hiding this comment.
| rw [bigOpL_append_eq]; simp [op_right_id] | |
| simp [bigOpL_append_eq, op_right_id] |
| theorem bigOpM_eq_strong [OFE A] {Φ Ψ : K → A → M} {m1 m2 : M' A} (hm : ∀ k, get? m1 k = get? m2 k) | ||
| (hf : ∀ {k y1 y2}, get? m1 k = some y1 → get? m2 k = some y2 → y1 = y2 → Φ k y1 = Ψ k y2) : | ||
| ([^ op map] k ↦ x ∈ m1, Φ k x) = ([^ op map] k ↦ x ∈ m2, Ψ k x) := | ||
| bigOpM_gen_proper_2 id ⟨fun _ => rfl, Eq.symm, Eq.trans⟩ (· ▸ · ▸ rfl) (fun k => by rw [hm k]) |
There was a problem hiding this comment.
⟨fun _ => rfl, Eq.symm, Eq.trans⟩Extract to definition (probably already exists)
| refine (intuitionistically_ownM_core a).trans ?_ | ||
| refine intuitionistically_mono ?_ | ||
| exact (ownM_eqv (core_eqv_self a).symm).mpr | ||
| simp only [core_eqv_self, BIBase.Entails.rfl] |
There was a problem hiding this comment.
| simp only [core_eqv_self, BIBase.Entails.rfl] | |
| simp [core_eqv_self, BIBase.Entails.rfl] |
| refine (persistently_ownM_core a).trans ?_ | ||
| exact persistently_mono (ownM_eqv (core_eqv_self a)).mp | ||
| refine persistently_mono ?_ | ||
| simp only [core_eqv_self, BIBase.Entails.rfl] |
There was a problem hiding this comment.
| simp only [core_eqv_self, BIBase.Entails.rfl] | |
| simp [core_eqv_self, BIBase.Entails.rfl] |
| refine NonExpansive₂.eqv (f := fA) Hp.symm ?_ | ||
| (fA : α -c> β -n> α) (fB : α -c> β -c> β) (Hp : fA p q = p) (Hq : fB p q = q) : | ||
| p = (fixpointA fA fB) := by | ||
| have hq : q = fixpointAB fB p := fixpoint_unique Hq.symm |
| ⟨(mono · Ha Hb.symm.to_incN n.le_refl), (mono · Ha.symm Hb.to_incN n.le_refl)⟩ | ||
|
|
||
| @[rocq_alias view_rel_proper] | ||
| @[rocq_alias view_rel_proper, deprecated "OFE is Leibniz; use `congrArg`/`rw`" (since := "2026-07")] |
| simp only [Pcore, Option.some.injEq] | ||
| rcases cx | ||
| simp only [mk.injEq, and_imp] | ||
| intro H1 H2 |
There was a problem hiding this comment.
rintro rfl rfl instead
| have Hle : g y1 ≼ g y2 := ⟨g z, congrArg g Hy2⟩ | ||
| obtain ⟨_, Hcgy2, x, Hcx⟩ := | ||
| CMRA.pcore_mono' Hle (Hg_core.mp Hy1) | ||
| exact ⟨_, rfl, f x, |
| have hf : f1 = f2 := funext fun a => (h1 a).to_eq | ||
| have hg : g1 = g2 := funext fun b => (h2 b).to_eq | ||
| View.map R' f1 g1 v = View.map R' f2 g2 v := by | ||
| have hf : f1 = f2 := funext fun a => OFE.eq_dist.mpr (h1 a) |
There was a problem hiding this comment.
| have hf : f1 = f2 := funext fun a => OFE.eq_dist.mpr (h1 a) | |
| obtain rfl : f1 = f2 := funext fun a => OFE.eq_dist.mpr (h1 a) | |
| obtain rfl : g1 = g2 := funext fun a => OFE.eq_dist.mpr (h2 b) | |
| rfl |
|
Thanks, @markusdemedeiros! I'll remove the deprecated things and do a final minor pass over proofs. |
Description
Pass over deprecating equiv in favor of eq. The remaining task is a small cleanup. I've tried to keep this one minimal by preserving the proofs as much as possible, while eliminating equiv in signatures. I'll make a pass over proofs in a separate PR.