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
EnumDecide.decideFin- the typeFin n(the canonical finite set withnelements) is checkable for anyn : ℕ.EnumDecide.decideUnit- the single-element type is exhaustively checkable.EnumDecide.decideProd,EnumDecide.decideSum- the product and direct sum of two exhaustively checkable types.EnumDecide.funEnum- the type of functions from an exhaustively checkable type to a type with decidable equality is exhaustively checkable.
It is possible to check whether a given decidable predicate holds for all natural numbers below a given bound.
Equations
- LeanPool.Polylean.EnumDecide.decideBelow p 0 = isTrue ⋯
- LeanPool.Polylean.EnumDecide.decideBelow p k.succ = match LeanPool.Polylean.EnumDecide.decideBelow p k with | isTrue hyp => if c : p k then isTrue ⋯ else isFalse ⋯ | isFalse hyp => isFalse ⋯
Instances For
It is possible to check whether a decidable predicate on Fin m holds below a
given natural-number bound.
Equations
- One or more equations did not get rendered due to their size.
- LeanPool.Polylean.EnumDecide.decideBelowFin p 0 = isTrue ⋯
Instances For
It is possible to decide whether a predicate holds for all elements of Fin n.
Equations
- LeanPool.Polylean.EnumDecide.decideFin p = match LeanPool.Polylean.EnumDecide.decideBelowFin p m with | isTrue hyp => isTrue ⋯ | isFalse hyp => isFalse ⋯
Instances For
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.
Decide whether a decidable predicate holds for all elements.
Instances
Equations
Equations
Equations
Equations
Equations
- LeanPool.Polylean.EnumDecide.funEnum f g = if c : ∀ (x : α), f x = g x then isTrue ⋯ else isFalse ⋯