feat(Logic/Relation): some EqvGen API#40606
Conversation
PR summary 71b974ca1fImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
This is not needed anymore in #38086, but might be useful regardless |
EqvGen API
| | trans => apply EqvGen.trans <;> assumption | ||
|
|
||
| @[simp] | ||
| lemma idempotent (r : α → α → Prop) : EqvGen (EqvGen r) = EqvGen r := by |
There was a problem hiding this comment.
Note that if placed at the very end of this module, we can write:
lemma idempotent (r : α → α → Prop) : EqvGen (EqvGen r) = EqvGen r :=
Equivalence.eqvGen_eq (EqvGen.is_equivalence r)I'm not 100% sure about the naming and statement. The analogous Relation.reflTransGen_idem uses a different naming, but this is also deprecated for the more general Relation.reflTransGen_eq_self. I think the situation is slightly different here because of Equivalence not being a typeclass that is inferred. If this were using IsEquiv, it'd be straightforward to just keep the generalization, but maybe here we need both.
| lemma map (f : α → β) (r : β → β → Prop) (x y : α) | ||
| (h : EqvGen (fun x y ↦ r (f x) (f y)) x y) : EqvGen r (f x) (f y) := by | ||
| induction h with | ||
| | rel => apply EqvGen.rel; assumption | ||
| | refl => exact EqvGen.refl _ | ||
| | symm => apply EqvGen.symm; assumption | ||
| | trans => apply EqvGen.trans <;> assumption |
There was a problem hiding this comment.
The convention seems to suggest:
theorem lift {p : β → β → Prop} {a b : α} (f : α → β) (h : ∀ a b, r a b → p (f a) (f b))
(hab : EqvGen r a b) : EqvGen p (f a) (f b) := sorry
theorem lift' {p : β → β → Prop} {a b : α} (f : α → β) (h : ∀ a b, r a b → EqvGen p (f a) (f b))
(hab : EqvGen r a b) : EqvGen p (f a) (f b) := sorry|
@chenson2018 your suggestions seem very reasonable -- you or anyone else should feel free to take over this PR as I don't need it anymore and don't have time to work on it. |
Thanks, I've opened a new PR. |
|
See #40626 |
This PR was automatically created from PR #38086 by @dagurtomas via a review comment by @dagurtomas.