MFPS2026-Agda
Base
Initializing search
    pdmosses/mfps2026-agda
    • About
    • Notation
    • Examples
    • Properties
    • Tests
    • Library
    pdmosses/mfps2026-agda
    • About
      • Background
      • Meta-notation
    • Notation
    • Examples
      • LC
        • Abstract-Syntax
        • Domain-Equations
        • Semantic-Functions
      • PCF
        • Abstract-Syntax
        • Domain-Equations
        • Semantic-Functions
      • Scm
        • Abstract-Syntax
        • Auxiliary-Functions
        • Domain-Equations
        • Semantic-Functions
    • Properties
    • Tests
      • LC
      • PCF
      • Scm
    • Library
          • Bool
          • Char
          • Equality
            • Rewrite
          • Int
          • List
          • Maybe
          • Nat
          • Sigma
          • String
          • Unit
        • Primitive
          • Raw
        • Core
          • RawMagma
          • Base
          • Base
        • Empty
          • Polymorphic
          • Base
          • Base
        • Irrelevant
          • Base
            • Base
                • Core
                • Base
          • Base
          • Base
          • Base
          • Base
          • Base
          • Base
          • Base
          • Base
          • Base
            • Base
          • Base
        • Base
        • Bundles
        • Consequences
          • Propositional
          • Setoid
        • Definitions
        • Structures
      • Level
          • Bundles
            • Raw
          • Consequences
              • Reflexive
            • Composition
              • Core
          • Core
          • Definitions
              • Core
            • Setoid
            • Core
            • Properties
            • Syntax
          • Structures
        • Nullary
          • Decidable
            • Core
          • Irrelevant
            • Core
          • Recomputable
            • Core
          • Reflects
        • Unary
          • Properties
    1. Library
    2. Data
    3. Sign

    Base

    ------------------------------------------------------------------------
    -- The Agda standard library
    --
    -- Signs
    ------------------------------------------------------------------------
    
    {-# OPTIONS --cubical-compatible --safe #-}
    
    module Data.Sign.Base where
    
    open import Algebra.Bundles.Raw using (RawMagma; RawMonoid; RawGroup)
    open import Level using (0ℓ)
    open import Relation.Binary.PropositionalEquality.Core using (_≡_)
    
    ------------------------------------------------------------------------
    -- Definition
    
    data Sign : Set where
      - : Sign
      + : Sign
    
    ------------------------------------------------------------------------
    -- Operations
    
    -- The opposite sign.
    
    opposite : Sign → Sign
    opposite - = +
    opposite + = -
    
    -- "Multiplication".
    
    infixl 7 _*_
    
    _*_ : Sign → Sign → Sign
    + * s₂ = s₂
    - * s₂ = opposite s₂
    
    ------------------------------------------------------------------------
    -- Raw Bundles
    
    *-rawMagma : RawMagma 0ℓ 0ℓ
    *-rawMagma = record
      { _≈_ = _≡_
      ; _∙_ = _*_
      }
    
    *-1-rawMonoid : RawMonoid 0ℓ 0ℓ
    *-1-rawMonoid = record
      { _≈_ = _≡_
      ; _∙_ = _*_
      ; ε = +
      }
    
    *-1-rawGroup : RawGroup 0ℓ 0ℓ
    *-1-rawGroup = record
      { _≈_ = _≡_
      ; _∙_ = _*_
      ; _⁻¹ = opposite
      ; ε = +
      }
    
    
    Previous
    Base
    Next
    Base
    Made with Material for MkDocs