{-# OPTIONS --without-K --safe #-}

open import Categories.Category using (Category)

-- Defines the following properties of a Category:
-- Cartesian -- a Cartesian category is a category with all products

--  (for the induced Monoidal structure, see Cartesian.Monoidal)

module Categories.Category.Cartesian {o ā„“ e} (š’ž : Category o ā„“ e) where

open import Level using (levelOfTerm)
open import Data.Nat using (ā„•; zero; suc)

open Category š’ž
open HomReasoning

open import Categories.Category.BinaryProducts š’ž using (BinaryProducts; module BinaryProducts)
open import Categories.Object.Terminal š’ž using (Terminal)

private
  variable
    A B C D W X Y Z : Obj
    f fā€² g gā€² h i : A ā‡’ B

-- Cartesian monoidal category
record Cartesian : Set (levelOfTerm š’ž) where
  field
    terminal : Terminal
    products : BinaryProducts
  open BinaryProducts products using (_Ɨ_)

  power : Obj ā†’ ā„• ā†’ Obj
  power A 0 = Terminal.āŠ¤ terminal
  power A 1 = A
  power A (suc (suc n)) = A Ɨ power A (suc n)