Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
aa26daf
move univalence code
felixwellen Jul 29, 2024
bedb68c
start...
felixwellen Jul 29, 2024
fc3f13d
boilerplate
felixwellen Jul 30, 2024
342c6f7
fix auto-univalence
felixwellen May 14, 2024
5721afc
fix FreeCommAlg
felixwellen May 29, 2024
bc628b0
fix subalgebra
felixwellen May 30, 2024
88dfe3e
fix FPAlgebra
felixwellen May 30, 2024
0235105
copy Evans approach for Groups
felixwellen Jun 18, 2024
3a66ea4
refactor
felixwellen Jun 19, 2024
a1c53ee
refactor
felixwellen Jun 19, 2024
8666e25
no-eta for algebra structures
felixwellen Jun 19, 2024
39e0d63
opaque quotients, fix unicity
felixwellen Jul 26, 2024
cdba5b8
fast tc for quotient comm rings
felixwellen Jul 29, 2024
e8a82ba
uniform indentation
felixwellen Jul 29, 2024
9b9eb32
cleanup /remove flag
felixwellen Jul 29, 2024
538f1a3
improve names
felixwellen Jul 29, 2024
7491ba4
clean up
felixwellen Jul 29, 2024
b510576
WIP: deactivate problematic code
felixwellen Jul 29, 2024
72e0842
refactor/simplify
felixwellen Jun 20, 2024
c0d080a
WIP
felixwellen Jul 26, 2024
9f437d7
start with stuff on the new comm alg
felixwellen Jul 26, 2024
53c6d7c
Revert "Auxiliary commit to revert individual files from c5e74aa95d26…
felixwellen Jul 29, 2024
d3df34e
Quotients
felixwellen Jul 29, 2024
0e50d92
update comm ring hom interface
felixwellen Jul 30, 2024
86fa562
more boilerplate
felixwellen Jul 30, 2024
fcc25af
kernels
felixwellen Jul 30, 2024
883e2a3
syntax for new algebras
felixwellen Jul 30, 2024
b9030eb
more on comm ring quotients
felixwellen Jul 30, 2024
4b565e9
fix
felixwellen Jul 30, 2024
b9568c3
algebra quotients
felixwellen Jul 30, 2024
78cc276
more opaque definitions, more use of set-level equalities
felixwellen Jul 31, 2024
4de2238
commRingHom fixes
felixwellen Aug 1, 2024
c86a763
unit comm algebra
felixwellen Jul 31, 2024
f460ec9
quotients
felixwellen Jul 31, 2024
fcf35f2
no-eta for the equations of a ring
felixwellen Aug 1, 2024
f4ce327
WIP: Univalence
felixwellen Aug 1, 2024
efd6741
equality characterization with help from Evan
felixwellen Aug 1, 2024
38a7229
WIP
felixwellen Aug 1, 2024
b1309e2
typevariate polynomials as comm ring
felixwellen Aug 2, 2024
7f1223a
polynomials as comm algebra
felixwellen Aug 2, 2024
052ac6a
remove opaque structure again
felixwellen Aug 2, 2024
1df74f6
Revert "WIP: deactivate problematic code"
felixwellen Aug 2, 2024
d4de177
make one example more meaningful
felixwellen Aug 2, 2024
1984cce
univalence for comm algebras with Evans help
felixwellen Aug 2, 2024
06d7c74
various fixes, continue with typevariate polynomials
felixwellen Aug 2, 2024
0a106c4
induce a com ring hom
felixwellen Aug 2, 2024
c275ee0
Comm ring of polynomials on a general variable type and its universal…
felixwellen Aug 2, 2024
b0fb80b
improve interface
felixwellen Aug 3, 2024
023f895
more interface, more opaque
felixwellen Aug 3, 2024
e148e90
fix
felixwellen Aug 3, 2024
260ee84
start with localization, fixes, more opaque things
felixwellen Aug 3, 2024
2219a40
make ring quotients' isRing opaque instead of no-eta
felixwellen Aug 3, 2024
89a62a8
update to new interface for comm ring homs
felixwellen Aug 4, 2024
5789010
update to new interface for comm ring homs
felixwellen Aug 4, 2024
486c57b
stub for polynomials, fix
felixwellen Aug 4, 2024
b9f7dd5
finish localization
felixwellen Aug 4, 2024
940333e
start with OnCoproduct, change default notation for R[I]
felixwellen Aug 4, 2024
26f571b
universal property of polynomials as rings
felixwellen Aug 7, 2024
b8eeadf
move old CommAlgebra
felixwellen Aug 7, 2024
4b36613
category structure
felixwellen Aug 7, 2024
8e274e1
fix ref
felixwellen Aug 8, 2024
a9582c2
fix/move algebra as module
felixwellen Aug 8, 2024
296a025
refs
felixwellen Aug 8, 2024
9ca6be8
remove old CommAlgebra.agda, move all refs
felixwellen Aug 8, 2024
72f809b
fix
felixwellen Aug 8, 2024
a9686db
make the new CommAlgebra the default
felixwellen Aug 8, 2024
202daa6
remove no-eta for structure
felixwellen Aug 8, 2024
ca7272e
start with fp algebras
felixwellen Aug 8, 2024
a6fd389
small additions
felixwellen Aug 8, 2024
2725239
WIP: start with FP algebra examples
felixwellen Aug 8, 2024
f408a27
change def, fix thinghs
felixwellen Aug 8, 2024
3d1ea81
fix localization, adapt univalence, rearrange base
felixwellen Aug 9, 2024
9eed726
fix quotients
felixwellen Aug 9, 2024
034a3ca
fix
felixwellen Aug 9, 2024
2da1ff0
fix
felixwellen Aug 23, 2024
18f9060
solver examples with new comm algebras
felixwellen Aug 26, 2024
d66dd0f
fix
felixwellen Aug 26, 2024
cf98ea1
more boilterplate, morphism contructor
felixwellen Aug 26, 2024
808f7ec
polynomial ring is fp
felixwellen Aug 30, 2024
344e4b3
add more calcualtions
felixwellen Aug 30, 2024
bd9e0fa
port initial algebra
felixwellen Sep 30, 2024
77db8b3
fix comment
felixwellen Sep 30, 2024
6f7ed68
WIP
felixwellen Oct 10, 2024
8c6c6c3
WIP
felixwellen Jul 8, 2025
0ff2847
flatten
felixwellen Jul 8, 2025
0e5aadb
universal property of fp algebras
felixwellen Jul 9, 2025
c2267e6
more fp algebras
felixwellen Jul 10, 2025
06aba7e
use name "terminal" instead of "unit"
felixwellen Jul 10, 2025
7ffbc5b
terminal R-algebra is fp, notation
felixwellen Jul 10, 2025
1817190
finite choice for FinData Fin
felixwellen Jul 11, 2025
e6660be
minor changes
felixwellen Jul 11, 2025
9b8b4a9
refactor
felixwellen Jul 11, 2025
cf0c39a
WIP
felixwellen Jul 16, 2025
81e1ed9
reduce problem
felixwellen Jul 16, 2025
1852481
reduce problem
felixwellen Jul 16, 2025
b500aa7
Revert "reduce problem"
felixwellen Jul 16, 2025
bf32317
Revert "reduce problem"
felixwellen Jul 16, 2025
2d0d3d4
refactor QuotientAlgebra
felixwellen Jul 17, 2025
71b212f
proof on 0Ideal and imageIdeal
felixwellen Jul 22, 2025
8415d51
add important remark (would have saved me time)
felixwellen Jul 22, 2025
60231d3
remove superfluous opaqueness
felixwellen Jul 22, 2025
c1be108
boilerplate
felixwellen Jul 22, 2025
323cdb5
fix terminology
felixwellen Jul 22, 2025
a98ec07
lemma on quotients
felixwellen Jul 22, 2025
17afe6a
make checkable
felixwellen Jul 22, 2025
5af5d6b
missed ref
felixwellen Jul 22, 2025
3104fc3
hom linear combination
felixwellen Jul 22, 2025
05aa7ce
iamges of fgIdeals
felixwellen Jul 22, 2025
057ebad
comment
felixwellen Jul 22, 2025
b65172a
boilerplate
felixwellen Jul 22, 2025
1c1f407
itereted quotients for CommAlgebras
felixwellen Jul 22, 2025
fc6515d
iterated fg ideal quotients
felixwellen Jul 22, 2025
360bfb0
add lemma on quotients
felixwellen Jul 23, 2025
287bccc
fp quotients
felixwellen Jul 24, 2025
e3e32a0
remove obsoleted
felixwellen Jul 24, 2025
3caf5b5
maek dependency on old CommAlgebra explicit
felixwellen Jul 24, 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
54 changes: 12 additions & 42 deletions Cubical/Algebra/Algebra/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ open import Cubical.Foundations.SIP

open import Cubical.Data.Sigma

open import Cubical.Displayed.Base
open import Cubical.Displayed.Auto
open import Cubical.Displayed.Record
open import Cubical.Displayed.Universe

open import Cubical.Reflection.RecordEquiv

open import Cubical.Algebra.Monoid
Expand All @@ -36,7 +31,7 @@ record IsAlgebra (R : Ring ℓ) {A : Type ℓ'}
(0a 1a : A) (_+_ _·_ : A → A → A) (-_ : A → A)
(_⋆_ : ⟨ R ⟩ → A → A) : Type (ℓ-max ℓ ℓ') where

constructor isalgebra
no-eta-equality

open RingStr (snd R) using (1r) renaming (_+_ to _+r_; _·_ to _·r_)

Expand All @@ -59,8 +54,6 @@ unquoteDecl IsAlgebraIsoΣ = declareRecordIsoΣ IsAlgebraIsoΣ (quote IsAlgebra)

record AlgebraStr (R : Ring ℓ) (A : Type ℓ') : Type (ℓ-max ℓ ℓ') where

constructor algebrastr

field
0a : A
1a : A
Expand All @@ -72,6 +65,8 @@ record AlgebraStr (R : Ring ℓ) (A : Type ℓ') : Type (ℓ-max ℓ ℓ') where

open IsAlgebra isAlgebra public

unquoteDecl AlgebraStrIsoΣ = declareRecordIsoΣ AlgebraStrIsoΣ (quote AlgebraStr)

Algebra : (R : Ring ℓ) → ∀ ℓ' → Type (ℓ-max ℓ (ℓ-suc ℓ'))
Algebra R ℓ' = Σ[ A ∈ Type ℓ' ] AlgebraStr R A

Expand Down Expand Up @@ -208,13 +203,15 @@ isPropIsAlgebra R _ _ _ _ _ _ = let open IsLeftModule in
isPropIsAlgebraHom : (R : Ring ℓ) {A : Type ℓ'} {B : Type ℓ''}
(AS : AlgebraStr R A) (f : A → B) (BS : AlgebraStr R B)
→ isProp (IsAlgebraHom AS f BS)
isPropIsAlgebraHom R AS f BS = isOfHLevelRetractFromIso 1 IsAlgebraHomIsoΣ
(isProp×5 (is-set _ _)
(is-set _ _)
(isPropΠ2 λ _ _ → is-set _ _)
(isPropΠ2 λ _ _ → is-set _ _)
(isPropΠ λ _ → is-set _ _)
(isPropΠ2 λ _ _ → is-set _ _))
isPropIsAlgebraHom R AS f BS =
isOfHLevelRetractFromIso 1
IsAlgebraHomIsoΣ
(isProp×5 (is-set _ _)
(is-set _ _)
(isPropΠ2 λ _ _ → is-set _ _)
(isPropΠ2 λ _ _ → is-set _ _)
(isPropΠ λ _ → is-set _ _)
(isPropΠ2 λ _ _ → is-set _ _))
where
open AlgebraStr BS

Expand All @@ -237,33 +234,6 @@ isSetAlgebraEquiv M N = isSetΣ (isOfHLevel≃ 2 M.is-set N.is-set)
AlgebraHom≡ : {φ ψ : AlgebraHom A B} → fst φ ≡ fst ψ → φ ≡ ψ
AlgebraHom≡ = Σ≡Prop λ f → isPropIsAlgebraHom _ _ f _

𝒮ᴰ-Algebra : (R : Ring ℓ) → DUARel (𝒮-Univ ℓ') (AlgebraStr R) (ℓ-max ℓ ℓ')
𝒮ᴰ-Algebra R =
𝒮ᴰ-Record (𝒮-Univ _) (IsAlgebraEquiv {R = R})
(fields:
data[ 0a ∣ nul ∣ pres0 ]
data[ 1a ∣ nul ∣ pres1 ]
data[ _+_ ∣ bin ∣ pres+ ]
data[ _·_ ∣ bin ∣ pres· ]
data[ -_ ∣ autoDUARel _ _ ∣ pres- ]
data[ _⋆_ ∣ autoDUARel _ _ ∣ pres⋆ ]
prop[ isAlgebra ∣ (λ _ _ → isPropIsAlgebra _ _ _ _ _ _ _) ])
where
open AlgebraStr

-- faster with some sharing
nul = autoDUARel (𝒮-Univ _) (λ A → A)
bin = autoDUARel (𝒮-Univ _) (λ A → A → A → A)

AlgebraPath : (A B : Algebra R ℓ') → (AlgebraEquiv A B) ≃ (A ≡ B)
AlgebraPath {R = R} = ∫ (𝒮ᴰ-Algebra R) .UARel.ua

uaAlgebra : AlgebraEquiv A B → A ≡ B
uaAlgebra {A = A} {B = B} = equivFun (AlgebraPath A B)

isGroupoidAlgebra : isGroupoid (Algebra R ℓ')
isGroupoidAlgebra _ _ = isOfHLevelRespectEquiv 2 (AlgebraPath _ _) (isSetAlgebraEquiv _ _)

-- Smart constructor for algebra homomorphisms
-- that infers the other equations from pres1, pres+, pres·, and pres⋆

Expand Down
69 changes: 13 additions & 56 deletions Cubical/Algebra/Algebra/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ open import Cubical.Foundations.HLevels
open import Cubical.Foundations.GroupoidLaws
open import Cubical.Foundations.Path
open import Cubical.Foundations.Transport
open import Cubical.Foundations.Univalence
open import Cubical.Foundations.SIP
open import Cubical.Foundations.SIP using (⟨_⟩)

open import Cubical.Data.Sigma

Expand Down Expand Up @@ -185,57 +184,15 @@ module AlgebraEquivs where
(λ g → isPropIsAlgebraHom _ (B .snd) g (C .snd))
(isoOnTypes .leftInv (g .fst))

-- the Algebra version of uaCompEquiv
module AlgebraUAFunctoriality where
open AlgebraStr
open AlgebraEquivs

Algebra≡ : (A B : Algebra R ℓ') → (
Σ[ p ∈ ⟨ A ⟩ ≡ ⟨ B ⟩ ]
Σ[ q0 ∈ PathP (λ i → p i) (0a (snd A)) (0a (snd B)) ]
Σ[ q1 ∈ PathP (λ i → p i) (1a (snd A)) (1a (snd B)) ]
Σ[ r+ ∈ PathP (λ i → p i → p i → p i) (_+_ (snd A)) (_+_ (snd B)) ]
Σ[ r· ∈ PathP (λ i → p i → p i → p i) (_·_ (snd A)) (_·_ (snd B)) ]
Σ[ s- ∈ PathP (λ i → p i → p i) (-_ (snd A)) (-_ (snd B)) ]
Σ[ s⋆ ∈ PathP (λ i → ⟨ R ⟩ → p i → p i) (_⋆_ (snd A)) (_⋆_ (snd B)) ]
PathP (λ i → IsAlgebra R (q0 i) (q1 i) (r+ i) (r· i) (s- i) (s⋆ i)) (isAlgebra (snd A))
(isAlgebra (snd B)))
≃ (A ≡ B)
Algebra≡ A B = isoToEquiv theIso
where
open Iso
theIso : Iso _ _
fun theIso (p , q0 , q1 , r+ , r· , s- , s⋆ , t) i = p i
, algebrastr (q0 i) (q1 i) (r+ i) (r· i) (s- i) (s⋆ i) (t i)
inv theIso x = cong ⟨_⟩ x , cong (0a ∘ snd) x , cong (1a ∘ snd) x
, cong (_+_ ∘ snd) x , cong (_·_ ∘ snd) x , cong (-_ ∘ snd) x , cong (_⋆_ ∘ snd) x
, cong (isAlgebra ∘ snd) x
rightInv theIso _ = refl
leftInv theIso _ = refl

caracAlgebra≡ : (p q : A ≡ B) → cong ⟨_⟩ p ≡ cong ⟨_⟩ q → p ≡ q
caracAlgebra≡ {A = A} {B = B} p q P =
sym (transportTransport⁻ (ua (Algebra≡ A B)) p)
∙∙ cong (transport (ua (Algebra≡ A B))) helper
∙∙ transportTransport⁻ (ua (Algebra≡ A B)) q
where
helper : transport (sym (ua (Algebra≡ A B))) p ≡ transport (sym (ua (Algebra≡ A B))) q
helper = Σ≡Prop
(λ _ → isPropΣ
(isOfHLevelPathP' 1 (is-set (snd B)) _ _)
λ _ → isPropΣ (isOfHLevelPathP' 1 (is-set (snd B)) _ _)
λ _ → isPropΣ (isOfHLevelPathP' 1 (isSetΠ2 λ _ _ → is-set (snd B)) _ _)
λ _ → isPropΣ (isOfHLevelPathP' 1 (isSetΠ2 λ _ _ → is-set (snd B)) _ _)
λ _ → isPropΣ (isOfHLevelPathP' 1 (isSetΠ λ _ → is-set (snd B)) _ _)
λ _ → isPropΣ (isOfHLevelPathP' 1 (isSetΠ2 λ _ _ → is-set (snd B)) _ _)
λ _ → isOfHLevelPathP 1 (isPropIsAlgebra _ _ _ _ _ _ _) _ _)
(transportRefl (cong ⟨_⟩ p) ∙ P ∙ sym (transportRefl (cong ⟨_⟩ q)))

uaCompAlgebraEquiv : (f : AlgebraEquiv A B) (g : AlgebraEquiv B C)
→ uaAlgebra (compAlgebraEquiv f g) ≡ uaAlgebra f ∙ uaAlgebra g
uaCompAlgebraEquiv f g = caracAlgebra≡ _ _ (
cong ⟨_⟩ (uaAlgebra (compAlgebraEquiv f g))
≡⟨ uaCompEquiv _ _ ⟩
cong ⟨_⟩ (uaAlgebra f) ∙ cong ⟨_⟩ (uaAlgebra g)
≡⟨ sym (cong-∙ ⟨_⟩ (uaAlgebra f) (uaAlgebra g)) ⟩
cong ⟨_⟩ (uaAlgebra f ∙ uaAlgebra g) ∎)
isSetAlgebraStr : (A : Type ℓ') → isSet (AlgebraStr R A)
isSetAlgebraStr A =
let open AlgebraStr
in isOfHLevelSucIfInhabited→isOfHLevelSuc 1 λ str →
isOfHLevelRetractFromIso 2 AlgebraStrIsoΣ $
isSetΣ (str .is-set) λ _ →
isSetΣ (str .is-set) λ _ →
isSetΣ (isSet→ (isSet→ (str .is-set))) λ _ →
isSetΣ (isSet→ (isSet→ (str .is-set))) λ _ →
isSetΣ (isSet→ (str .is-set)) (λ _ →
isSetΣSndProp (isSet→ (isSet→ (str .is-set))) λ _ →
isPropIsAlgebra _ _ _ _ _ _ _)
86 changes: 86 additions & 0 deletions Cubical/Algebra/Algebra/Univalence.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{-# OPTIONS --safe #-}
module Cubical.Algebra.Algebra.Univalence where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Univalence
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.GroupoidLaws
open import Cubical.Foundations.SIP

open import Cubical.Functions.Embedding

open import Cubical.Data.Sigma

open import Cubical.Displayed.Base
open import Cubical.Displayed.Auto
open import Cubical.Displayed.Record
open import Cubical.Displayed.Universe

open import Cubical.Algebra.Ring.Base
open import Cubical.Algebra.Algebra.Base
open import Cubical.Algebra.Algebra.Properties

private
variable
ℓ ℓ' ℓ'' ℓ''' : Level
R : Ring ℓ
A B C D : Algebra R ℓ

open IsAlgebraHom

𝒮ᴰ-Algebra : (R : Ring ℓ) → DUARel (𝒮-Univ ℓ') (AlgebraStr R) (ℓ-max ℓ ℓ')
𝒮ᴰ-Algebra R =
𝒮ᴰ-Record (𝒮-Univ _) (IsAlgebraEquiv {R = R})
(fields:
data[ 0a ∣ nul ∣ pres0 ]
data[ 1a ∣ nul ∣ pres1 ]
data[ _+_ ∣ bin ∣ pres+ ]
data[ _·_ ∣ bin ∣ pres· ]
data[ -_ ∣ autoDUARel _ _ ∣ pres- ]
data[ _⋆_ ∣ autoDUARel _ _ ∣ pres⋆ ]
prop[ isAlgebra ∣ (λ A ΣA →
isPropIsAlgebra
R
(snd (fst (fst (fst (fst (fst ΣA))))))
(snd (fst (fst (fst (fst ΣA)))))
(snd (fst (fst (fst ΣA))))
(snd (fst (fst ΣA)))
(snd (fst ΣA))
(snd ΣA)) ])
where
open AlgebraStr

-- faster with some sharing
nul = autoDUARel (𝒮-Univ _) (λ A → A)
bin = autoDUARel (𝒮-Univ _) (λ A → A → A → A)

AlgebraPath : (A B : Algebra R ℓ') → (AlgebraEquiv A B) ≃ (A ≡ B)
AlgebraPath {R = R} = ∫ (𝒮ᴰ-Algebra R) .UARel.ua

uaAlgebra : AlgebraEquiv A B → A ≡ B
uaAlgebra {A = A} {B = B} = equivFun (AlgebraPath A B)

isGroupoidAlgebra : isGroupoid (Algebra R ℓ')
isGroupoidAlgebra _ _ = isOfHLevelRespectEquiv 2 (AlgebraPath _ _) (isSetAlgebraEquiv _ _)

-- the Algebra version of uaCompEquiv
module AlgebraUAFunctoriality where
open AlgebraStr
open AlgebraEquivs

caracAlgebra≡ : (p q : A ≡ B) → cong ⟨_⟩ p ≡ cong ⟨_⟩ q → p ≡ q
caracAlgebra≡ _ _ α =
isEmbedding→Inj (iso→isEmbedding (invIso ΣPathIsoPathΣ)) _ _ $
Σ≡Prop (λ _ → isOfHLevelPathP' 1 (isSetAlgebraStr _) _ _) α

uaCompAlgebraEquiv : (f : AlgebraEquiv A B) (g : AlgebraEquiv B C)
→ uaAlgebra (compAlgebraEquiv f g) ≡ uaAlgebra f ∙ uaAlgebra g
uaCompAlgebraEquiv f g = caracAlgebra≡ _ _ (
cong ⟨_⟩ (uaAlgebra (compAlgebraEquiv f g))
≡⟨ uaCompEquiv _ _ ⟩
cong ⟨_⟩ (uaAlgebra f) ∙ cong ⟨_⟩ (uaAlgebra g)
≡⟨ sym (cong-∙ ⟨_⟩ (uaAlgebra f) (uaAlgebra g)) ⟩
cong ⟨_⟩ (uaAlgebra f ∙ uaAlgebra g) ∎)
5 changes: 5 additions & 0 deletions Cubical/Algebra/CommAlgebra/AsModule.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommAlgebra.AsModule where

open import Cubical.Algebra.CommAlgebra.AsModule.Base public
open import Cubical.Algebra.CommAlgebra.AsModule.Properties public
Loading