decidable
本頁內容尚未翻譯。
decToBoolYes
Section titled “decToBoolYes”theorem decToBoolYes {P : Type} (p : P) : decToBool (yes p) = trueA positive decision yes p converts to the boolean true.
decToBoolNo
Section titled “decToBoolNo”theorem decToBoolNo {P : Type} (f : P -> Empty) : decToBool (no f) = falseA negative decision no f converts to the boolean false.
decMap
Section titled “decMap”def decMap {P Q : Type} (f : P -> Q) (g : Q -> P) (d : Dec P) : Dec QTransports a decision for P to a decision for Q along maps in both directions.
decMapYes
Section titled “decMapYes”theorem decMapYes {P Q : Type} (f : P -> Q) (g : Q -> P) (p : P) : decMap f g (yes p) = yes (f p)Mapping a positive decision gives yes of the mapped witness.
decMapNo
Section titled “decMapNo”theorem decMapNo {P Q : Type} (f : P -> Q) (g : Q -> P) (np : P -> Empty) : decMap f g (no np) = no (fun (q : Q) => np (g q))Mapping a negative decision gives no with the refutation precomposed by the backward map.
decNot
Section titled “decNot”def decNot {P : Type} (d : Dec P) : Dec (P -> Empty)Decides the negation of P from a decision for P.
decAnd
Section titled “decAnd”def decAnd {P Q : Type} (dp : Dec P) (dq : Dec Q) : Dec (P × Q)Decides the conjunction (product) of two decidable propositions.
def decOr {P Q : Type} (dp : Dec P) (dq : Dec Q) : Dec (Either P Q)Decides the disjunction (Either) of two decidable propositions, preferring the left one.
decImpl
Section titled “decImpl”def decImpl {P Q : Type} (dp : Dec P) (dq : Dec Q) : Dec (P -> Q)Decides the implication P -> Q from decisions for P and Q.
decEquiv
Section titled “decEquiv”def decEquiv {P Q : Type} (f : P -> Q) (g : Q -> P) (d : Dec P) : Dec QTransports a decision across a logical equivalence given by maps both ways; an alias of decMap.
decRefl
Section titled “decRefl”def decRefl {A : Type} (a : A) : Dec (a = a)Decides a = a positively by reflexivity.
decUnit
Section titled “decUnit”def decUnit : Dec UnitThe decision that Unit holds.
decEmpty
Section titled “decEmpty”def decEmpty : Dec EmptyThe decision that Empty does not hold.
decNotYes
Section titled “decNotYes”theorem decNotYes {P : Type} (p : P) : decToBool (decNot (yes p)) = falseNegating a positive decision yields boolean false.
decNotNo
Section titled “decNotNo”theorem decNotNo {P : Type} (np : P -> Empty) : decToBool (decNot (no np)) = trueNegating a negative decision yields boolean true.
decNotNot
Section titled “decNotNot”theorem decNotNot {P : Type} (d : Dec P) : decToBool (decNot (decNot d)) = decToBool dDouble negation of a decision has the same boolean value as the original.
decAndYesYes
Section titled “decAndYesYes”theorem decAndYesYes {P Q : Type} (p : P) (q : Q) : decToBool (decAnd (yes p) (yes q)) = trueThe conjunction of two positive decisions is true.
decAndYesNo
Section titled “decAndYesNo”theorem decAndYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decToBool (decAnd (yes p) (no nq)) = falseThe conjunction of a positive and a negative decision is false.
decAndNoYes
Section titled “decAndNoYes”theorem decAndNoYes {P Q : Type} (np : P -> Empty) (q : Q) : decToBool (decAnd (no np) (yes q)) = falseThe conjunction of a negative and a positive decision is false.
decAndNoNo
Section titled “decAndNoNo”theorem decAndNoNo {P Q : Type} (np : P -> Empty) (nq : Q -> Empty) : decToBool (decAnd (no np) (no nq)) = falseThe conjunction of two negative decisions is false.
decAndBool
Section titled “decAndBool”theorem decAndBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decAnd dp dq) = and (decToBool dp) (decToBool dq)The boolean value of decAnd is the boolean and of the two decisions’ values.
decOrYesYes
Section titled “decOrYesYes”theorem decOrYesYes {P Q : Type} (p : P) (q : Q) : decToBool (decOr (yes p) (yes q)) = trueThe disjunction of two positive decisions is true.
decOrYesNo
Section titled “decOrYesNo”theorem decOrYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decToBool (decOr (yes p) (no nq)) = trueThe disjunction of a positive and a negative decision is true.
decOrNoYes
Section titled “decOrNoYes”theorem decOrNoYes {P Q : Type} (np : P -> Empty) (q : Q) : decToBool (decOr (no np) (yes q)) = trueThe disjunction of a negative and a positive decision is true.
decOrNoNo
Section titled “decOrNoNo”theorem decOrNoNo {P Q : Type} (np : P -> Empty) (nq : Q -> Empty) : decToBool (decOr (no np) (no nq)) = falseThe disjunction of two negative decisions is false.
decOrBool
Section titled “decOrBool”theorem decOrBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decOr dp dq) = or (decToBool dp) (decToBool dq)The boolean value of decOr is the boolean or of the two decisions’ values.
decImplNoAny
Section titled “decImplNoAny”theorem decImplNoAny {P Q : Type} (np : P -> Empty) (dq : Dec Q) : decToBool (decImpl (no np) dq) = trueAn implication with a refuted premise is decided true, whatever the conclusion.
decImplYesYes
Section titled “decImplYesYes”theorem decImplYesYes {P Q : Type} (p : P) (q : Q) : decToBool (decImpl (yes p) (yes q)) = trueAn implication between two positive decisions is true.
decImplYesNo
Section titled “decImplYesNo”theorem decImplYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decToBool (decImpl (yes p) (no nq)) = falseAn implication from a positive to a negative decision is false.
decEquivYes
Section titled “decEquivYes”theorem decEquivYes {P Q : Type} (f : P -> Q) (g : Q -> P) (p : P) : decToBool (decEquiv f g (yes p)) = trueTransporting a positive decision with decEquiv stays true.
decEquivNo
Section titled “decEquivNo”theorem decEquivNo {P Q : Type} (f : P -> Q) (g : Q -> P) (np : P -> Empty) : decToBool (decEquiv f g (no np)) = falseTransporting a negative decision with decEquiv stays false.
decReflBool
Section titled “decReflBool”theorem decReflBool {A : Type} (a : A) : decToBool (decRefl a) = trueThe reflexivity decision decRefl a is true.
decAndDecNotYes
Section titled “decAndDecNotYes”theorem decAndDecNotYes {P : Type} (p : P) : decToBool (decAnd (yes p) (decNot (yes p))) = falseA positive decision conjoined with its own negation is false.
decAndDecNotNo
Section titled “decAndDecNotNo”theorem decAndDecNotNo {P : Type} (np : P -> Empty) : decToBool (decAnd (no np) (decNot (no np))) = falseA negative decision conjoined with its own negation is false.
decOrDecNotYes
Section titled “decOrDecNotYes”theorem decOrDecNotYes {P : Type} (p : P) : decToBool (decOr (yes p) (decNot (yes p))) = trueA positive decision disjoined with its own negation is true.
decOrDecNotNo
Section titled “decOrDecNotNo”theorem decOrDecNotNo {P : Type} (np : P -> Empty) : decToBool (decOr (no np) (decNot (no np))) = trueA negative decision disjoined with its own negation is true.
decExcludedMiddle
Section titled “decExcludedMiddle”theorem decExcludedMiddle {P : Type} (d : Dec P) : decToBool (decOr d (decNot d)) = trueExcluded middle for decisions: a decision or its negation is always true.
decAndCommBool
Section titled “decAndCommBool”theorem decAndCommBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decAnd dp dq) = decToBool (decAnd dq dp)Conjunction of decisions is commutative at the boolean level.
decOrCommBool
Section titled “decOrCommBool”theorem decOrCommBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decOr dp dq) = decToBool (decOr dq dp)Disjunction of decisions is commutative at the boolean level.
decContra
Section titled “decContra”def decContra {P : Type} (d : Dec P) : Dec (P -> Empty)Decides the negation of P (contrapositive form); the same as decNot.
def decId {P : Type} (d : Dec P) : Dec PThe identity on decisions.
decConstYes
Section titled “decConstYes”def decConstYes {P : Type} (p : P) : Dec PThe constant positive decision built from a witness.
decConstNo
Section titled “decConstNo”def decConstNo {P : Type} (np : P -> Empty) : Dec PThe constant negative decision built from a refutation.
decAndAssocBool
Section titled “decAndAssocBool”theorem decAndAssocBool {P Q R : Type} (dp : Dec P) (dq : Dec Q) (dr : Dec R) : decToBool (decAnd (decAnd dp dq) dr) = decToBool (decAnd dp (decAnd dq dr))Conjunction of decisions is associative at the boolean level.
decOrAssocBool
Section titled “decOrAssocBool”theorem decOrAssocBool {P Q R : Type} (dp : Dec P) (dq : Dec Q) (dr : Dec R) : decToBool (decOr (decOr dp dq) dr) = decToBool (decOr dp (decOr dq dr))Disjunction of decisions is associative at the boolean level.
decAndUnitL
Section titled “decAndUnitL”theorem decAndUnitL {P : Type} (d : Dec P) : decToBool (decAnd decUnit d) = decToBool ddecUnit is a left unit for decAnd at the boolean level.
decAndUnitR
Section titled “decAndUnitR”theorem decAndUnitR {P : Type} (d : Dec P) : decToBool (decAnd d decUnit) = decToBool ddecUnit is a right unit for decAnd at the boolean level.
decOrEmptyL
Section titled “decOrEmptyL”theorem decOrEmptyL {P : Type} (d : Dec P) : decToBool (decOr decEmpty d) = decToBool ddecEmpty is a left unit for decOr at the boolean level.
decOrEmptyR
Section titled “decOrEmptyR”theorem decOrEmptyR {P : Type} (d : Dec P) : decToBool (decOr d decEmpty) = decToBool ddecEmpty is a right unit for decOr at the boolean level.
decAndEmptyL
Section titled “decAndEmptyL”theorem decAndEmptyL {P : Type} (d : Dec P) : decToBool (decAnd decEmpty d) = falsedecEmpty annihilates decAnd on the left: the result is false.
decOrUnitL
Section titled “decOrUnitL”theorem decOrUnitL {P : Type} (d : Dec P) : decToBool (decOr decUnit d) = truedecUnit annihilates decOr on the left: the result is true.
decDeMorganAndBool
Section titled “decDeMorganAndBool”theorem decDeMorganAndBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decNot (decAnd dp dq)) = or (decToBool (decNot dp)) (decToBool (decNot dq))De Morgan at the boolean level: the negation of a conjunction is the disjunction of the negations.
decDeMorganOrBool
Section titled “decDeMorganOrBool”theorem decDeMorganOrBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decNot (decOr dp dq)) = and (decToBool (decNot dp)) (decToBool (decNot dq))De Morgan at the boolean level: the negation of a disjunction is the conjunction of the negations.
decIdBool
Section titled “decIdBool”theorem decIdBool {P : Type} (d : Dec P) : decToBool (decId d) = decToBool ddecId leaves the boolean value of a decision unchanged.
decContraBool
Section titled “decContraBool”theorem decContraBool {P : Type} (d : Dec P) : decToBool (decContra d) = decToBool (decNot d)decContra has the same boolean value as decNot.
decConstYesBool
Section titled “decConstYesBool”theorem decConstYesBool {P : Type} (p : P) : decToBool (decConstYes p) = truedecConstYes is always true.
decConstNoBool
Section titled “decConstNoBool”theorem decConstNoBool {P : Type} (np : P -> Empty) : decToBool (decConstNo np) = falsedecConstNo is always false.
decAndOrDistribBool
Section titled “decAndOrDistribBool”theorem decAndOrDistribBool {P Q R : Type} (dp : Dec P) (dq : Dec Q) (dr : Dec R) : decToBool (decAnd dp (decOr dq dr)) = or (decToBool (decAnd dp dq)) (decToBool (decAnd dp dr))Conjunction distributes over disjunction of decisions at the boolean level.
decAndIdempotent
Section titled “decAndIdempotent”theorem decAndIdempotent {P : Type} (d : Dec P) : decToBool (decAnd d d) = decToBool dConjunction of a decision with itself has the same boolean value as the decision.
decOrIdempotent
Section titled “decOrIdempotent”theorem decOrIdempotent {P : Type} (d : Dec P) : decToBool (decOr d d) = decToBool dDisjunction of a decision with itself has the same boolean value as the decision.
decAndAbsorb
Section titled “decAndAbsorb”theorem decAndAbsorb {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decAnd dp (decOr dp dq)) = decToBool dpAbsorption: dp conjoined with dp or dq has the boolean value of dp.
decOrAbsorb
Section titled “decOrAbsorb”theorem decOrAbsorb {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decOr dp (decAnd dp dq)) = decToBool dpAbsorption: dp disjoined with dp and dq has the boolean value of dp.
decAndComplement
Section titled “decAndComplement”theorem decAndComplement {P : Type} (d : Dec P) : decToBool (decAnd d (decNot d)) = falseA decision conjoined with its negation is always false.
decIff
Section titled “decIff”def decIff {P Q : Type} (dp : Dec P) (dq : Dec Q) : Dec ((P -> Q) × (Q -> P))Decides the biconditional (maps both ways) of two decidable propositions.
decXorBool
Section titled “decXorBool”def decXorBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : BoolBoolean exclusive or of two decisions.
decNandBool
Section titled “decNandBool”def decNandBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : BoolBoolean not-and of two decisions.
decNorBool
Section titled “decNorBool”def decNorBool {P Q : Type} (dp : Dec P) (dq : Dec Q) : BoolBoolean not-or of two decisions.
decIffYesYes
Section titled “decIffYesYes”theorem decIffYesYes {P Q : Type} (p : P) (q : Q) : decToBool (decIff (yes p) (yes q)) = trueThe biconditional of two positive decisions is true.
decIffNoNo
Section titled “decIffNoNo”theorem decIffNoNo {P Q : Type} (np : P -> Empty) (nq : Q -> Empty) : decToBool (decIff (no np) (no nq)) = trueThe biconditional of two negative decisions is true.
decIffYesNo
Section titled “decIffYesNo”theorem decIffYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decToBool (decIff (yes p) (no nq)) = falseThe biconditional of a positive and a negative decision is false.
decIffNoYes
Section titled “decIffNoYes”theorem decIffNoYes {P Q : Type} (np : P -> Empty) (q : Q) : decToBool (decIff (no np) (yes q)) = falseThe biconditional of a negative and a positive decision is false.
decIffRefl
Section titled “decIffRefl”theorem decIffRefl {P : Type} (d : Dec P) : decToBool (decIff d d) = trueThe biconditional of a decision with itself is true.
decIffSymm
Section titled “decIffSymm”theorem decIffSymm {P Q : Type} (dp : Dec P) (dq : Dec Q) : decToBool (decIff dp dq) = decToBool (decIff dq dp)The biconditional of decisions is symmetric at the boolean level.
decXorBoolYesYes
Section titled “decXorBoolYesYes”theorem decXorBoolYesYes {P Q : Type} (p : P) (q : Q) : decXorBool (yes p) (yes q) = falseExclusive or of two positive decisions is false.
decXorBoolYesNo
Section titled “decXorBoolYesNo”theorem decXorBoolYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decXorBool (yes p) (no nq) = trueExclusive or of a positive and a negative decision is true.
decXorBoolNoYes
Section titled “decXorBoolNoYes”theorem decXorBoolNoYes {P Q : Type} (np : P -> Empty) (q : Q) : decXorBool (no np) (yes q) = trueExclusive or of a negative and a positive decision is true.
decXorBoolNoNo
Section titled “decXorBoolNoNo”theorem decXorBoolNoNo {P Q : Type} (np : P -> Empty) (nq : Q -> Empty) : decXorBool (no np) (no nq) = falseExclusive or of two negative decisions is false.
decXorComm
Section titled “decXorComm”theorem decXorComm {P Q : Type} (dp : Dec P) (dq : Dec Q) : decXorBool dp dq = decXorBool dq dpExclusive or of decisions is commutative.
decNandBoolYesYes
Section titled “decNandBoolYesYes”theorem decNandBoolYesYes {P Q : Type} (p : P) (q : Q) : decNandBool (yes p) (yes q) = falseNot-and of two positive decisions is false.
decNandBoolYesNo
Section titled “decNandBoolYesNo”theorem decNandBoolYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decNandBool (yes p) (no nq) = trueNot-and of a positive and a negative decision is true.
decNandBoolNoYes
Section titled “decNandBoolNoYes”theorem decNandBoolNoYes {P Q : Type} (np : P -> Empty) (q : Q) : decNandBool (no np) (yes q) = trueNot-and of a negative and a positive decision is true.
decNandBoolNoNo
Section titled “decNandBoolNoNo”theorem decNandBoolNoNo {P Q : Type} (np : P -> Empty) (nq : Q -> Empty) : decNandBool (no np) (no nq) = trueNot-and of two negative decisions is true.
decNorBoolYesYes
Section titled “decNorBoolYesYes”theorem decNorBoolYesYes {P Q : Type} (p : P) (q : Q) : decNorBool (yes p) (yes q) = falseNot-or of two positive decisions is false.
decNorBoolYesNo
Section titled “decNorBoolYesNo”theorem decNorBoolYesNo {P Q : Type} (p : P) (nq : Q -> Empty) : decNorBool (yes p) (no nq) = falseNot-or of a positive and a negative decision is false.
decNorBoolNoYes
Section titled “decNorBoolNoYes”theorem decNorBoolNoYes {P Q : Type} (np : P -> Empty) (q : Q) : decNorBool (no np) (yes q) = falseNot-or of a negative and a positive decision is false.
decNorBoolNoNo
Section titled “decNorBoolNoNo”theorem decNorBoolNoNo {P Q : Type} (np : P -> Empty) (nq : Q -> Empty) : decNorBool (no np) (no nq) = trueNot-or of two negative decisions is true.
decJoin
Section titled “decJoin”def decJoin {P : Type} (d : Dec (Dec P)) : Dec PFlattens a decision about a decision into a decision about P.
decJoinYesYes
Section titled “decJoinYesYes”theorem decJoinYesYes {P : Type} (p : P) : decJoin (yes (yes p)) = yes pJoining yes (yes p) gives yes p.
decJoinYesNo
Section titled “decJoinYesNo”theorem decJoinYesNo {P : Type} (np : P -> Empty) : decJoin (yes (no np)) = no npJoining yes (no f) gives no f.
decDNE
Section titled “decDNE”def decDNE {P : Type} (d : Dec P) (dnn : (P -> Empty) -> Empty) : PDouble negation elimination for a decidable proposition.
decEqProd
Section titled “decEqProd”def decEqProd {A B : Type} (da : Dec A) (db : Dec B) : Dec (A × B)Decides a product from decisions for its components; an alias of decAnd.
decEqProdYY
Section titled “decEqProdYY”theorem decEqProdYY {A B : Type} (a : A) (b : B) : decToBool (decEqProd (yes a) (yes b)) = truedecEqProd of two positive decisions is true.
decEqProdYN
Section titled “decEqProdYN”theorem decEqProdYN {A B : Type} (a : A) (nb : B -> Empty) : decToBool (decEqProd (yes a) (no nb)) = falsedecEqProd of a positive and a negative decision is false.
decEqProdNY
Section titled “decEqProdNY”theorem decEqProdNY {A B : Type} (na : A -> Empty) (b : B) : decToBool (decEqProd (no na) (yes b)) = falsedecEqProd of a negative and a positive decision is false.
decEqProdNN
Section titled “decEqProdNN”theorem decEqProdNN {A B : Type} (na : A -> Empty) (nb : B -> Empty) : decToBool (decEqProd (no na) (no nb)) = falsedecEqProd of two negative decisions is false.
decEqSum
Section titled “decEqSum”def decEqSum {A B : Type} (da : Dec A) (db : Dec B) : Dec (Either A B)Decides a sum (Either) from decisions for its components; an alias of decOr.
decEqSumYY
Section titled “decEqSumYY”theorem decEqSumYY {A B : Type} (a : A) (b : B) : decToBool (decEqSum (yes a) (yes b)) = truedecEqSum of two positive decisions is true.
decEqSumYN
Section titled “decEqSumYN”theorem decEqSumYN {A B : Type} (a : A) (nb : B -> Empty) : decToBool (decEqSum (yes a) (no nb)) = truedecEqSum of a positive and a negative decision is true.
decEqSumNY
Section titled “decEqSumNY”theorem decEqSumNY {A B : Type} (na : A -> Empty) (b : B) : decToBool (decEqSum (no na) (yes b)) = truedecEqSum of a negative and a positive decision is true.
decEqSumNN
Section titled “decEqSumNN”theorem decEqSumNN {A B : Type} (na : A -> Empty) (nb : B -> Empty) : decToBool (decEqSum (no na) (no nb)) = falsedecEqSum of two negative decisions is false.
decTrue
Section titled “decTrue”def decTrue : Dec (true = true)Decides true = true positively by reflexivity.
decElim
Section titled “decElim”def decElim {P A : Type} (ifYes : P -> A) (ifNo : (P -> Empty) -> A) (d : Dec P) : AEliminates a decision into any type by handling the positive and negative cases.
decElimYes
Section titled “decElimYes”theorem decElimYes {P A : Type} (ifYes : P -> A) (ifNo : (P -> Empty) -> A) (p : P) : decElim ifYes ifNo (yes p) = ifYes pEliminating a positive decision runs the yes branch on the witness.
decElimNo
Section titled “decElimNo”theorem decElimNo {P A : Type} (ifYes : P -> A) (ifNo : (P -> Empty) -> A) (np : P -> Empty) : decElim ifYes ifNo (no np) = ifNo npEliminating a negative decision runs the no branch on the refutation.
decOrAndDistribBool
Section titled “decOrAndDistribBool”theorem decOrAndDistribBool {P Q R : Type} (dp : Dec P) (dq : Dec Q) (dr : Dec R) : decToBool (decOr dp (decAnd dq dr)) = and (decToBool (decOr dp dq)) (decToBool (decOr dp dr))Disjunction distributes over conjunction of decisions at the boolean level.
decImplRefl
Section titled “decImplRefl”theorem decImplRefl {P : Type} (d : Dec P) : decToBool (decImpl d d) = trueThe implication from a decision to itself is true.
decTripleNot
Section titled “decTripleNot”theorem decTripleNot {P : Type} (d : Dec P) : decToBool (decNot (decNot (decNot d))) = decToBool (decNot d)Triple negation of a decision has the same boolean value as single negation.
decXorSelf
Section titled “decXorSelf”theorem decXorSelf {P : Type} (d : Dec P) : decXorBool d d = falseExclusive or of a decision with itself is false.
decNandSelf
Section titled “decNandSelf”theorem decNandSelf {P : Type} (d : Dec P) : decNandBool d d = not (decToBool d)Not-and of a decision with itself is the boolean negation of the decision.
decNorSelf
Section titled “decNorSelf”theorem decNorSelf {P : Type} (d : Dec P) : decNorBool d d = not (decToBool d)Not-or of a decision with itself is the boolean negation of the decision.
decWhen
Section titled “decWhen”def decWhen {P A : Type} (d : Dec P) (f : P -> A) (default : A) : AApplies a function to the witness of a positive decision, or returns a default when it is negative.
decWhenYes
Section titled “decWhenYes”theorem decWhenYes {P A : Type} (p : P) (f : P -> A) (default : A) : decWhen (yes p) f default = f pdecWhen on a positive decision applies the function to the witness.
decWhenNo
Section titled “decWhenNo”theorem decWhenNo {P A : Type} (np : P -> Empty) (f : P -> A) (default : A) : decWhen (no np) f default = defaultdecWhen on a negative decision returns the default.
Decidable
Section titled “Decidable”class Decidable (P : Type)The class of decidable propositions, carrying a decision dec; instances drive the decide tactic.
ofDecideTrue
Section titled “ofDecideTrue”def ofDecideTrue {P : Type} (d : Dec P) (h : decToBool d = true) : PExtracts a proof of P from a decision whose boolean value computes to true.
ofDecide
Section titled “ofDecide”def ofDecide {P : Type} {{d : Decidable P}} (h : decToBool d.dec = true) : PProof produced by decide: a proof of P from the instance’s decision computing to true.
decEqBool
Section titled “decEqBool”instance decEqBool (a : Bool) (b : Bool) : Decidable (a = b)a = b on booleans is decidable (used by decide).
zeroNeqSuccD
Section titled “zeroNeqSuccD”def zeroNeqSuccD (n : Nat) (h : zero = succ n) : EmptyZero is not the successor of any natural number.
succNeqZeroD
Section titled “succNeqZeroD”def succNeqZeroD (n : Nat) (h : succ n = zero) : EmptyA successor is never zero.
natDecEq
Section titled “natDecEq”def natDecEq (m : Nat) (n : Nat) : Dec (m = n)Decidable equality of natural numbers.
decEqNat
Section titled “decEqNat”instance decEqNat (m : Nat) (n : Nat) : Decidable (m = n)m = n on naturals is decidable (used by decide).
decide
Section titled “decide”def decide (P : Type) {{d : Decidable P}} : Dec PThe decision of P: match decide(a == b) branches with the proof either way.
decPath
Section titled “decPath”def decPath {A : Type} {a : A} {b : A} (d : Dec (a = b)) : Dec (a ≡ b)A path is decided as its identity is.
The identity is decided by d.
decPathBool
Section titled “decPathBool”instance decPathBool (a : Bool) (b : Bool) : Decidable (a ≡ b)a == b on booleans is decidable.
decPathNat
Section titled “decPathNat”instance decPathNat (m : Nat) (n : Nat) : Decidable (m ≡ n)m == n on naturals is decidable.