Files
agdaproofs/Rings/IntegralDomains.agda
2019-10-13 09:31:54 +01:00

37 lines
2.0 KiB
Agda
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Groups.Groups
open import Groups.Definition
open import Numbers.Naturals.Naturals
open import Orders
open import Setoids.Setoids
open import Functions
open import Rings.Definition
open import Rings.Lemmas
open import Sets.EquivalenceRelations
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Rings.IntegralDomains where
record IntegralDomain {n m : _} {A : Set n} {S : Setoid {n} {m} A} {_+_ : A A A} {_*_ : A A A} (R : Ring S _+_ _*_) : Set (lsuc m n) where
field
intDom : {a b : A} Setoid.__ S (a * b) (Ring.0R R) (Setoid.__ S a (Ring.0R R)) || (Setoid.__ S b (Ring.0R R))
nontrivial : Setoid.__ S (Ring.1R R) (Ring.0R R) False
cancelIntDom : {m n : _} {A : Set m} {S : Setoid {m} {n} A} {_+_ : A A A} {_*_ : A A A} {R : Ring S _+_ _*_} (I : IntegralDomain R) {a b c : A} Setoid.__ S (a * b) (a * c) (Setoid.__ S a (Ring.0R R)) || (Setoid.__ S b c)
cancelIntDom {S = S} {_+_ = _+_} {_*_ = _*_} {R = R} I {a} {b} {c} ab=ac = t4
where
open Setoid S
open Equivalence eq
t1 : (a * b) + Group.inverse (Ring.additiveGroup R) (a * c) Ring.0R R
t1 = transferToRight'' (Ring.additiveGroup R) ab=ac
t2 : a * (b + Group.inverse (Ring.additiveGroup R) c) Ring.0R R
t2 = transitive (transitive (Ring.*DistributesOver+ R) (Group.+WellDefined (Ring.additiveGroup R) reflexive (transferToRight' (Ring.additiveGroup R) (transitive (symmetric (Ring.*DistributesOver+ R)) (transitive (Ring.*WellDefined R reflexive (Group.invLeft (Ring.additiveGroup R))) (Ring.timesZero R)))))) t1
t3 : (a Ring.0R R) || ((b + Group.inverse (Ring.additiveGroup R) c) Ring.0R R)
t3 = IntegralDomain.intDom I t2
t4 : (a Ring.0R R) || (b c)
t4 with t3
... | inl t = inl t
... | inr b = inr (transferToRight (Ring.additiveGroup R) b)