Skip to content

Refactor linear algebra to use "tuples" for what was "vectors" #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
20fac9f
Renames
lowasser Apr 6, 2025
14c4950
Progress
lowasser Apr 6, 2025
fade62c
Rename
lowasser Apr 6, 2025
0570ab0
Fix line lengths
lowasser Apr 6, 2025
9bc47b9
Progress
lowasser Apr 6, 2025
7eb1071
Doc overhaul
lowasser Apr 6, 2025
3cb864d
Doc overhaul
lowasser Apr 6, 2025
e766ecd
Refactoring
lowasser Apr 25, 2025
9846de0
Merge branch 'master' into linear-refactor
lowasser Apr 25, 2025
105e507
Move to lists package
lowasser Apr 25, 2025
dd220dd
Fix link
lowasser Apr 25, 2025
b558731
Update src/linear-algebra/finite-sequences-on-rings.lagda.md
lowasser May 3, 2025
b7fb0fa
Renaming
lowasser May 3, 2025
214ae53
Merge remote-tracking branch 'origin/linear-refactor' into linear-ref…
lowasser May 3, 2025
bdf98f6
More corrections:
lowasser May 3, 2025
40bcde6
Merge branch 'master' into linear-refactor
lowasser May 4, 2025
48d1543
Wording
lowasser May 4, 2025
cb7a757
Wrapping
lowasser May 4, 2025
30c4a51
Apply suggestions from code review
lowasser May 6, 2025
010af9f
Apply suggestions from code review
lowasser May 6, 2025
d918d14
Merge branch 'master' into linear-refactor
lowasser May 6, 2025
0615f38
Apply suggestions from code review
lowasser May 7, 2025
4cd4217
Progress
lowasser May 7, 2025
9227d31
Update src/linear-algebra/finite-sequences-in-commutative-rings.lagda.md
fredrik-bakke May 13, 2025
c386e10
Update src/linear-algebra/tuples-on-rings.lagda.md
fredrik-bakke May 13, 2025
47399d1
Apply suggestions from code review
lowasser May 14, 2025
f2991be
Merge branch 'master' into linear-refactor
lowasser May 14, 2025
fd444a4
Merge remote-tracking branch 'origin/linear-refactor' into linear-ref…
lowasser May 14, 2025
be79101
Respond to review comments
lowasser May 14, 2025
ec0503b
Update src/lists/finite-sequences.lagda.md
fredrik-bakke May 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ open import foundation.homotopies
open import foundation.identity-types
open import foundation.universe-levels

open import linear-algebra.vectors-on-commutative-rings
open import linear-algebra.finite-sequences-in-commutative-rings

open import ring-theory.binomial-theorem-rings

Expand Down Expand Up @@ -50,7 +50,7 @@ The binomial theorem is the [44th](literature.100-theorems.md#44) theorem on
```agda
binomial-sum-Commutative-Ring :
{l : Level} (A : Commutative-Ring l)
(n : ℕ) (f : functional-vec-Commutative-Ring A (succ-ℕ n)) →
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A (succ-ℕ n)) →
type-Commutative-Ring A
binomial-sum-Commutative-Ring A = binomial-sum-Ring (ring-Commutative-Ring A)
```
Expand All @@ -65,14 +65,14 @@ module _
where

binomial-sum-one-element-Commutative-Ring :
(f : functional-vec-Commutative-Ring A 1) →
(f : fin-sequence-type-Commutative-Ring A 1) →
binomial-sum-Commutative-Ring A 0 f =
head-functional-vec-Commutative-Ring A 0 f
head-fin-sequence-type-Commutative-Ring A 0 f
binomial-sum-one-element-Commutative-Ring =
binomial-sum-one-element-Ring (ring-Commutative-Ring A)

binomial-sum-two-elements-Commutative-Ring :
(f : functional-vec-Commutative-Ring A 2) →
(f : fin-sequence-type-Commutative-Ring A 2) →
binomial-sum-Commutative-Ring A 1 f =
add-Commutative-Ring A (f (zero-Fin 1)) (f (one-Fin 1))
binomial-sum-two-elements-Commutative-Ring =
Expand All @@ -87,7 +87,7 @@ module _
where

htpy-binomial-sum-Commutative-Ring :
(n : ℕ) {f g : functional-vec-Commutative-Ring A (succ-ℕ n)} →
(n : ℕ) {f g : fin-sequence-type-Commutative-Ring A (succ-ℕ n)} →
(f ~ g) →
binomial-sum-Commutative-Ring A n f = binomial-sum-Commutative-Ring A n g
htpy-binomial-sum-Commutative-Ring =
Expand All @@ -103,14 +103,14 @@ module _

left-distributive-mul-binomial-sum-Commutative-Ring :
(n : ℕ) (x : type-Commutative-Ring A)
(f : functional-vec-Commutative-Ring A (succ-ℕ n)) →
(f : fin-sequence-type-Commutative-Ring A (succ-ℕ n)) →
mul-Commutative-Ring A x (binomial-sum-Commutative-Ring A n f) =
binomial-sum-Commutative-Ring A n (λ i → mul-Commutative-Ring A x (f i))
left-distributive-mul-binomial-sum-Commutative-Ring =
left-distributive-mul-binomial-sum-Ring (ring-Commutative-Ring A)

right-distributive-mul-binomial-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring A (succ-ℕ n)) →
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A (succ-ℕ n)) →
(x : type-Commutative-Ring A) →
mul-Commutative-Ring A (binomial-sum-Commutative-Ring A n f) x =
binomial-sum-Commutative-Ring A n (λ i → mul-Commutative-Ring A (f i) x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ open import foundation.homotopies
open import foundation.identity-types
open import foundation.universe-levels

open import linear-algebra.vectors-on-commutative-semirings
open import linear-algebra.finite-sequences-in-commutative-semirings

open import ring-theory.binomial-theorem-semirings

Expand Down Expand Up @@ -50,7 +50,7 @@ The binomial theorem is the [44th](literature.100-theorems.md#44) theorem on
```agda
binomial-sum-Commutative-Semiring :
{l : Level} (A : Commutative-Semiring l)
(n : ℕ) (f : functional-vec-Commutative-Semiring A (succ-ℕ n)) →
(n : ℕ) (f : fin-sequence-type-Commutative-Semiring A (succ-ℕ n)) →
type-Commutative-Semiring A
binomial-sum-Commutative-Semiring A =
binomial-sum-Semiring (semiring-Commutative-Semiring A)
Expand All @@ -66,14 +66,14 @@ module _
where

binomial-sum-one-element-Commutative-Semiring :
(f : functional-vec-Commutative-Semiring A 1) →
(f : fin-sequence-type-Commutative-Semiring A 1) →
binomial-sum-Commutative-Semiring A 0 f =
head-functional-vec-Commutative-Semiring A 0 f
head-fin-sequence-type-Commutative-Semiring A 0 f
binomial-sum-one-element-Commutative-Semiring =
binomial-sum-one-element-Semiring (semiring-Commutative-Semiring A)

binomial-sum-two-elements-Commutative-Semiring :
(f : functional-vec-Commutative-Semiring A 2) →
(f : fin-sequence-type-Commutative-Semiring A 2) →
binomial-sum-Commutative-Semiring A 1 f =
add-Commutative-Semiring A (f (zero-Fin 1)) (f (one-Fin 1))
binomial-sum-two-elements-Commutative-Semiring =
Expand All @@ -88,7 +88,7 @@ module _
where

htpy-binomial-sum-Commutative-Semiring :
(n : ℕ) {f g : functional-vec-Commutative-Semiring A (succ-ℕ n)} →
(n : ℕ) {f g : fin-sequence-type-Commutative-Semiring A (succ-ℕ n)} →
(f ~ g) →
binomial-sum-Commutative-Semiring A n f =
binomial-sum-Commutative-Semiring A n g
Expand All @@ -105,7 +105,7 @@ module _

left-distributive-mul-binomial-sum-Commutative-Semiring :
(n : ℕ) (x : type-Commutative-Semiring A)
(f : functional-vec-Commutative-Semiring A (succ-ℕ n)) →
(f : fin-sequence-type-Commutative-Semiring A (succ-ℕ n)) →
mul-Commutative-Semiring A x (binomial-sum-Commutative-Semiring A n f) =
binomial-sum-Commutative-Semiring A n
( λ i → mul-Commutative-Semiring A x (f i))
Expand All @@ -114,7 +114,7 @@ module _
( semiring-Commutative-Semiring A)

right-distributive-mul-binomial-sum-Commutative-Semiring :
(n : ℕ) (f : functional-vec-Commutative-Semiring A (succ-ℕ n)) →
(n : ℕ) (f : fin-sequence-type-Commutative-Semiring A (succ-ℕ n)) →
(x : type-Commutative-Semiring A) →
mul-Commutative-Semiring A (binomial-sum-Commutative-Semiring A n f) x =
binomial-sum-Commutative-Semiring A n
Expand Down
49 changes: 27 additions & 22 deletions src/commutative-algebra/sums-commutative-rings.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ 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 linear-algebra.finite-sequences-in-commutative-rings

open import lists.finite-sequences

open import ring-theory.sums-rings

Expand All @@ -34,14 +35,14 @@ open import univalent-combinatorics.standard-finite-types
## Idea

The **sum operation** extends the binary addition operation on a commutative
ring `A` to any family of elements of `A` indexed by a standard finite type.
ring `A` to any [finite sequence](lists.finite-sequences.md) of elements of `A`.

## Definition

```agda
sum-Commutative-Ring :
{l : Level} (A : Commutative-Ring l) (n : ℕ) →
(functional-vec-Commutative-Ring A n) → type-Commutative-Ring A
(fin-sequence-type-Commutative-Ring A n) → type-Commutative-Ring A
sum-Commutative-Ring A = sum-Ring (ring-Commutative-Ring A)
```

Expand All @@ -55,13 +56,13 @@ module _
where

sum-one-element-Commutative-Ring :
(f : functional-vec-Commutative-Ring A 1) →
sum-Commutative-Ring A 1 f = head-functional-vec 0 f
(f : fin-sequence-type-Commutative-Ring A 1) →
sum-Commutative-Ring A 1 f = head-fin-sequence 0 f
sum-one-element-Commutative-Ring =
sum-one-element-Ring (ring-Commutative-Ring A)

sum-two-elements-Commutative-Ring :
(f : functional-vec-Commutative-Ring A 2) →
(f : fin-sequence-type-Commutative-Ring A 2) →
sum-Commutative-Ring A 2 f =
add-Commutative-Ring A (f (zero-Fin 1)) (f (one-Fin 1))
sum-two-elements-Commutative-Ring =
Expand All @@ -76,7 +77,7 @@ module _
where

htpy-sum-Commutative-Ring :
(n : ℕ) {f g : functional-vec-Commutative-Ring A n} →
(n : ℕ) {f g : fin-sequence-type-Commutative-Ring A n} →
(f ~ g) → sum-Commutative-Ring A n f = sum-Commutative-Ring A n g
htpy-sum-Commutative-Ring = htpy-sum-Ring (ring-Commutative-Ring A)
```
Expand All @@ -89,15 +90,15 @@ module _
where

cons-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring A (succ-ℕ n)) →
{x : type-Commutative-Ring A} → head-functional-vec n f = x →
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A (succ-ℕ n)) →
{x : type-Commutative-Ring A} → head-fin-sequence n f = x →
sum-Commutative-Ring A (succ-ℕ n) f =
add-Commutative-Ring A
( sum-Commutative-Ring A n (tail-functional-vec n f)) x
( sum-Commutative-Ring A n (tail-fin-sequence n f)) x
cons-sum-Commutative-Ring = cons-sum-Ring (ring-Commutative-Ring A)

snoc-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring A (succ-ℕ n)) →
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A (succ-ℕ n)) →
{x : type-Commutative-Ring A} → f (zero-Fin n) = x →
sum-Commutative-Ring A (succ-ℕ n) f =
add-Commutative-Ring A
Expand All @@ -115,14 +116,14 @@ module _

left-distributive-mul-sum-Commutative-Ring :
(n : ℕ) (x : type-Commutative-Ring A)
(f : functional-vec-Commutative-Ring A n) →
(f : fin-sequence-type-Commutative-Ring A n) →
mul-Commutative-Ring A x (sum-Commutative-Ring A n f) =
sum-Commutative-Ring A n (λ i → mul-Commutative-Ring A x (f i))
left-distributive-mul-sum-Commutative-Ring =
left-distributive-mul-sum-Ring (ring-Commutative-Ring A)

right-distributive-mul-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring A n)
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A n)
(x : type-Commutative-Ring A) →
mul-Commutative-Ring A (sum-Commutative-Ring A n f) x =
sum-Commutative-Ring A n (λ i → mul-Commutative-Ring A (f i) x)
Expand All @@ -138,12 +139,12 @@ module _
where

interchange-add-sum-Commutative-Ring :
(n : ℕ) (f g : functional-vec-Commutative-Ring A n) →
(n : ℕ) (f g : fin-sequence-type-Commutative-Ring A n) →
add-Commutative-Ring A
( sum-Commutative-Ring A n f)
( sum-Commutative-Ring A n g) =
sum-Commutative-Ring A n
( add-functional-vec-Commutative-Ring A n f g)
( add-fin-sequence-type-Commutative-Ring A n f g)
interchange-add-sum-Commutative-Ring =
interchange-add-sum-Ring (ring-Commutative-Ring A)
```
Expand All @@ -156,10 +157,14 @@ module _
where

extend-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring A n) →
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A n) →
sum-Commutative-Ring A
( succ-ℕ n)
( cons-functional-vec-Commutative-Ring A n (zero-Commutative-Ring A) f) =
( cons-fin-sequence-type-Commutative-Ring
( A)
( n)
( zero-Commutative-Ring A)
( f)) =
sum-Commutative-Ring A n f
extend-sum-Commutative-Ring = extend-sum-Ring (ring-Commutative-Ring A)
```
Expand All @@ -172,10 +177,10 @@ module _
where

shift-sum-Commutative-Ring :
(n : ℕ) (f : functional-vec-Commutative-Ring A n) →
(n : ℕ) (f : fin-sequence-type-Commutative-Ring A n) →
sum-Commutative-Ring A
( succ-ℕ n)
( snoc-functional-vec-Commutative-Ring A n f
( snoc-fin-sequence-type-Commutative-Ring A n f
( zero-Commutative-Ring A)) =
sum-Commutative-Ring A n f
shift-sum-Commutative-Ring = shift-sum-Ring (ring-Commutative-Ring A)
Expand All @@ -186,7 +191,7 @@ module _
```agda
split-sum-Commutative-Ring :
{l : Level} (A : Commutative-Ring l)
(n m : ℕ) (f : functional-vec-Commutative-Ring A (n +ℕ m)) →
(n m : ℕ) (f : fin-sequence-type-Commutative-Ring A (n +ℕ m)) →
sum-Commutative-Ring A (n +ℕ m) f =
add-Commutative-Ring A
( sum-Commutative-Ring A n (f ∘ inl-coproduct-Fin n m))
Expand All @@ -210,7 +215,7 @@ module _
sum-zero-Commutative-Ring :
(n : ℕ) →
sum-Commutative-Ring A n
( zero-functional-vec-Commutative-Ring A n) =
( zero-fin-sequence-type-Commutative-Ring A n) =
zero-Commutative-Ring A
sum-zero-Commutative-Ring = sum-zero-Ring (ring-Commutative-Ring A)
```
Loading