-
Notifications
You must be signed in to change notification settings - Fork 63
/
sums-commutative-rings.lagda.md
215 lines (172 loc) · 6.18 KB
/
sums-commutative-rings.lagda.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# Sums in commutative rings
```agda
module commutative-algebra.sums-commutative-rings where
```
<details><summary>Imports</summary>
```agda
open import commutative-algebra.commutative-rings
open import elementary-number-theory.addition-natural-numbers
open import elementary-number-theory.natural-numbers
open import foundation.coproduct-types
open import foundation.functions
open import foundation.homotopies
open import foundation.identity-types
open import foundation.unit-type
open import foundation.universe-levels
open import linear-algebra.vectors
open import linear-algebra.vectors-on-commutative-rings
open import ring-theory.sums-rings
open import univalent-combinatorics.coproduct-types
open import univalent-combinatorics.standard-finite-types
```
</details>
## Idea
The sum operation extends the binary addition operation on a commutative ring
`R` to any family of elements of `R` indexed by a standard finite type.
## Definition
```agda
sum-Commutative-Ring :
{l : Level} (R : Commutative-Ring l) (n : ℕ) →
(functional-vec-Commutative-Ring R n) → type-Commutative-Ring R
sum-Commutative-Ring R = sum-Ring (ring-Commutative-Ring R)
```
## Properties
### Sums of one and two elements
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
sum-one-element-Commutative-Ring :
(f : functional-vec-Commutative-Ring R 1) →
sum-Commutative-Ring R 1 f = head-functional-vec 0 f
sum-one-element-Commutative-Ring =
sum-one-element-Ring (ring-Commutative-Ring R)
sum-two-elements-Commutative-Ring :
(f : functional-vec-Commutative-Ring R 2) →
sum-Commutative-Ring R 2 f =
add-Commutative-Ring R (f (zero-Fin 1)) (f (one-Fin 1))
sum-two-elements-Commutative-Ring =
sum-two-elements-Ring (ring-Commutative-Ring R)
```
### Sums are homotopy invariant
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
htpy-sum-Commutative-Ring :
(n : ℕ) {f g : functional-vec-Commutative-Ring R n} →
(f ~ g) → sum-Commutative-Ring R n f = sum-Commutative-Ring R n g
htpy-sum-Commutative-Ring = htpy-sum-Ring (ring-Commutative-Ring R)
```
### Sums are equal to the zero-th term plus the rest
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
cons-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring R (succ-ℕ n)) →
{x : type-Commutative-Ring R} → head-functional-vec n f = x →
sum-Commutative-Ring R (succ-ℕ n) f =
add-Commutative-Ring R
( sum-Commutative-Ring R n (tail-functional-vec n f)) x
cons-sum-Commutative-Ring = cons-sum-Ring (ring-Commutative-Ring R)
snoc-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring R (succ-ℕ n)) →
{x : type-Commutative-Ring R} → f (zero-Fin n) = x →
sum-Commutative-Ring R (succ-ℕ n) f =
add-Commutative-Ring R
( x)
( sum-Commutative-Ring R n (f ∘ inr-Fin n))
snoc-sum-Commutative-Ring = snoc-sum-Ring (ring-Commutative-Ring R)
```
### Multiplication distributes over sums
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
left-distributive-mul-sum-Commutative-Ring :
(n : ℕ) (x : type-Commutative-Ring R)
(f : functional-vec-Commutative-Ring R n) →
mul-Commutative-Ring R x (sum-Commutative-Ring R n f) =
sum-Commutative-Ring R n (λ i → mul-Commutative-Ring R x (f i))
left-distributive-mul-sum-Commutative-Ring =
left-distributive-mul-sum-Ring (ring-Commutative-Ring R)
right-distributive-mul-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring R n)
(x : type-Commutative-Ring R) →
mul-Commutative-Ring R (sum-Commutative-Ring R n f) x =
sum-Commutative-Ring R n (λ i → mul-Commutative-Ring R (f i) x)
right-distributive-mul-sum-Commutative-Ring =
right-distributive-mul-sum-Ring (ring-Commutative-Ring R)
```
### Interchange law of sums and addition in a commutative ring
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
interchange-add-sum-Commutative-Ring :
(n : ℕ) (f g : functional-vec-Commutative-Ring R n) →
add-Commutative-Ring R
( sum-Commutative-Ring R n f)
( sum-Commutative-Ring R n g) =
sum-Commutative-Ring R n
( add-functional-vec-Commutative-Ring R n f g)
interchange-add-sum-Commutative-Ring =
interchange-add-sum-Ring (ring-Commutative-Ring R)
```
### Extending a sum of elements in a commutative ring
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
extend-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring R n) →
sum-Commutative-Ring R
( succ-ℕ n)
( cons-functional-vec-Commutative-Ring R n (zero-Commutative-Ring R) f) =
sum-Commutative-Ring R n f
extend-sum-Commutative-Ring = extend-sum-Ring (ring-Commutative-Ring R)
```
### Shifting a sum of elements in a commutative ring
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
shift-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring R n) →
sum-Commutative-Ring R
( succ-ℕ n)
( snoc-functional-vec-Commutative-Ring R n f
( zero-Commutative-Ring R)) =
sum-Commutative-Ring R n f
shift-sum-Commutative-Ring = shift-sum-Ring (ring-Commutative-Ring R)
```
### Splitting sums
```agda
split-sum-Commutative-Ring :
{l : Level} (R : Commutative-Ring l)
(n m : ℕ) (f : functional-vec-Commutative-Ring R (add-ℕ n m)) →
sum-Commutative-Ring R (add-ℕ n m) f =
add-Commutative-Ring R
( sum-Commutative-Ring R n (f ∘ inl-coprod-Fin n m))
( sum-Commutative-Ring R m (f ∘ inr-coprod-Fin n m))
split-sum-Commutative-Ring R n zero-ℕ f =
inv (right-unit-law-add-Commutative-Ring R (sum-Commutative-Ring R n f))
split-sum-Commutative-Ring R n (succ-ℕ m) f =
( ap
( add-Commutative-Ring' R (f(inr star)))
( split-sum-Commutative-Ring R n m (f ∘ inl))) ∙
( associative-add-Commutative-Ring R _ _ _ )
```
### A sum of zeroes is zero
```agda
module _
{l : Level} (R : Commutative-Ring l)
where
sum-zero-Commutative-Ring :
(n : ℕ) →
sum-Commutative-Ring R n
( zero-functional-vec-Commutative-Ring R n) =
zero-Commutative-Ring R
sum-zero-Commutative-Ring = sum-zero-Ring (ring-Commutative-Ring R)
```