feat: more lemmas on Euclidean relations#574
Conversation
ctchou
left a comment
There was a problem hiding this comment.
An overall comment is that this file is getting large and probably should be split.
| @[simp] | ||
| lemma cod_inv : cod (fun a b => r b a) = dom r := rfl | ||
|
|
||
| @[simp] | ||
| lemma dom_inv : dom (fun a b => r b a) = cod r := rfl |
There was a problem hiding this comment.
Perhaps we can defined something like:
def RelInv r a b := r b a
Then the cod versions of many of these theorems can be derived from their dom versions plus properties of RelInv.
There was a problem hiding this comment.
If taking this approach, I would have used the existing flip or Function.swap. They cause some problems that I attribute to there being a mismatch between core and Mathlib API. (Though maybe there's something more technical I've missed.) In a recent poll this form had more support, so I've tried to standardize on this approach, though I agree it is a bit ugly looking.
Agreed. The limit in Mathlib is 1500 lines. I'll think about where best to split this as we approach that size in future PRs. |
A few more lemmas on Euclidean relations. Some other changes to note:
Relation.{cod,dom}, mirroring what is done in Mathlib withSetRelbut for unbundled relations. I am mulling over making a dedicated definition for restrictions of an unbundled relation, but wanted to have a few theorems to test with first.RightEuclidean.refl_rangetoRightEuclidean.refl_codfor naming consistencyRelator.LeftTotalfor the definition ofSerial. None of the modal logic proofs change at all, as these are identical.