Skip to content

整域

module integral-domain where

open import apartness-relation
open import bottom-type
open import commutative-ring
open import group
open import integer hiding (zero)
open import ring
open import sigma-type
module IntDomCharacterizations
  (S : ApartedSet)
  (R : CommutativeRingStr S)
  (non-trivial : isNonTrivialCommutativeRingStr S R) where

  open ApartedSet S
  open CommutativeRingStr R
  open RingProperties (S , ring-str)
  open GroupProperties (S , Add.group-str)

  isNonZeroDivisor : X → Complemented
  isNonZeroDivisor x = univ X λ y → x · y ∼ zero ==> y ∼ zero

  isZeroDivisor : X → Set
  isZeroDivisor x = isNonZeroDivisor x .ref

  isZeroDivisorCompl : X → Complemented
  isZeroDivisorCompl x = flipCompl (isNonZeroDivisor x)

  zero-is-zero-divisor : isZeroDivisor zero
  zero-is-zero-divisor = one , zero-absorb-everything one , sym-# non-trivial

  -- TODO: Complemented が no-contra を前提とするようになったら不要になるはず
  no-contra-zero-divisor : ∀ x → isZeroDivisor x → isNonZeroDivisor x .aff → ⊥
  no-contra-zero-divisor x ( y , xy≈0 , y#0 ) f = no-contra y≈0 y#0
    where
      y≈0 : y ≈ zero
      y≈0 = f y .fst xy≈0

  NoNonZeroZeroDivisor : Set
  NoNonZeroZeroDivisor = ∀ x → x # zero → isNonZeroDivisor x .aff

  NoNonZeroZeroDivisor' : Set
  NoNonZeroZeroDivisor' = ∀ x → isZeroDivisorCompl x => x ∼ zero

  thm1 : NoNonZeroZeroDivisor → NoNonZeroZeroDivisor'
  thm1 f x .fst (y , xy≈0 , y#0) = f y y#0 x .fst (trans-≈ comm-· xy≈0)
  thm1 f x .snd = f x

  Cancellation : Set
  Cancellation = ∀ {x y z}
    → x # zero
    → x · y ∼ x · z
    => y ∼ z

  Cancellation' : Set
  Cancellation' = ∀ {x y z}
    → x ≁ zero
    && x · y ∼ x · z
    => y ∼ z

  thm2 : Cancellation → Cancellation'
  thm2 f .fst (x#0 , xy≈xz) = f x#0 .fst xy≈xz
  thm2 f .snd y#z .fst x#0 = f x#0 .snd y#z
  thm2 f {x = x} {y} {z} .snd y#z .snd xy≈xz =
    let k = f {x = y + (- z)} {y = x} {z = zero} ? .fst ? in ?

  thm3 : NoNonZeroZeroDivisor → Cancellation
  thm3 f {x = x} {y} {z} x#0 .fst xy≈xz = ?
    where
      q : (x · y) + (- (x · z)) ≈ zero
      q = ?

      s : (x · (y + (- z))) ≈ zero
      s = ?

      r : y + (- z) ≈ zero
      r = f x x#0 (y + (- z)) .fst s

      p : y ≈ (- (- z))
      p = trans-≈ (move-to-right .fst r) Add.lunit
  thm3 f {x = x} {y} {z} x#0 .snd y#z = let a = f x x#0 (y + (- z)) .snd ? in ?

  thm4 : Cancellation → NoNonZeroZeroDivisor
  thm4 f x x#0 y .fst xy≈0 = f x#0 .fst k
    where
      k : x · y ≈ x · zero
      k = trans-≈ xy≈0 (sym-≈ (trans-≈ comm-· (zero-absorb-everything x)))
  thm4 f x x#0 y .snd y#0 =
    #-resp-≈ᵣ k (trans-≈ comm-· (zero-absorb-everything x))
    where
      k : x · y # x · zero
      k = f x#0 .snd y#0

整域(integral domain)を定義する。

record IntDomStr (S : ApartedSet) : Set where
  open ApartedSet S

  field
    commutative-ring-str : CommutativeRingStr S
    non-trivial : isNonTrivialCommutativeRingStr S commutative-ring-str

  open CommutativeRingStr commutative-ring-str public

  open IntDomCharacterizations S commutative-ring-str non-trivial

  field
    cancel-·ₗ : ∀ {x y z}
      → x # zero
      → x · y ∼ x · z
      => y ∼ z

  cancel-·ᵣ : ∀ {x y z}
    → z # zero
    → x · z ∼ y · z
    => x ∼ y
  cancel-·ᵣ z#0 .fst xz≈yz = cancel-·ₗ z#0 .fst ?
  cancel-·ᵣ z#0 .snd x#z = let k = cancel-·ₗ z#0 .snd x#z in ?

  no-non-zero-divsor : NoNonZeroZeroDivisor
  no-non-zero-divsor = thm4 cancel-·ₗ
IntDom : Set₁
IntDom = Σ ApartedSet IntDomStr
IntDomStrℤ : IntDomStr ApartedSetℤ
IntDomStrℤ = record
  { commutative-ring-str = {! !}
  ; non-trivial = {! !}
  ; cancel-·ₗ = {! !}
  }

IntDomℤ : IntDom
IntDomℤ = ApartedSetℤ , IntDomStrℤ