Skip to content

Commit b003e79

Browse files
authored
[ bug ] Fix use of + in lemma preconditions in favour of (bis) (#2578)
* fix: knock-ons from #2168 * fix: knock-ons from #2168 * fix: knock-ons from #2168 * fix: more names cf. #2168 * fix: knock-ons * add: deprecations
1 parent b74b2eb commit b003e79

File tree

6 files changed

+60
-19
lines changed

6 files changed

+60
-19
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Deprecated names
3232
_∤∤_ ↦ _∦_
3333
```
3434

35+
* In `Algebra.Module.Consequences
36+
```agda
37+
*ₗ-assoc+comm⇒*ᵣ-assoc ↦ *ₗ-assoc∧comm⇒*ᵣ-assoc
38+
*ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc ↦ *ₗ-assoc∧comm⇒*ₗ-*ᵣ-assoc
39+
*ᵣ-assoc+comm⇒*ₗ-assoc ↦ *ᵣ-assoc∧comm⇒*ₗ-assoc
40+
*ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc ↦ *ₗ-assoc∧comm⇒*ₗ-*ᵣ-assoc
41+
```
42+
3543
* In `Algebra.Properties.Magma.Divisibility`:
3644
```agda
3745
∣∣-sym ↦ ∥-sym

src/Algebra/Construct/NaturalChoice/MinMaxOp.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ open import Algebra.Construct.NaturalChoice.MaxOp maxOp public
5959
(x ⊓ y) ⊔ (x ⊓ z) ∎
6060

6161
⊓-distribʳ-⊔ : _⊓_ DistributesOverʳ _⊔_
62-
⊓-distribʳ-⊔ = comm+distrˡ⇒distrʳ ⊔-cong ⊓-comm ⊓-distribˡ-⊔
62+
⊓-distribʳ-⊔ = commdistrˡ⇒distrʳ ⊔-cong ⊓-comm ⊓-distribˡ-⊔
6363

6464
⊓-distrib-⊔ : _⊓_ DistributesOver _⊔_
6565
⊓-distrib-⊔ = ⊓-distribˡ-⊔ , ⊓-distribʳ-⊔
@@ -76,7 +76,7 @@ open import Algebra.Construct.NaturalChoice.MaxOp maxOp public
7676
(x ⊔ y) ⊓ (x ⊔ z) ∎
7777

7878
⊔-distribʳ-⊓ : _⊔_ DistributesOverʳ _⊓_
79-
⊔-distribʳ-⊓ = comm+distrˡ⇒distrʳ ⊓-cong ⊔-comm ⊔-distribˡ-⊓
79+
⊔-distribʳ-⊓ = commdistrˡ⇒distrʳ ⊓-cong ⊔-comm ⊔-distribˡ-⊓
8080

8181
⊔-distrib-⊓ : _⊔_ DistributesOver _⊓_
8282
⊔-distrib-⊓ = ⊔-distribˡ-⊓ , ⊔-distribʳ-⊓

src/Algebra/Module/Consequences.agda

+41-8
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ module _ (_≈ᴬ_ : Rel {a} A ℓa) (S : Setoid c ℓ) where
4040
private
4141
_*ᵣ_ = flip _*ₗ_
4242

43-
*ₗ-assoc+comm⇒*ᵣ-assoc :
43+
*ₗ-assoccomm⇒*ᵣ-assoc :
4444
L.RightCongruent _≈ᴬ_ _*ₗ_
4545
L.Associative _*_ _*ₗ_ Commutative _*_ R.Associative _*_ _*ᵣ_
46-
*ₗ-assoc+comm⇒*ᵣ-assoc *ₗ-congʳ *ₗ-assoc *-comm m x y = begin
46+
*ₗ-assoccomm⇒*ᵣ-assoc *ₗ-congʳ *ₗ-assoc *-comm m x y = begin
4747
(m *ᵣ x) *ᵣ y ≈⟨ refl ⟩
4848
y *ₗ (x *ₗ m) ≈⟨ *ₗ-assoc _ _ _ ⟨
4949
(y * x) *ₗ m ≈⟨ *ₗ-congʳ (*-comm y x) ⟩
5050
(x * y) *ₗ m ≈⟨ refl ⟩
5151
m *ᵣ (x * y) ∎
5252

53-
*ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc :
53+
*ₗ-assoccomm⇒*ₗ-*ᵣ-assoc :
5454
L.RightCongruent _≈ᴬ_ _*ₗ_
5555
L.Associative _*_ _*ₗ_ Commutative _*_ B.Associative _*ₗ_ _*ᵣ_
56-
*ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc *ₗ-congʳ *ₗ-assoc *-comm x m y = begin
56+
*ₗ-assoccomm⇒*ₗ-*ᵣ-assoc *ₗ-congʳ *ₗ-assoc *-comm x m y = begin
5757
((x *ₗ m) *ᵣ y) ≈⟨ refl ⟩
5858
(y *ₗ (x *ₗ m)) ≈⟨ *ₗ-assoc _ _ _ ⟨
5959
((y * x) *ₗ m) ≈⟨ *ₗ-congʳ (*-comm y x) ⟩
@@ -66,23 +66,56 @@ module _ (_≈ᴬ_ : Rel {a} A ℓa) (S : Setoid c ℓ) where
6666
private
6767
_*ₗ_ = flip _*ᵣ_
6868

69-
*ᵣ-assoc+comm⇒*ₗ-assoc :
69+
*ᵣ-assoccomm⇒*ₗ-assoc :
7070
R.LeftCongruent _≈ᴬ_ _*ᵣ_
7171
R.Associative _*_ _*ᵣ_ Commutative _*_ L.Associative _*_ _*ₗ_
72-
*ᵣ-assoc+comm⇒*ₗ-assoc *ᵣ-congˡ *ᵣ-assoc *-comm x y m = begin
72+
*ᵣ-assoccomm⇒*ₗ-assoc *ᵣ-congˡ *ᵣ-assoc *-comm x y m = begin
7373
((x * y) *ₗ m) ≈⟨ refl ⟩
7474
(m *ᵣ (x * y)) ≈⟨ *ᵣ-congˡ (*-comm x y) ⟩
7575
(m *ᵣ (y * x)) ≈⟨ *ᵣ-assoc _ _ _ ⟨
7676
((m *ᵣ y) *ᵣ x) ≈⟨ refl ⟩
7777
(x *ₗ (y *ₗ m)) ∎
7878

79-
*ᵣ-assoc+comm⇒*ₗ-*ᵣ-assoc :
79+
*ᵣ-assoccomm⇒*ₗ-*ᵣ-assoc :
8080
R.LeftCongruent _≈ᴬ_ _*ᵣ_
8181
R.Associative _*_ _*ᵣ_ Commutative _*_ B.Associative _*ₗ_ _*ᵣ_
82-
*ᵣ-assoc+comm⇒*ₗ-*ᵣ-assoc *ᵣ-congˡ *ᵣ-assoc *-comm x m y = begin
82+
*ᵣ-assoccomm⇒*ₗ-*ᵣ-assoc *ᵣ-congˡ *ᵣ-assoc *-comm x m y = begin
8383
((x *ₗ m) *ᵣ y) ≈⟨ refl ⟩
8484
((m *ᵣ x) *ᵣ y) ≈⟨ *ᵣ-assoc _ _ _ ⟩
8585
(m *ᵣ (x * y)) ≈⟨ *ᵣ-congˡ (*-comm x y) ⟩
8686
(m *ᵣ (y * x)) ≈⟨ *ᵣ-assoc _ _ _ ⟨
8787
((m *ᵣ y) *ᵣ x) ≈⟨ refl ⟩
8888
(x *ₗ (m *ᵣ y)) ∎
89+
90+
91+
------------------------------------------------------------------------
92+
-- DEPRECATED NAMES
93+
------------------------------------------------------------------------
94+
-- Please use the new names as continuing support for the old names is
95+
-- not guaranteed.
96+
97+
-- Version 2.3
98+
99+
*ₗ-assoc+comm⇒*ᵣ-assoc = *ₗ-assoc∧comm⇒*ᵣ-assoc
100+
{-# WARNING_ON_USAGE *ₗ-assoc+comm⇒*ᵣ-assoc
101+
"Warning: *ₗ-assoc+comm⇒*ᵣ-assoc was deprecated in v2.3.
102+
Please use *ₗ-assoc∧comm⇒*ᵣ-assoc instead."
103+
#-}
104+
105+
*ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc = *ₗ-assoc∧comm⇒*ₗ-*ᵣ-assoc
106+
{-# WARNING_ON_USAGE *ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc
107+
"Warning: *ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc was deprecated in v2.3.
108+
Please use *ₗ-assoc∧comm⇒*ₗ-*ᵣ-assoc instead."
109+
#-}
110+
111+
*ᵣ-assoc+comm⇒*ₗ-assoc = *ᵣ-assoc∧comm⇒*ₗ-assoc
112+
{-# WARNING_ON_USAGE *ᵣ-assoc+comm⇒*ₗ-assoc
113+
"Warning: *ᵣ-assoc+comm⇒*ₗ-assoc was deprecated in v2.3.
114+
Please use *ᵣ-assoc∧comm⇒*ₗ-assoc instead."
115+
#-}
116+
117+
*ᵣ-assoc+comm⇒*ₗ-*ᵣ-assoc = *ᵣ-assoc∧comm⇒*ₗ-*ᵣ-assoc
118+
{-# WARNING_ON_USAGE *ᵣ-assoc+comm⇒*ₗ-*ᵣ-assoc
119+
"Warning: *ᵣ-assoc+comm⇒*ₗ-*ᵣ-assoc was deprecated in v2.3.
120+
Please use *ᵣ-assoc∧comm⇒*ₗ-*ᵣ-assoc instead."
121+
#-}

src/Algebra/Module/Structures/Biased.agda

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ module _ (commutativeSemiring : CommutativeSemiring r ℓr) where
4848
; *ᵣ-distribˡ = *ₗ-distribʳ
4949
; *ᵣ-identityʳ = *ₗ-identityˡ
5050
; *ᵣ-assoc =
51-
*ₗ-assoc+comm⇒*ᵣ-assoc _≈_ ≈ᴹ-setoid *ₗ-congʳ *ₗ-assoc *-comm
51+
*ₗ-assoccomm⇒*ᵣ-assoc _≈_ ≈ᴹ-setoid *ₗ-congʳ *ₗ-assoc *-comm
5252
; *ᵣ-zeroˡ = *ₗ-zeroʳ
5353
; *ᵣ-distribʳ = *ₗ-distribˡ
5454
}
5555
; *ₗ-*ᵣ-assoc =
56-
*ₗ-assoc+comm⇒*ₗ-*ᵣ-assoc _≈_ ≈ᴹ-setoid *ₗ-congʳ *ₗ-assoc *-comm
56+
*ₗ-assoccomm⇒*ₗ-*ᵣ-assoc _≈_ ≈ᴹ-setoid *ₗ-congʳ *ₗ-assoc *-comm
5757
}
5858

5959
isSemimodule : IsSemimodule commutativeSemiring ≈ᴹ +ᴹ 0ᴹ *ₗ (flip *ₗ)
@@ -81,13 +81,13 @@ module _ (commutativeSemiring : CommutativeSemiring r ℓr) where
8181
; *ₗ-distribʳ = *ᵣ-distribˡ
8282
; *ₗ-identityˡ = *ᵣ-identityʳ
8383
; *ₗ-assoc =
84-
*ᵣ-assoc+comm⇒*ₗ-assoc _≈_ ≈ᴹ-setoid *ᵣ-congˡ *ᵣ-assoc *-comm
84+
*ᵣ-assoccomm⇒*ₗ-assoc _≈_ ≈ᴹ-setoid *ᵣ-congˡ *ᵣ-assoc *-comm
8585
; *ₗ-zeroʳ = *ᵣ-zeroˡ
8686
; *ₗ-distribˡ = *ᵣ-distribʳ
8787
}
8888
; isPrerightSemimodule = isPrerightSemimodule
8989
; *ₗ-*ᵣ-assoc =
90-
*ᵣ-assoc+comm⇒*ₗ-*ᵣ-assoc _≈_ ≈ᴹ-setoid *ᵣ-congˡ *ᵣ-assoc *-comm
90+
*ᵣ-assoccomm⇒*ₗ-*ᵣ-assoc _≈_ ≈ᴹ-setoid *ᵣ-congˡ *ᵣ-assoc *-comm
9191
}
9292

9393
isSemimodule : IsSemimodule commutativeSemiring ≈ᴹ +ᴹ 0ᴹ (flip *ᵣ) *ᵣ

src/Algebra/Properties/CancellativeCommutativeSemiring.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ open import Algebra.Consequences.Setoid setoid
2222
open import Relation.Binary.Reasoning.Setoid setoid
2323

2424
*-almostCancelʳ : AlmostRightCancellative _≈_ 0# _*_
25-
*-almostCancelʳ = comm+almostCancelˡ⇒almostCancelʳ *-comm *-cancelˡ-nonZero
25+
*-almostCancelʳ = commalmostCancelˡ⇒almostCancelʳ *-comm *-cancelˡ-nonZero
2626

2727
xy≈0⇒x≈0∨y≈0 : Decidable _≈_ {x y} x * y ≈ 0# x ≈ 0# ⊎ y ≈ 0#
2828
xy≈0⇒x≈0∨y≈0 _≟_ {x} {y} xy≈0 with x ≟ 0# | y ≟ 0#

src/Data/Rational/Unnormalised/Properties.agda

+4-4
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ neg⇒nonZero (mkℚᵘ (-[1+ _ ]) _) = _
746746
+-identityˡ p = ≃-reflexive (+-identityˡ-≡ p)
747747

748748
+-identityʳ-≡ : RightIdentity _≡_ 0ℚᵘ _+_
749-
+-identityʳ-≡ = comm+idˡ⇒idʳ +-comm-≡ {e = 0ℚᵘ} +-identityˡ-≡
749+
+-identityʳ-≡ = commidˡ⇒idʳ +-comm-≡ {e = 0ℚᵘ} +-identityˡ-≡
750750

751751
+-identityʳ : RightIdentity _≃_ 0ℚᵘ _+_
752752
+-identityʳ p = ≃-reflexive (+-identityʳ-≡ p)
@@ -1104,7 +1104,7 @@ p≤q⇒0≤q-p {p} {q} p≤q = begin
11041104
*-identityˡ-≡ p@record{} = ↥↧≡⇒≡ (ℤ.*-identityˡ (↥ p)) (ℕ.+-identityʳ (↧ₙ p))
11051105

11061106
*-identityʳ-≡ : RightIdentity _≡_ 1ℚᵘ _*_
1107-
*-identityʳ-≡ = comm+idˡ⇒idʳ *-comm-≡ {e = 1ℚᵘ} *-identityˡ-≡
1107+
*-identityʳ-≡ = commidˡ⇒idʳ *-comm-≡ {e = 1ℚᵘ} *-identityˡ-≡
11081108

11091109
*-identity-≡ : Identity _≡_ 1ℚᵘ _*_
11101110
*-identity-≡ = *-identityˡ-≡ , *-identityʳ-≡
@@ -1144,7 +1144,7 @@ p≤q⇒0≤q-p {p} {q} p≤q = begin
11441144
*-zeroˡ p@record{} = *≡* refl
11451145

11461146
*-zeroʳ : RightZero _≃_ 0ℚᵘ _*_
1147-
*-zeroʳ = Consequences.comm+zeˡ⇒zeʳ ≃-setoid *-comm *-zeroˡ
1147+
*-zeroʳ = Consequences.commzeˡ⇒zeʳ ≃-setoid *-comm *-zeroˡ
11481148

11491149
*-zero : Zero _≃_ 0ℚᵘ _*_
11501150
*-zero = *-zeroˡ , *-zeroʳ
@@ -1171,7 +1171,7 @@ invertible⇒≄ {p} {q} (1/p-q , 1/x*x≃1 , x*1/x≃1) p≃q = 0≄1 (begin
11711171
in *≡* eq where open ℤ-solver
11721172

11731173
*-distribʳ-+ : _DistributesOverʳ_ _≃_ _*_ _+_
1174-
*-distribʳ-+ = Consequences.comm+distrˡ⇒distrʳ ≃-setoid +-cong *-comm *-distribˡ-+
1174+
*-distribʳ-+ = Consequences.commdistrˡ⇒distrʳ ≃-setoid +-cong *-comm *-distribˡ-+
11751175

11761176
*-distrib-+ : _DistributesOver_ _≃_ _*_ _+_
11771177
*-distrib-+ = *-distribˡ-+ , *-distribʳ-+

0 commit comments

Comments
 (0)