[ refactor ] make Relation.Binary.Morphism.Definitions obsolete#2922
[ refactor ] make Relation.Binary.Morphism.Definitions obsolete#2922jamesmckinna wants to merge 2 commits intoagda:masterfrom
Relation.Binary.Morphism.Definitions obsolete#2922Conversation
| open import Relation.Binary.Core using (_Preserves_⟶_) | ||
| open import Relation.Binary.Bundles using (Setoid; Preorder; Poset) | ||
| open import Relation.Binary.Consequences using (mono⇒cong) | ||
| open import Relation.Binary.Definitions using (Monotonic₁) |
There was a problem hiding this comment.
NB, this too could be replaced by
| open import Relation.Binary.Definitions using (Monotonic₁) | |
| open import Function.Definitions using (Congruent) |
But at the cost of straying outside the Relation.* hierarchy...
There was a problem hiding this comment.
Since morphisms tend to be functions, using Function.Definitions where does not seem out of place.
There was a problem hiding this comment.
Although here, as the definition is being used in a context where the monotonicity of the function is being appealed to, I think is makes slightly more sense (cognitive load? 'documentation'?) to prefer Monotonic₁ in this instance?
| open import Data.Product.Base using (_,_) | ||
| open import Function.Definitions using (Injective; Surjective; Bijective) | ||
| open import Function.Definitions | ||
| using (Congruent; Injective; Surjective; Bijective) |
There was a problem hiding this comment.
Alternatively,
| using (Congruent; Injective; Surjective; Bijective) | |
| using (Injective; Surjective; Bijective) | |
| renaming (Congruent to Homomorphic₂) |
JacquesCarette
left a comment
There was a problem hiding this comment.
Putting as comment, since I don't want to block merge on just this.
| open import Relation.Binary.Core using (_Preserves_⟶_) | ||
| open import Relation.Binary.Bundles using (Setoid; Preorder; Poset) | ||
| open import Relation.Binary.Consequences using (mono⇒cong) | ||
| open import Relation.Binary.Definitions using (Monotonic₁) |
There was a problem hiding this comment.
Since morphisms tend to be functions, using Function.Definitions where does not seem out of place.
This tackles the first part of #2875 , retaining the module solely for compatibility per #1206 / #1213 as requested by @pnlph , so no actual
deprecationat this stage.Knock-on consequences include:
Function.Definitionsvs. alternativesHomomorphic₂throughout byFunction.Definitions.Congruent(but the name is still exported aspublicby the obsolete stub; and hence also exported byRelation.Binary.Morphism, but this could be removed/deprecated?)TL;DR: the 'cause' of the problem is yet again [ DRY ] with some basic concepts duplicated across the
Function/Relation/Algebrahierarchies as various specialisations (or not even that) of 'common' (very) general abstractions (eg 'monotonicity'/'congruence'/'respects') which different authors have, at different times, identified asCoreto one or other hierarchy... cf. #2917