Skip to content
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

Pointwise ring and algebra structure #667

Merged
merged 4 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
26 changes: 26 additions & 0 deletions Cubical/Algebra/CommAlgebra/Instances/Pointwise.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommAlgebra.Instances.Pointwise where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels

open import Cubical.Algebra.CommRing.Base
open import Cubical.Algebra.CommRing.Instances.Pointwise
open import Cubical.Algebra.CommAlgebra.Base

private
variable
ℓ : Level

pointwiseAlgebra : {R : CommRing ℓ} (X : Type ℓ) (A : CommAlgebra R ℓ) → CommAlgebra R ℓ
pointwiseAlgebra {R = R} X A =
let open CommAlgebraStr (snd A)
isSetX→A = isOfHLevelΠ 2 (λ (x : X) → isSetCommRing (CommAlgebra→CommRing A))
in commAlgebraFromCommRing
(pointwiseRing X (CommAlgebra→CommRing A))
(λ r f → (λ x → r ⋆ (f x)))
(λ r s f i x → ⋆-assoc r s (f x) i)
(λ r s f i x → ⋆-ldist r s (f x) i)
(λ r f g i x → ⋆-rdist r (f x) (g x) i)
(λ f i x → ⋆-lid (f x) i)
λ r f g i x → ⋆-lassoc r (f x) (g x) i
32 changes: 32 additions & 0 deletions Cubical/Algebra/CommRing/Instances/Pointwise.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Instances.Pointwise where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels

open import Cubical.Algebra.CommRing.Base

private
variable
ℓ : Level

pointwiseRing : (X : Type ℓ) (R : CommRing ℓ) → CommRing ℓ
pointwiseRing X R =
let open CommRingStr (snd R)
isSetX→R = isOfHLevelΠ 2 (λ _ → isSetCommRing R)
in (X → fst R) ,
(commringstr
felixwellen marked this conversation as resolved.
Show resolved Hide resolved
(λ _ → 0r) (λ _ → 1r)
(λ f g → (λ x → f x + g x))
(λ f g → (λ x → f x · g x))
(λ f → (λ x → - f x))
(makeIsCommRing
isSetX→R
(λ f g h i x → +Assoc (f x) (g x) (h x) i)
(λ f i x → +Rid (f x) i)
(λ f i x → +Rinv (f x) i)
(λ f g i x → +Comm (f x) (g x) i)
(λ f g h i x → ·Assoc (f x) (g x) (h x) i)
(λ f i x → ·Rid (f x) i)
(λ f g h i x → ·Rdist+ (f x) (g x) (h x) i)
λ f g i x → ·-comm (f x) (g x) i))