Open
Description
The trouble with the definition:
------------------------------------------------------------------------
-- Without Loss of Generality
module _ {p} {P : Pred A p}
(≈-subst : Substitutive _≈_ p)
(∙-comm : Commutative _∙_)
where
subst∧comm⇒sym : Symmetric (λ a b → P (a ∙ b))
subst∧comm⇒sym = ≈-subst P (∙-comm _ _)
wlog : ∀ {r} {_R_ : Rel _ r} → Total _R_ →
(∀ a b → a R b → P (a ∙ b)) →
∀ a b → P (a ∙ b)
wlog r-total = BinaryConsequences.wlog r-total subst∧comm⇒sym
is twofold:
- the assumption
≈-subst : Substitutive _≈_ p
is needlessly restrictive, when≈-resp : P Respects _≈_
would suffice - moreover, as even pointed out in
Relation.Binary.Definitions
, a relation_≈_
only ever satisfiesSubstitutive _≈_ p
when it isPropositionalEquality
(or a derivative of it), so theSetoid
version ofwlog
can only ever be deployed in thePropositional
case!
Arguably this is bug
, so should be fixed as non-backwards-compatible change in v2.3 ;-) but v3.0 is probably more reasonable, or at least, less unreasonable...
Accordingly, propose instead:
------------------------------------------------------------------------
-- Without Loss of Generality
module _ {p} {P : Pred A p}
(≈-resp : P Respects _≈_)
(∙-comm : Commutative _∙_)
where
resp∧comm⇒sym : Symmetric (λ a b → P (a ∙ b))
resp∧comm⇒sym = ≈-resp (∙-comm _ _)
wlog : ∀ {r} {_R_ : Rel _ r} → Total _R_ →
(∀ a b → a R b → P (a ∙ b)) →
∀ a b → P (a ∙ b)
wlog r-total = BinaryConsequences.wlog r-total resp∧comm⇒sym
with marginal knock-on consequences for the Propositional
case (resp P
instead of subst
)