Postulates

A postulate is a declaration of an element of some type without an accompanying definition. With postulates we can introduce elements in a type without actually giving the definition of the element itself.

The general form of a postulate declaration is as follows:

  1. postulate
  2. c11 ... c1i : <Type>
  3. ...
  4. cn1 ... cnj : <Type>

Postulate blocks can include instance and private declarations.

Example for a basic postulate block:

  1. postulate
  2. A B : Set
  3. a : A
  4. b : B
  5. _=AB=_ : A B Set
  6. a==b : a =AB= b

Introducing postulates is in general not recommended. Once postulates are introduced the consistency of the whole development is at risk, because there is nothing that prevents us from introducing an element in the empty set.

  1. data False : Set where
  2. postulate bottom : False

Postulates are forbidden in Safe Agda (option --safe) to prevent accidential inconsistencies.

A preferable way to work with assumptions is to define a module parametrised by the elements we need:

  1. module Absurd (bt : False) where
  2. -- ...
  3. module M (A B : Set) (a : A) (b : B)
  4. (_=AB=_ : A B Set) (a==b : a =AB= b) where
  5. -- ...

Postulated built-ins

Some built-ins such as Float and Char are introduced as a postulate and then given a meaning by the corresponding {-# BUILTIN ... #-} pragma.

Local uses of postulate

Postulates are declarations and can appear in positions where arbitrary declarations are allowed, e.g., in where blocks:

  1. module PostulateInWhere where
  2. my-theorem : (A : Set) A
  3. my-theorem A = I-prove-this-later
  4. where
  5. postulate I-prove-this-later : _