| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Relations between properties of functions, such as associativity and |
| 5 |
-- commutativity, when the underlying relation is a setoid |
| 6 |
------------------------------------------------------------------------ |
| 7 |
|
| 8 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 9 |
|
| 10 |
open import Relation.Binary.Bundles using (Setoid) |
| 11 |
open import Relation.Binary.Definitions |
| 12 |
using (Substitutive; Symmetric; Total) |
| 13 |
|
| 14 |
module Algebra.Consequences.Setoid {a ℓ} (S : Setoid a ℓ) where |
| 15 |
|
| 16 |
import Algebra.Consequences.Base as Base |
| 17 |
open import Algebra.Core |
| 18 |
open import Data.Sum.Base using (inj₁; inj₂) |
| 19 |
open import Data.Product.Base using (_,_) |
| 20 |
open import Function.Base using (_$_; id; _∘_) |
| 21 |
open import Function.Definitions |
| 22 |
import Relation.Binary.Consequences as Bin |
| 23 |
open import Relation.Binary.Core using (Rel) |
| 24 |
open import Relation.Unary using (Pred) |
| 25 |
|
| 26 |
open Setoid S renaming (Carrier to A) |
| 27 |
open import Algebra.Definitions _≈_ |
| 28 |
open import Relation.Binary.Reasoning.Setoid S |
| 29 |
|
| 30 |
------------------------------------------------------------------------ |
| 31 |
-- Re-exports |
| 32 |
|
| 33 |
-- Export base lemmas that don't require the setoid |
| 34 |
|
| 35 |
open Base public |
| 36 |
hiding (module Congruence) |
| 37 |
|
| 38 |
-- Export congruence lemmas using reflexivity |
| 39 |
|
| 40 |
module Congruence {_∙_ : Op₂ A} (cong : Congruent₂ _∙_) where |
| 41 |
|
| 42 |
open Base.Congruence _≈_ cong refl public |
| 43 |
|
| 44 |
------------------------------------------------------------------------ |
| 45 |
-- MiddleFourExchange |
| 46 |
|
| 47 |
module _ {_∙_ : Op₂ A} (cong : Congruent₂ _∙_) where |
| 48 |
|
| 49 |
open Congruence cong |
| 50 |
|
| 51 |
comm∧assoc⇒middleFour : Commutative _∙_ → Associative _∙_ → |
| 52 |
_∙_ MiddleFourExchange _∙_ |
| 53 |
comm∧assoc⇒middleFour comm assoc w x y z = begin |
| 54 |
(w ∙ x) ∙ (y ∙ z) ≈⟨ assoc w x (y ∙ z) ⟩ |
| 55 |
w ∙ (x ∙ (y ∙ z)) ≈⟨ ∙-congˡ (assoc x y z) ⟨ |
| 56 |
w ∙ ((x ∙ y) ∙ z) ≈⟨ ∙-congˡ (∙-congʳ (comm x y)) ⟩ |
| 57 |
w ∙ ((y ∙ x) ∙ z) ≈⟨ ∙-congˡ (assoc y x z) ⟩ |
| 58 |
w ∙ (y ∙ (x ∙ z)) ≈⟨ assoc w y (x ∙ z) ⟨ |
| 59 |
(w ∙ y) ∙ (x ∙ z) ∎ |
| 60 |
|
| 61 |
identity∧middleFour⇒assoc : {e : A} → Identity e _∙_ → |
| 62 |
_∙_ MiddleFourExchange _∙_ → |
| 63 |
Associative _∙_ |
| 64 |
identity∧middleFour⇒assoc {e} (identityˡ , identityʳ) middleFour x y z = begin |
| 65 |
(x ∙ y) ∙ z ≈⟨ ∙-congˡ (identityˡ z) ⟨ |
| 66 |
(x ∙ y) ∙ (e ∙ z) ≈⟨ middleFour x y e z ⟩ |
| 67 |
(x ∙ e) ∙ (y ∙ z) ≈⟨ ∙-congʳ (identityʳ x) ⟩ |
| 68 |
x ∙ (y ∙ z) ∎ |
| 69 |
|
| 70 |
identity∧middleFour⇒comm : {_+_ : Op₂ A} {e : A} → Identity e _+_ → |
| 71 |
_∙_ MiddleFourExchange _+_ → |
| 72 |
Commutative _∙_ |
| 73 |
identity∧middleFour⇒comm {_+_} {e} (identityˡ , identityʳ) middleFour x y |
| 74 |
= begin |
| 75 |
x ∙ y ≈⟨ cong (identityˡ x) (identityʳ y) ⟨ |
| 76 |
(e + x) ∙ (y + e) ≈⟨ middleFour e x y e ⟩ |
| 77 |
(e + y) ∙ (x + e) ≈⟨ cong (identityˡ y) (identityʳ x) ⟩ |
| 78 |
y ∙ x ∎ |
| 79 |
|
| 80 |
------------------------------------------------------------------------ |
| 81 |
-- SelfInverse |
| 82 |
|
| 83 |
module _ {f : Op₁ A} (self : SelfInverse f) where |
| 84 |
|
| 85 |
selfInverse⇒involutive : Involutive f |
| 86 |
selfInverse⇒involutive = reflexive∧selfInverse⇒involutive _≈_ refl self |
| 87 |
|
| 88 |
selfInverse⇒congruent : Congruent _≈_ _≈_ f |
| 89 |
selfInverse⇒congruent {x} {y} x≈y = sym (self (begin |
| 90 |
f (f x) ≈⟨ selfInverse⇒involutive x ⟩ |
| 91 |
x ≈⟨ x≈y ⟩ |
| 92 |
y ∎)) |
| 93 |
|
| 94 |
selfInverse⇒inverseᵇ : Inverseᵇ _≈_ _≈_ f f |
| 95 |
selfInverse⇒inverseᵇ = self ∘ sym , self ∘ sym |
| 96 |
|
| 97 |
selfInverse⇒surjective : Surjective _≈_ _≈_ f |
| 98 |
selfInverse⇒surjective y = f y , self ∘ sym |
| 99 |
|
| 100 |
selfInverse⇒injective : Injective _≈_ _≈_ f |
| 101 |
selfInverse⇒injective {x} {y} x≈y = begin |
| 102 |
x ≈⟨ self x≈y ⟨ |
| 103 |
f (f y) ≈⟨ selfInverse⇒involutive y ⟩ |
| 104 |
y ∎ |
| 105 |
|
| 106 |
selfInverse⇒bijective : Bijective _≈_ _≈_ f |
| 107 |
selfInverse⇒bijective = selfInverse⇒injective , selfInverse⇒surjective |
| 108 |
|
| 109 |
------------------------------------------------------------------------ |
| 110 |
-- Magma-like structures |
| 111 |
|
| 112 |
module _ {_∙_ : Op₂ A} (comm : Commutative _∙_) where |
| 113 |
|
| 114 |
comm∧cancelˡ⇒cancelʳ : LeftCancellative _∙_ → RightCancellative _∙_ |
| 115 |
comm∧cancelˡ⇒cancelʳ cancelˡ x y z eq = cancelˡ x y z $ begin |
| 116 |
x ∙ y ≈⟨ comm x y ⟩ |
| 117 |
y ∙ x ≈⟨ eq ⟩ |
| 118 |
z ∙ x ≈⟨ comm z x ⟩ |
| 119 |
x ∙ z ∎ |
| 120 |
|
| 121 |
comm∧cancelʳ⇒cancelˡ : RightCancellative _∙_ → LeftCancellative _∙_ |
| 122 |
comm∧cancelʳ⇒cancelˡ cancelʳ x y z eq = cancelʳ x y z $ begin |
| 123 |
y ∙ x ≈⟨ comm y x ⟩ |
| 124 |
x ∙ y ≈⟨ eq ⟩ |
| 125 |
x ∙ z ≈⟨ comm x z ⟩ |
| 126 |
z ∙ x ∎ |
| 127 |
|
| 128 |
------------------------------------------------------------------------ |
| 129 |
-- Monoid-like structures |
| 130 |
|
| 131 |
module _ {_∙_ : Op₂ A} (comm : Commutative _∙_) {e : A} where |
| 132 |
|
| 133 |
comm∧idˡ⇒idʳ : LeftIdentity e _∙_ → RightIdentity e _∙_ |
| 134 |
comm∧idˡ⇒idʳ idˡ x = begin |
| 135 |
x ∙ e ≈⟨ comm x e ⟩ |
| 136 |
e ∙ x ≈⟨ idˡ x ⟩ |
| 137 |
x ∎ |
| 138 |
|
| 139 |
comm∧idʳ⇒idˡ : RightIdentity e _∙_ → LeftIdentity e _∙_ |
| 140 |
comm∧idʳ⇒idˡ idʳ x = begin |
| 141 |
e ∙ x ≈⟨ comm e x ⟩ |
| 142 |
x ∙ e ≈⟨ idʳ x ⟩ |
| 143 |
x ∎ |
| 144 |
|
| 145 |
comm∧idˡ⇒id : LeftIdentity e _∙_ → Identity e _∙_ |
| 146 |
comm∧idˡ⇒id idˡ = idˡ , comm∧idˡ⇒idʳ idˡ |
| 147 |
|
| 148 |
comm∧idʳ⇒id : RightIdentity e _∙_ → Identity e _∙_ |
| 149 |
comm∧idʳ⇒id idʳ = comm∧idʳ⇒idˡ idʳ , idʳ |
| 150 |
|
| 151 |
comm∧zeˡ⇒zeʳ : LeftZero e _∙_ → RightZero e _∙_ |
| 152 |
comm∧zeˡ⇒zeʳ zeˡ x = begin |
| 153 |
x ∙ e ≈⟨ comm x e ⟩ |
| 154 |
e ∙ x ≈⟨ zeˡ x ⟩ |
| 155 |
e ∎ |
| 156 |
|
| 157 |
comm∧zeʳ⇒zeˡ : RightZero e _∙_ → LeftZero e _∙_ |
| 158 |
comm∧zeʳ⇒zeˡ zeʳ x = begin |
| 159 |
e ∙ x ≈⟨ comm e x ⟩ |
| 160 |
x ∙ e ≈⟨ zeʳ x ⟩ |
| 161 |
e ∎ |
| 162 |
|
| 163 |
comm∧zeˡ⇒ze : LeftZero e _∙_ → Zero e _∙_ |
| 164 |
comm∧zeˡ⇒ze zeˡ = zeˡ , comm∧zeˡ⇒zeʳ zeˡ |
| 165 |
|
| 166 |
comm∧zeʳ⇒ze : RightZero e _∙_ → Zero e _∙_ |
| 167 |
comm∧zeʳ⇒ze zeʳ = comm∧zeʳ⇒zeˡ zeʳ , zeʳ |
| 168 |
|
| 169 |
comm∧almostCancelˡ⇒almostCancelʳ : AlmostLeftCancellative e _∙_ → |
| 170 |
AlmostRightCancellative e _∙_ |
| 171 |
comm∧almostCancelˡ⇒almostCancelʳ cancelˡ-nonZero x y z x≉e yx≈zx = |
| 172 |
cancelˡ-nonZero x y z x≉e $ begin |
| 173 |
x ∙ y ≈⟨ comm x y ⟩ |
| 174 |
y ∙ x ≈⟨ yx≈zx ⟩ |
| 175 |
z ∙ x ≈⟨ comm z x ⟩ |
| 176 |
x ∙ z ∎ |
| 177 |
|
| 178 |
comm∧almostCancelʳ⇒almostCancelˡ : AlmostRightCancellative e _∙_ → |
| 179 |
AlmostLeftCancellative e _∙_ |
| 180 |
comm∧almostCancelʳ⇒almostCancelˡ cancelʳ-nonZero x y z x≉e xy≈xz = |
| 181 |
cancelʳ-nonZero x y z x≉e $ begin |
| 182 |
y ∙ x ≈⟨ comm y x ⟩ |
| 183 |
x ∙ y ≈⟨ xy≈xz ⟩ |
| 184 |
x ∙ z ≈⟨ comm x z ⟩ |
| 185 |
z ∙ x ∎ |
| 186 |
|
| 187 |
------------------------------------------------------------------------ |
| 188 |
-- Group-like structures |
| 189 |
|
| 190 |
module _ {_∙_ : Op₂ A} {_⁻¹ : Op₁ A} {e} (comm : Commutative _∙_) where |
| 191 |
|
| 192 |
comm∧invˡ⇒invʳ : LeftInverse e _⁻¹ _∙_ → RightInverse e _⁻¹ _∙_ |
| 193 |
comm∧invˡ⇒invʳ invˡ x = begin |
| 194 |
x ∙ (x ⁻¹) ≈⟨ comm x (x ⁻¹) ⟩ |
| 195 |
(x ⁻¹) ∙ x ≈⟨ invˡ x ⟩ |
| 196 |
e ∎ |
| 197 |
|
| 198 |
comm∧invˡ⇒inv : LeftInverse e _⁻¹ _∙_ → Inverse e _⁻¹ _∙_ |
| 199 |
comm∧invˡ⇒inv invˡ = invˡ , comm∧invˡ⇒invʳ invˡ |
| 200 |
|
| 201 |
comm∧invʳ⇒invˡ : RightInverse e _⁻¹ _∙_ → LeftInverse e _⁻¹ _∙_ |
| 202 |
comm∧invʳ⇒invˡ invʳ x = begin |
| 203 |
(x ⁻¹) ∙ x ≈⟨ comm (x ⁻¹) x ⟩ |
| 204 |
x ∙ (x ⁻¹) ≈⟨ invʳ x ⟩ |
| 205 |
e ∎ |
| 206 |
|
| 207 |
comm∧invʳ⇒inv : RightInverse e _⁻¹ _∙_ → Inverse e _⁻¹ _∙_ |
| 208 |
comm∧invʳ⇒inv invʳ = comm∧invʳ⇒invˡ invʳ , invʳ |
| 209 |
|
| 210 |
module _ {_∙_ : Op₂ A} {_⁻¹ : Op₁ A} {e} (cong : Congruent₂ _∙_) where |
| 211 |
|
| 212 |
open Congruence cong |
| 213 |
|
| 214 |
assoc∧id∧invʳ⇒invˡ-unique : Associative _∙_ → |
| 215 |
Identity e _∙_ → RightInverse e _⁻¹ _∙_ → |
| 216 |
∀ x y → (x ∙ y) ≈ e → x ≈ (y ⁻¹) |
| 217 |
assoc∧id∧invʳ⇒invˡ-unique assoc (idˡ , idʳ) invʳ x y eq = begin |
| 218 |
x ≈⟨ idʳ x ⟨ |
| 219 |
x ∙ e ≈⟨ ∙-congˡ (invʳ y) ⟨ |
| 220 |
x ∙ (y ∙ (y ⁻¹)) ≈⟨ assoc x y (y ⁻¹) ⟨ |
| 221 |
(x ∙ y) ∙ (y ⁻¹) ≈⟨ ∙-congʳ eq ⟩ |
| 222 |
e ∙ (y ⁻¹) ≈⟨ idˡ (y ⁻¹) ⟩ |
| 223 |
y ⁻¹ ∎ |
| 224 |
|
| 225 |
assoc∧id∧invˡ⇒invʳ-unique : Associative _∙_ → |
| 226 |
Identity e _∙_ → LeftInverse e _⁻¹ _∙_ → |
| 227 |
∀ x y → (x ∙ y) ≈ e → y ≈ (x ⁻¹) |
| 228 |
assoc∧id∧invˡ⇒invʳ-unique assoc (idˡ , idʳ) invˡ x y eq = begin |
| 229 |
y ≈⟨ idˡ y ⟨ |
| 230 |
e ∙ y ≈⟨ ∙-congʳ (invˡ x) ⟨ |
| 231 |
((x ⁻¹) ∙ x) ∙ y ≈⟨ assoc (x ⁻¹) x y ⟩ |
| 232 |
(x ⁻¹) ∙ (x ∙ y) ≈⟨ ∙-congˡ eq ⟩ |
| 233 |
(x ⁻¹) ∙ e ≈⟨ idʳ (x ⁻¹) ⟩ |
| 234 |
x ⁻¹ ∎ |
| 235 |
|
| 236 |
------------------------------------------------------------------------ |
| 237 |
-- Bisemigroup-like structures |
| 238 |
|
| 239 |
module _ {_∙_ _◦_ : Op₂ A} |
| 240 |
(◦-cong : Congruent₂ _◦_) |
| 241 |
(∙-comm : Commutative _∙_) |
| 242 |
where |
| 243 |
|
| 244 |
open Congruence ◦-cong renaming (∙-congˡ to ◦-congˡ) |
| 245 |
|
| 246 |
comm∧distrˡ⇒distrʳ : _∙_ DistributesOverˡ _◦_ → _∙_ DistributesOverʳ _◦_ |
| 247 |
comm∧distrˡ⇒distrʳ distrˡ x y z = begin |
| 248 |
(y ◦ z) ∙ x ≈⟨ ∙-comm (y ◦ z) x ⟩ |
| 249 |
x ∙ (y ◦ z) ≈⟨ distrˡ x y z ⟩ |
| 250 |
(x ∙ y) ◦ (x ∙ z) ≈⟨ ◦-cong (∙-comm x y) (∙-comm x z) ⟩ |
| 251 |
(y ∙ x) ◦ (z ∙ x) ∎ |
| 252 |
|
| 253 |
comm∧distrʳ⇒distrˡ : _∙_ DistributesOverʳ _◦_ → _∙_ DistributesOverˡ _◦_ |
| 254 |
comm∧distrʳ⇒distrˡ distrˡ x y z = begin |
| 255 |
x ∙ (y ◦ z) ≈⟨ ∙-comm x (y ◦ z) ⟩ |
| 256 |
(y ◦ z) ∙ x ≈⟨ distrˡ x y z ⟩ |
| 257 |
(y ∙ x) ◦ (z ∙ x) ≈⟨ ◦-cong (∙-comm y x) (∙-comm z x) ⟩ |
| 258 |
(x ∙ y) ◦ (x ∙ z) ∎ |
| 259 |
|
| 260 |
comm∧distrˡ⇒distr : _∙_ DistributesOverˡ _◦_ → _∙_ DistributesOver _◦_ |
| 261 |
comm∧distrˡ⇒distr distrˡ = distrˡ , comm∧distrˡ⇒distrʳ distrˡ |
| 262 |
|
| 263 |
comm∧distrʳ⇒distr : _∙_ DistributesOverʳ _◦_ → _∙_ DistributesOver _◦_ |
| 264 |
comm∧distrʳ⇒distr distrʳ = comm∧distrʳ⇒distrˡ distrʳ , distrʳ |
| 265 |
|
| 266 |
comm⇒sym[distribˡ] : ∀ x → Symmetric (λ y z → (x ◦ (y ∙ z)) ≈ ((x ◦ y) ∙ (x ◦ z))) |
| 267 |
comm⇒sym[distribˡ] x {y} {z} prf = begin |
| 268 |
x ◦ (z ∙ y) ≈⟨ ◦-congˡ (∙-comm z y) ⟩ |
| 269 |
x ◦ (y ∙ z) ≈⟨ prf ⟩ |
| 270 |
(x ◦ y) ∙ (x ◦ z) ≈⟨ ∙-comm (x ◦ y) (x ◦ z) ⟩ |
| 271 |
(x ◦ z) ∙ (x ◦ y) ∎ |
| 272 |
|
| 273 |
|
| 274 |
module _ {_∙_ _◦_ : Op₂ A} |
| 275 |
(∙-cong : Congruent₂ _∙_) |
| 276 |
(∙-assoc : Associative _∙_) |
| 277 |
(◦-comm : Commutative _◦_) |
| 278 |
where |
| 279 |
|
| 280 |
open Congruence ∙-cong |
| 281 |
|
| 282 |
distrib∧absorbs⇒distribˡ : _∙_ Absorbs _◦_ → |
| 283 |
_◦_ Absorbs _∙_ → |
| 284 |
_◦_ DistributesOver _∙_ → |
| 285 |
_∙_ DistributesOverˡ _◦_ |
| 286 |
distrib∧absorbs⇒distribˡ ∙-absorbs-◦ ◦-absorbs-∙ (◦-distribˡ-∙ , ◦-distribʳ-∙) x y z = begin |
| 287 |
x ∙ (y ◦ z) ≈⟨ ∙-congʳ (∙-absorbs-◦ _ _) ⟨ |
| 288 |
(x ∙ (x ◦ y)) ∙ (y ◦ z) ≈⟨ ∙-congʳ (∙-congˡ (◦-comm _ _)) ⟩ |
| 289 |
(x ∙ (y ◦ x)) ∙ (y ◦ z) ≈⟨ ∙-assoc _ _ _ ⟩ |
| 290 |
x ∙ ((y ◦ x) ∙ (y ◦ z)) ≈⟨ ∙-congˡ (◦-distribˡ-∙ _ _ _) ⟨ |
| 291 |
x ∙ (y ◦ (x ∙ z)) ≈⟨ ∙-congʳ (◦-absorbs-∙ _ _) ⟨ |
| 292 |
(x ◦ (x ∙ z)) ∙ (y ◦ (x ∙ z)) ≈⟨ ◦-distribʳ-∙ _ _ _ ⟨ |
| 293 |
(x ∙ y) ◦ (x ∙ z) ∎ |
| 294 |
|
| 295 |
------------------------------------------------------------------------ |
| 296 |
-- Ring-like structures |
| 297 |
|
| 298 |
module _ {_+_ _*_ : Op₂ A} |
| 299 |
{_⁻¹ : Op₁ A} {0# : A} |
| 300 |
(+-cong : Congruent₂ _+_) |
| 301 |
(*-cong : Congruent₂ _*_) |
| 302 |
where |
| 303 |
|
| 304 |
open Congruence +-cong renaming (∙-congˡ to +-congˡ; ∙-congʳ to +-congʳ) |
| 305 |
|
| 306 |
open Congruence *-cong renaming (∙-congˡ to *-congˡ; ∙-congʳ to *-congʳ) |
| 307 |
|
| 308 |
assoc∧distribʳ∧idʳ∧invʳ⇒zeˡ : Associative _+_ → _*_ DistributesOverʳ _+_ → |
| 309 |
RightIdentity 0# _+_ → RightInverse 0# _⁻¹ _+_ → |
| 310 |
LeftZero 0# _*_ |
| 311 |
assoc∧distribʳ∧idʳ∧invʳ⇒zeˡ +-assoc distribʳ idʳ invʳ x = begin |
| 312 |
0# * x ≈⟨ idʳ _ ⟨ |
| 313 |
(0# * x) + 0# ≈⟨ +-congˡ (invʳ _) ⟨ |
| 314 |
(0# * x) + ((0# * x) + ((0# * x)⁻¹)) ≈⟨ +-assoc _ _ _ ⟨ |
| 315 |
((0# * x) + (0# * x)) + ((0# * x)⁻¹) ≈⟨ +-congʳ (distribʳ _ _ _) ⟨ |
| 316 |
((0# + 0#) * x) + ((0# * x)⁻¹) ≈⟨ +-congʳ (*-congʳ (idʳ _)) ⟩ |
| 317 |
(0# * x) + ((0# * x)⁻¹) ≈⟨ invʳ _ ⟩ |
| 318 |
0# ∎ |
| 319 |
|
| 320 |
assoc∧distribˡ∧idʳ∧invʳ⇒zeʳ : Associative _+_ → _*_ DistributesOverˡ _+_ → |
| 321 |
RightIdentity 0# _+_ → RightInverse 0# _⁻¹ _+_ → |
| 322 |
RightZero 0# _*_ |
| 323 |
assoc∧distribˡ∧idʳ∧invʳ⇒zeʳ +-assoc distribˡ idʳ invʳ x = begin |
| 324 |
x * 0# ≈⟨ idʳ _ ⟨ |
| 325 |
(x * 0#) + 0# ≈⟨ +-congˡ (invʳ _) ⟨ |
| 326 |
(x * 0#) + ((x * 0#) + ((x * 0#)⁻¹)) ≈⟨ +-assoc _ _ _ ⟨ |
| 327 |
((x * 0#) + (x * 0#)) + ((x * 0#)⁻¹) ≈⟨ +-congʳ (distribˡ _ _ _) ⟨ |
| 328 |
(x * (0# + 0#)) + ((x * 0#)⁻¹) ≈⟨ +-congʳ (*-congˡ (idʳ _)) ⟩ |
| 329 |
((x * 0#) + ((x * 0#)⁻¹)) ≈⟨ invʳ _ ⟩ |
| 330 |
0# ∎ |
| 331 |
|
| 332 |
------------------------------------------------------------------------ |
| 333 |
-- Without Loss of Generality |
| 334 |
|
| 335 |
module _ {p} {f : Op₂ A} {P : Pred A p} |
| 336 |
(≈-subst : Substitutive _≈_ p) |
| 337 |
(comm : Commutative f) |
| 338 |
where |
| 339 |
|
| 340 |
subst∧comm⇒sym : Symmetric (λ a b → P (f a b)) |
| 341 |
subst∧comm⇒sym = ≈-subst P (comm _ _) |
| 342 |
|
| 343 |
wlog : ∀ {r} {_R_ : Rel _ r} → Total _R_ → |
| 344 |
(∀ a b → a R b → P (f a b)) → |
| 345 |
∀ a b → P (f a b) |
| 346 |
wlog r-total = Bin.wlog r-total subst∧comm⇒sym |
| 347 |
|
| 348 |
|
| 349 |
------------------------------------------------------------------------ |
| 350 |
-- DEPRECATED NAMES |
| 351 |
------------------------------------------------------------------------ |
| 352 |
-- Please use the new names as continuing support for the old names is |
| 353 |
-- not guaranteed. |
| 354 |
|
| 355 |
-- Version 2.0 |
| 356 |
|
| 357 |
comm+assoc⇒middleFour = comm∧assoc⇒middleFour |
| 358 |
{-# WARNING_ON_USAGE comm+assoc⇒middleFour |
| 359 |
"Warning: comm+assoc⇒middleFour was deprecated in v2.0. |
| 360 |
Please use comm∧assoc⇒middleFour instead." |
| 361 |
#-} |
| 362 |
identity+middleFour⇒assoc = identity∧middleFour⇒assoc |
| 363 |
{-# WARNING_ON_USAGE identity+middleFour⇒assoc |
| 364 |
"Warning: identity+middleFour⇒assoc was deprecated in v2.0. |
| 365 |
Please use identity∧middleFour⇒assoc instead." |
| 366 |
#-} |
| 367 |
identity+middleFour⇒comm = identity∧middleFour⇒comm |
| 368 |
{-# WARNING_ON_USAGE identity+middleFour⇒comm |
| 369 |
"Warning: identity+middleFour⇒comm was deprecated in v2.0. |
| 370 |
Please use identity∧middleFour⇒comm instead." |
| 371 |
#-} |
| 372 |
comm+cancelˡ⇒cancelʳ = comm∧cancelˡ⇒cancelʳ |
| 373 |
{-# WARNING_ON_USAGE comm+cancelˡ⇒cancelʳ |
| 374 |
"Warning: comm+cancelˡ⇒cancelʳ was deprecated in v2.0. |
| 375 |
Please use comm∧cancelˡ⇒cancelʳ instead." |
| 376 |
#-} |
| 377 |
comm+cancelʳ⇒cancelˡ = comm∧cancelʳ⇒cancelˡ |
| 378 |
{-# WARNING_ON_USAGE comm+cancelʳ⇒cancelˡ |
| 379 |
"Warning: comm+cancelʳ⇒cancelˡ was deprecated in v2.0. |
| 380 |
Please use comm∧cancelʳ⇒cancelˡ instead." |
| 381 |
#-} |
| 382 |
comm+idˡ⇒idʳ = comm∧idˡ⇒idʳ |
| 383 |
{-# WARNING_ON_USAGE comm+idˡ⇒idʳ |
| 384 |
"Warning: comm+idˡ⇒idʳ was deprecated in v2.0. |
| 385 |
Please use comm∧idˡ⇒idʳ instead." |
| 386 |
#-} |
| 387 |
comm+idʳ⇒idˡ = comm∧idʳ⇒idˡ |
| 388 |
{-# WARNING_ON_USAGE comm+idʳ⇒idˡ |
| 389 |
"Warning: comm+idʳ⇒idˡ was deprecated in v2.0. |
| 390 |
Please use comm∧idʳ⇒idˡ instead." |
| 391 |
#-} |
| 392 |
comm+zeˡ⇒zeʳ = comm∧zeˡ⇒zeʳ |
| 393 |
{-# WARNING_ON_USAGE comm+zeˡ⇒zeʳ |
| 394 |
"Warning: comm+zeˡ⇒zeʳ was deprecated in v2.0. |
| 395 |
Please use comm∧zeˡ⇒zeʳ instead." |
| 396 |
#-} |
| 397 |
comm+zeʳ⇒zeˡ = comm∧zeʳ⇒zeˡ |
| 398 |
{-# WARNING_ON_USAGE comm+zeʳ⇒zeˡ |
| 399 |
"Warning: comm+zeʳ⇒zeˡ was deprecated in v2.0. |
| 400 |
Please use comm∧zeʳ⇒zeˡ instead." |
| 401 |
#-} |
| 402 |
comm+almostCancelˡ⇒almostCancelʳ = comm∧almostCancelˡ⇒almostCancelʳ |
| 403 |
{-# WARNING_ON_USAGE comm+almostCancelˡ⇒almostCancelʳ |
| 404 |
"Warning: comm+almostCancelˡ⇒almostCancelʳ was deprecated in v2.0. |
| 405 |
Please use comm∧almostCancelˡ⇒almostCancelʳ instead." |
| 406 |
#-} |
| 407 |
comm+almostCancelʳ⇒almostCancelˡ = comm∧almostCancelʳ⇒almostCancelˡ |
| 408 |
{-# WARNING_ON_USAGE comm+almostCancelʳ⇒almostCancelˡ |
| 409 |
"Warning: comm+almostCancelʳ⇒almostCancelˡ was deprecated in v2.0. |
| 410 |
Please use comm∧almostCancelʳ⇒almostCancelˡ instead." |
| 411 |
#-} |
| 412 |
comm+invˡ⇒invʳ = comm∧invˡ⇒invʳ |
| 413 |
{-# WARNING_ON_USAGE comm+invˡ⇒invʳ |
| 414 |
"Warning: comm+invˡ⇒invʳ was deprecated in v2.0. |
| 415 |
Please use comm∧invˡ⇒invʳ instead." |
| 416 |
#-} |
| 417 |
comm+invʳ⇒invˡ = comm∧invʳ⇒invˡ |
| 418 |
{-# WARNING_ON_USAGE comm+invʳ⇒invˡ |
| 419 |
"Warning: comm+invʳ⇒invˡ was deprecated in v2.0. |
| 420 |
Please use comm∧invʳ⇒invˡ instead." |
| 421 |
#-} |
| 422 |
comm+invˡ⇒inv = comm∧invˡ⇒inv |
| 423 |
{-# WARNING_ON_USAGE comm+invˡ⇒inv |
| 424 |
"Warning: comm+invˡ⇒inv was deprecated in v2.0. |
| 425 |
Please use comm∧invˡ⇒inv instead." |
| 426 |
#-} |
| 427 |
comm+invʳ⇒inv = comm∧invʳ⇒inv |
| 428 |
{-# WARNING_ON_USAGE comm+invʳ⇒inv |
| 429 |
"Warning: comm+invʳ⇒inv was deprecated in v2.0. |
| 430 |
Please use comm∧invʳ⇒inv instead." |
| 431 |
#-} |
| 432 |
comm+distrˡ⇒distrʳ = comm∧distrˡ⇒distrʳ |
| 433 |
{-# WARNING_ON_USAGE comm+distrˡ⇒distrʳ |
| 434 |
"Warning: comm+distrˡ⇒distrʳ was deprecated in v2.0. |
| 435 |
Please use comm∧distrˡ⇒distrʳ instead." |
| 436 |
#-} |
| 437 |
comm+distrʳ⇒distrˡ = comm∧distrʳ⇒distrˡ |
| 438 |
{-# WARNING_ON_USAGE comm+distrʳ⇒distrˡ |
| 439 |
"Warning: comm+distrʳ⇒distrˡ was deprecated in v2.0. |
| 440 |
Please use comm∧distrʳ⇒distrˡ instead." |
| 441 |
#-} |
| 442 |
assoc+distribʳ+idʳ+invʳ⇒zeˡ = assoc∧distribʳ∧idʳ∧invʳ⇒zeˡ |
| 443 |
{-# WARNING_ON_USAGE assoc+distribʳ+idʳ+invʳ⇒zeˡ |
| 444 |
"Warning: assoc+distribʳ+idʳ+invʳ⇒zeˡ was deprecated in v2.0. |
| 445 |
Please use assoc∧distribʳ∧idʳ∧invʳ⇒zeˡ instead." |
| 446 |
#-} |
| 447 |
assoc+distribˡ+idʳ+invʳ⇒zeʳ = assoc∧distribˡ∧idʳ∧invʳ⇒zeʳ |
| 448 |
{-# WARNING_ON_USAGE assoc+distribˡ+idʳ+invʳ⇒zeʳ |
| 449 |
"Warning: assoc+distribˡ+idʳ+invʳ⇒zeʳ was deprecated in v2.0. |
| 450 |
Please use assoc∧distribˡ∧idʳ∧invʳ⇒zeʳ instead." |
| 451 |
#-} |
| 452 |
assoc+id+invʳ⇒invˡ-unique = assoc∧id∧invʳ⇒invˡ-unique |
| 453 |
{-# WARNING_ON_USAGE assoc+id+invʳ⇒invˡ-unique |
| 454 |
"Warning: assoc+id+invʳ⇒invˡ-unique was deprecated in v2.0. |
| 455 |
Please use assoc∧id∧invʳ⇒invˡ-unique instead." |
| 456 |
#-} |
| 457 |
assoc+id+invˡ⇒invʳ-unique = assoc∧id∧invˡ⇒invʳ-unique |
| 458 |
{-# WARNING_ON_USAGE assoc+id+invˡ⇒invʳ-unique |
| 459 |
"Warning: assoc+id+invˡ⇒invʳ-unique was deprecated in v2.0. |
| 460 |
Please use assoc∧id∧invˡ⇒invʳ-unique instead." |
| 461 |
#-} |
| 462 |
subst+comm⇒sym = subst∧comm⇒sym |
| 463 |
{-# WARNING_ON_USAGE subst+comm⇒sym |
| 464 |
"Warning: subst+comm⇒sym was deprecated in v2.0. |
| 465 |
Please use subst∧comm⇒sym instead." |
| 466 |
#-} |