{-# OPTIONS --safe #-}
module Cubical.Algebra.Group.Instances.Int where

open import Cubical.Foundations.Prelude
open import Cubical.Data.Int renaming ( to ℤType ; _+_ to _+ℤ_ ; _-_ to _-ℤ_; -_ to -ℤ_ ; _·_ to _·ℤ_)
open import Cubical.Algebra.Group.Base

open GroupStr

 : Group₀
fst  = ℤType
1g (snd ) = 0
_·_ (snd ) = _+ℤ_
inv (snd ) = _-ℤ_ 0
isGroup (snd ) = isGroupℤ
  where
  abstract
    isGroupℤ : IsGroup (pos 0) _+ℤ_ (_-ℤ_ (pos 0))
    isGroupℤ = makeIsGroup isSetℤ +Assoc  _  refl) (+Comm 0)
                            x  +Comm x (pos 0 -ℤ x)  minusPlus x 0)
                            x  minusPlus x 0)