-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(Logic/Relation): some EqvGen API
#40606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -802,6 +802,24 @@ theorem mono {r p : α → α → Prop} (hrp : ∀ a b, r a b → p a b) (h : Eq | |
| | symm a b _ ih => exact EqvGen.symm _ _ ih | ||
| | trans a b c _ _ hab hbc => exact EqvGen.trans _ _ _ hab hbc | ||
|
|
||
| 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 | ||
|
|
||
| @[simp] | ||
| lemma idempotent (r : α → α → Prop) : EqvGen (EqvGen r) = EqvGen r := by | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
| ext x y | ||
| refine ⟨fun h ↦ ?_, fun h ↦ EqvGen.rel _ _ h⟩ | ||
| induction h with | ||
| | rel => assumption | ||
| | refl => exact EqvGen.refl _ | ||
| | symm => apply EqvGen.symm; assumption | ||
| | trans => apply EqvGen.trans <;> assumption | ||
|
|
||
| end EqvGen | ||
|
|
||
| /-- The join of a relation on a single type is a new relation for which | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention seems to suggest: