-
Notifications
You must be signed in to change notification settings - Fork 259
Description
For Relation.Binary.PropositionalEquality, we have (at least) the following definitional equalities
sym refl = refltrans refl = id(buttrans p reflis only propositionally equal top...)resp P refl = idcong f refl = refl- etc.
whereas for Setoids, we can form the same LHS combinations (or their mutatis mutandis variants, modulo suitable assumptions about respectfulness etc.), but for which we do not even necessarily have the above equalities even as provable equalities between proofs ... never mind any higher-dimensional coherent iterations of such ideas a la HoTT.
But there are various places where it might indeed be useful/more efficient (eg in proofs of divisibility in Algebra) to optimise such combinations, as if those equations did hold, moreover definitionally, and without regard to the definitional biases in trans etc. Example: in Algebra.Properties.Magma.Divisibility we see
xy≈z⇒y∣z : ∀ x y {z} → x ∙ y ≈ z → y ∣ z
xy≈z⇒y∣z x y xy≈z = ∣-respʳ-≈ xy≈z (x∣yx y x)Now, inlining the definitions yields xy≈z⇒y∣z x y xy≈z = x , trans refl xy≈z which we may then, by fiat, rewrite as
xy≈z⇒y∣z x _ xy≈z = x , xy≈zbeing a RHS with the correct type, moreover one which has better reduction behaviour now that we have removed the blocking non-redex trans refl etc.
(Similar examples are available for all the various combinations of left/right respects, left/right transitivity etc.)
Proposal: to go through the library in search of such 'locally optimisable' RHS of definitions in terms of Setoid combinators, and suitably 'optimise' them. Cf. @JacquesCarette 's #2288