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

Quotient by sum of ideals #950

Merged
merged 26 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3418daf
move and split ideal (Ring)
felixwellen Oct 7, 2022
54a137c
surjective image of an ideal is an ideal
felixwellen Oct 13, 2022
018cde6
reorganize Ideals in CommRings
felixwellen Oct 14, 2022
a60a633
rename CommRing.QuotientRing to CommRing.Quotient, create subfolder f…
felixwellen Oct 14, 2022
2664318
surjective image ideal for CommRings
felixwellen Oct 14, 2022
166ca0c
fix renaming, expose quotientHom as surjection
felixwellen Oct 14, 2022
5a91c19
ideal helper
felixwellen Oct 26, 2022
ed2b648
lemma on surjections, refactor
felixwellen Oct 28, 2022
c1b72a1
CommIdeals are closed under -
felixwellen Nov 2, 2022
e7e6faa
new test cases for the solver
felixwellen Nov 2, 2022
6adf0ab
composition of surjections
felixwellen Nov 2, 2022
d531dbc
describe fiber of ring-hom with kernel
felixwellen Nov 2, 2022
bceb204
wrap universal property of quotients for CommRings
felixwellen Oct 28, 2022
df5a35c
add flag for faster checking
felixwellen Nov 2, 2022
6fe5e9d
show isomorphism theorem on iterated quotients
felixwellen Nov 2, 2022
e94733f
export
felixwellen Nov 3, 2022
c392fac
improve comment
felixwellen Nov 3, 2022
1aaf600
fix...
felixwellen Nov 3, 2022
3b125c5
Update Cubical/Functions/Surjection.agda
felixwellen Nov 4, 2022
4abaf6a
remove unneccessary lossy unification
felixwellen Nov 4, 2022
4450cfb
Merge remote-tracking branch 'my-fork/quotient_ideal_sum' into quotie…
felixwellen Nov 4, 2022
e2916a4
introduce images of subsets
felixwellen Nov 4, 2022
bbc8c59
use images of subsets
felixwellen Nov 4, 2022
224db2a
specialize 'open'
felixwellen Nov 7, 2022
b25a05d
organize imports, simplify rightFactorSurjective, use simplified
felixwellen Nov 7, 2022
fc3cc7d
fix refactoring bug
felixwellen Nov 7, 2022
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
4 changes: 2 additions & 2 deletions Cubical/Algebra/CommAlgebra/QuotientAlgebra.agda
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ open import Cubical.Data.Unit
open import Cubical.Data.Sigma.Properties using (Σ≡Prop)

open import Cubical.Algebra.CommRing
import Cubical.Algebra.CommRing.QuotientRing as CommRing
import Cubical.Algebra.Ring.QuotientRing as Ring
import Cubical.Algebra.CommRing.Quotient as CommRing
import Cubical.Algebra.Ring.Quotient as Ring
open import Cubical.Algebra.CommRing.Ideal hiding (IdealsIn)
open import Cubical.Algebra.CommAlgebra
open import Cubical.Algebra.CommAlgebra.Ideal
Expand Down
6 changes: 4 additions & 2 deletions Cubical/Algebra/CommRing/FGIdeal.agda
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ open import Cubical.Algebra.Ring
open import Cubical.Algebra.Ring.BigOps
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.CommRing.Ideal
open import Cubical.Algebra.CommRing.Ideal.Sum
open import Cubical.Algebra.CommRing.BinomialThm
open import Cubical.Algebra.Ring.QuotientRing
open import Cubical.Algebra.Ring.Quotient
open import Cubical.Algebra.Ring.Properties
open import Cubical.Algebra.Ring.BigOps
open import Cubical.Tactics.CommRingSolver.Reflection
open import Cubical.Algebra.Matrix
open import Cubical.Tactics.CommRingSolver.Reflection

private
variable
Expand Down Expand Up @@ -203,6 +204,7 @@ module _ (R' : CommRing ℓ) where
open CommIdeal R'
open Sum (CommRing→Ring R')
open KroneckerDelta (CommRing→Ring R')
open IdealSum R'
private
R = fst R'
⟨_⟩ : {n : ℕ} → FinVec R n → CommIdeal
Expand Down
342 changes: 1 addition & 341 deletions Cubical/Algebra/CommRing/Ideal.agda

Large diffs are not rendered by default.

147 changes: 147 additions & 0 deletions Cubical/Algebra/CommRing/Ideal/Base.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{-
This is mostly for convenience, when working with ideals
(which are defined for general rings) in a commutative ring.
-}
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Ideal.Base where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Powerset renaming ( _∈_ to _∈p_ ; _⊆_ to _⊆p_
; subst-∈ to subst-∈p )

open import Cubical.Functions.Logic

open import Cubical.Data.Nat using (ℕ ; zero ; suc ; tt)
renaming ( --zero to ℕzero ; suc to ℕsuc
_+_ to _+ℕ_ ; _·_ to _·ℕ_
; +-assoc to +ℕ-assoc ; +-comm to +ℕ-comm
; ·-assoc to ·ℕ-assoc ; ·-comm to ·ℕ-comm)

open import Cubical.Data.FinData hiding (rec ; elim)
open import Cubical.Data.Sigma

open import Cubical.HITs.PropositionalTruncation

open import Cubical.Algebra.CommRing
open import Cubical.Algebra.Ring
open import Cubical.Algebra.Ring.Ideal renaming (IdealsIn to IdealsInRing)
open import Cubical.Algebra.Ring.BigOps
open import Cubical.Tactics.CommRingSolver.Reflection

private
variable
ℓ : Level

module CommIdeal (R' : CommRing ℓ) where
private R = fst R'
open CommRingStr (snd R')
open Sum (CommRing→Ring R')
open CommRingTheory R'
open RingTheory (CommRing→Ring R')

record isCommIdeal (I : ℙ R) : Type ℓ where
constructor
makeIsCommIdeal
field
+Closed : ∀ {x y : R} → x ∈p I → y ∈p I → (x + y) ∈p I
contains0 : 0r ∈p I
·Closed : ∀ {x : R} (r : R) → x ∈p I → r · x ∈p I

·RClosed : ∀ {x : R} (r : R) → x ∈p I → x · r ∈p I
·RClosed r x∈pI = subst-∈p I (·Comm _ _) (·Closed r x∈pI)

open isCommIdeal
isPropIsCommIdeal : (I : ℙ R) → isProp (isCommIdeal I)
+Closed (isPropIsCommIdeal I ici₁ ici₂ i) x∈pI y∈pI =
I _ .snd (ici₁ .+Closed x∈pI y∈pI) (ici₂ .+Closed x∈pI y∈pI) i
contains0 (isPropIsCommIdeal I ici₁ ici₂ i) = I 0r .snd (ici₁ .contains0) (ici₂ .contains0) i
·Closed (isPropIsCommIdeal I ici₁ ici₂ i) r x∈pI =
I _ .snd (ici₁ .·Closed r x∈pI) (ici₂ .·Closed r x∈pI) i

CommIdeal : Type (ℓ-suc ℓ)
CommIdeal = Σ[ I ∈ ℙ R ] isCommIdeal I

isSetCommIdeal : isSet CommIdeal
isSetCommIdeal = isSetΣSndProp isSetℙ isPropIsCommIdeal

--inclusion and containment of ideals
_⊆_ : CommIdeal → CommIdeal → Type ℓ
I ⊆ J = I .fst ⊆p J .fst

infix 5 _∈_
_∈_ : R → CommIdeal → Type ℓ
x ∈ I = x ∈p I .fst

subst-∈ : (I : CommIdeal) {x y : R} → x ≡ y → x ∈ I → y ∈ I
subst-∈ I = subst-∈p (I .fst)

CommIdeal≡Char : {I J : CommIdeal} → I ⊆ J → J ⊆ I → I ≡ J
CommIdeal≡Char I⊆J J⊆I = Σ≡Prop isPropIsCommIdeal (⊆-extensionality _ _ (I⊆J , J⊆I))

-Closed : (I : CommIdeal) (x : R)
→ x ∈ I → (- x) ∈ I
-Closed I x x∈I = subst (_∈ I) (useSolver x) (·Closed (snd I) (- 1r) x∈I)
where useSolver : (x : R) → - 1r · x ≡ - x
useSolver = solve R'

∑Closed : (I : CommIdeal) {n : ℕ} (V : FinVec R n)
→ (∀ i → V i ∈ I) → ∑ V ∈ I
∑Closed I {n = zero} _ _ = I .snd .contains0
∑Closed I {n = suc n} V h = I .snd .+Closed (h zero) (∑Closed I (V ∘ suc) (h ∘ suc))

0Ideal : CommIdeal
fst 0Ideal x = (x ≡ 0r) , is-set _ _
+Closed (snd 0Ideal) x≡0 y≡0 = cong₂ (_+_) x≡0 y≡0 ∙ +IdR _
contains0 (snd 0Ideal) = refl
·Closed (snd 0Ideal) r x≡0 = cong (r ·_) x≡0 ∙ 0RightAnnihilates _

1Ideal : CommIdeal
fst 1Ideal x = ⊤
+Closed (snd 1Ideal) _ _ = lift tt
contains0 (snd 1Ideal) = lift tt
·Closed (snd 1Ideal) _ _ = lift tt

contains1Is1 : (I : CommIdeal) → 1r ∈ I → I ≡ 1Ideal
contains1Is1 I 1∈I = CommIdeal≡Char (λ _ _ → lift tt)
λ x _ → subst-∈ I (·IdR _) (I .snd .·Closed x 1∈I) -- x≡x·1 ∈ I

IdealsIn : (R : CommRing ℓ) → Type _
IdealsIn R = CommIdeal.CommIdeal R

module _ {R : CommRing ℓ} where
open CommRingStr (snd R)
open isIdeal
open CommIdeal R
open isCommIdeal
makeIdeal : (I : fst R → hProp ℓ)
→ (+-closed : {x y : fst R} → x ∈p I → y ∈p I → (x + y) ∈p I)
→ (0r-closed : 0r ∈p I)
→ (·-closedLeft : {x : fst R} → (r : fst R) → x ∈p I → r · x ∈p I)
→ IdealsIn R
fst (makeIdeal I +-closed 0r-closed ·-closedLeft) = I
+Closed (snd (makeIdeal I +-closed 0r-closed ·-closedLeft)) = +-closed
contains0 (snd (makeIdeal I +-closed 0r-closed ·-closedLeft)) = 0r-closed
·Closed (snd (makeIdeal I +-closed 0r-closed ·-closedLeft)) = ·-closedLeft


CommIdeal→Ideal : IdealsIn R → IdealsInRing (CommRing→Ring R)
fst (CommIdeal→Ideal I) = fst I
+-closed (snd (CommIdeal→Ideal I)) = +Closed (snd I)
-closed (snd (CommIdeal→Ideal I)) = λ x∈pI → subst-∈p (fst I) (useSolver _)
(·Closed (snd I) (- 1r) x∈pI)
where useSolver : (x : fst R) → - 1r · x ≡ - x
useSolver = solve R
0r-closed (snd (CommIdeal→Ideal I)) = contains0 (snd I)
·-closedLeft (snd (CommIdeal→Ideal I)) = ·Closed (snd I)
·-closedRight (snd (CommIdeal→Ideal I)) = λ r x∈pI →
subst-∈p (fst I)
(·Comm r _)
(·Closed (snd I) r x∈pI)

Ideal→CommIdeal : IdealsInRing (CommRing→Ring R) → IdealsIn R
fst (Ideal→CommIdeal I) = fst I
+Closed (snd (Ideal→CommIdeal I)) = +-closed (snd I)
contains0 (snd (Ideal→CommIdeal I)) = 0r-closed (snd I)
·Closed (snd (Ideal→CommIdeal I)) = ·-closedLeft (snd I)
Loading