Documentation

UnitConjecture.EnumDecide

Decision by enumeration #

For a type X that is finite (or more generally, compact), it is possible to automatically decide any statement of the form ∀ x : X, P x by enumeration when P is a decidable predicate on X (i.e., a predicate for the individual propositions P x are decidable for any given x : X).

Overview #

The EnumDecide.decideForall typeclass defines the property of a type being exhaustively checkable.

Results in this file include

def EnumDecide.decideBelow (p : NatProp) [inst : DecidablePred p] (bound : Nat) :
Decidable ((n : Nat) → n < boundp n)

It is possible to check whether a given decidable predicate holds for all natural numbers below a given bound.

Equations
def EnumDecide.decideBelowFin {m : Nat} (p : Fin mProp) [inst : DecidablePred p] (bound : Nat) :
Decidable ((n : Fin m) → n.val < boundp n)
Equations
def EnumDecide.decideFin {m : Nat} (p : Fin mProp) [inst : DecidablePred p] :
Decidable ((n : Fin m) → p n)

It is possible to decide whether a predicate holds for all elements of Fin n.

Equations
class EnumDecide.DecideForall (α : Type u_1) :
Type u_1

A typeclass for "exhaustively verifiable types", i.e., types for which it is possible to decide whether a given (decidable) predicate holds for all its elements.

Instances
    Equations
    • EnumDecide.instDecideForallFin = { decideForall := EnumDecide.decideFin }
    instance EnumDecide.instDecidableForAll {α : Type u_1} [dfa : EnumDecide.DecideForall α] {p : αProp} [inst : DecidablePred p] :
    Decidable ((x : α) → p x)
    Equations
    theorem EnumDecide.Zmod3.assoc (x : Fin 3) (y : Fin 3) (z : Fin 3) :
    x + y + z = x + (y + z)
    instance EnumDecide.decideProd {α : Type u_1} {β : Type u_2} [dfa : EnumDecide.DecideForall α] [dfb : EnumDecide.DecideForall β] (p : α × βProp) [inst : DecidablePred p] :
    Decidable ((xy : α × β) → p xy)
    Equations
    Equations
    • EnumDecide.instDecideForallProd = { decideForall := EnumDecide.decideProd }
    instance EnumDecide.decideUnit (p : UnitProp) [inst : DecidablePred p] :
    Decidable ((x : Unit) → p x)
    Equations
    instance EnumDecide.decideSum {α : Type u_1} {β : Type u_2} [dfa : EnumDecide.DecideForall α] [dfb : EnumDecide.DecideForall β] (p : α βProp) [inst : DecidablePred p] :
    Decidable ((x : α β) → p x)
    Equations
    • One or more equations did not get rendered due to their size.
    Equations
    • EnumDecide.instDecideForallSum = { decideForall := EnumDecide.decideSum }
    instance EnumDecide.funEnum {α : Type u_1} {β : Type u_2} [dfa : EnumDecide.DecideForall α] [dfb : DecidableEq β] :
    DecidableEq (αβ)
    Equations