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

Composition of left module homomorphisms #1176

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
49 changes: 49 additions & 0 deletions Cubical/Algebra/Module/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Cubical.Algebra.Module.Properties where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Structure
open import Cubical.Foundations.Function using (idfun; _∘_)

open import Cubical.Algebra.Module.Base
open import Cubical.Algebra.Ring
Expand Down Expand Up @@ -43,3 +44,51 @@ module ModuleTheory (R : Ring ℓ') (M : LeftModule R ℓ) where
(R.1r R.+ (R.- R.1r)) ⋆ x ≡⟨ congL _⋆_ (R.+InvR R.1r) ⟩
R.0r ⋆ x ≡⟨ ⋆AnnihilL x ⟩
0m ∎)

module _ {R : Ring ℓ'} (M : LeftModule R ℓ) where
idLeftModuleHom : LeftModuleHom M M
idLeftModuleHom = (idfun ⟨ M ⟩) , isLeftModuleHom where
open IsLeftModuleHom
isLeftModuleHom : IsLeftModuleHom (M .snd) (idfun ⟨ M ⟩) (M .snd)
isLeftModuleHom .pres0 = refl
isLeftModuleHom .pres+ x y = refl
isLeftModuleHom .pres- x = refl
isLeftModuleHom .pres⋆ r y = refl

module _ {R : Ring ℓ'} {M N P : LeftModule R ℓ} where
-- Composition of left module homomorphisms
compLeftModuleHom : LeftModuleHom M N → LeftModuleHom N P → LeftModuleHom M P
compLeftModuleHom f g =
fg , record { pres0 = pres0 ; pres+ = pres+ ; pres- = pres- ; pres⋆ = pres⋆ } where
open LeftModuleStr (M .snd) using () renaming (0m to 0M; _+_ to _+M_; -_ to -M_; _⋆_ to _⋆M_)
open LeftModuleStr (N .snd) using () renaming (0m to 0N; _+_ to _+N_; -_ to -N_; _⋆_ to _⋆N_)
open LeftModuleStr (P .snd) using () renaming (0m to 0P; _+_ to _+P_; -_ to -P_; _⋆_ to _⋆P_)

fg = g .fst ∘ f .fst

pres0 : fg 0M ≡ 0P
pres0 = cong (g .fst) (f .snd .IsLeftModuleHom.pres0) ∙ g .snd .IsLeftModuleHom.pres0

pres+ : (x y : M .fst) → fg (x +M y) ≡ fg x +P fg y
-- g(f(x+y)) ≡ g(f(x)+f(y)) ≡ g(f(x))+g(f(y))
pres+ x y =
let p = refl {x = g .fst (f .fst (x +M y))} in
let p = p ∙ cong (g .fst) (f .snd .IsLeftModuleHom.pres+ x y) in
let p = p ∙ g .snd .IsLeftModuleHom.pres+ (f .fst x) (f .fst y) in
p

pres- : (x : M .fst) → fg (-M x) ≡ -P (fg x)
-- g(f(-x)) ≡ g(-f(x)) ≡ -g(f(x))
pres- x =
let p = refl {x = g .fst (f .fst (-M x))} in
let p = p ∙ cong (g .fst) (f .snd .IsLeftModuleHom.pres- x) in
let p = p ∙ g .snd .IsLeftModuleHom.pres- (f .fst x) in
p

pres⋆ : (r : ⟨ R ⟩) (y : M .fst) → fg (r ⋆M y) ≡ r ⋆P fg y
-- g(f(r⋆y)) ≡ g(r⋆f(y)) ≡ r⋆g(f(y))
pres⋆ r y =
let p = refl {x = g .fst (f .fst (r ⋆M y))} in
let p = p ∙ cong (g .fst) (f .snd .IsLeftModuleHom.pres⋆ r y) in
let p = p ∙ g .snd .IsLeftModuleHom.pres⋆ r (f .fst y) in
p