bool
本頁內容尚未翻譯。
Bool.notNot
Section titled “Bool.notNot”def notNot (b : Bool) : not (not b) = bDouble negation: negating a boolean twice gives it back.
Bool.andTrueR
Section titled “Bool.andTrueR”def andTrueR (b : Bool) : and b true = btrue is a right identity for and.
Bool.orFalseR
Section titled “Bool.orFalseR”def orFalseR (b : Bool) : or b false = bfalse is a right identity for or.
Bool.andFalseR
Section titled “Bool.andFalseR”def andFalseR (b : Bool) : and b false = falsefalse is right-absorbing for and: and b false is false.
Bool.andFalseL
Section titled “Bool.andFalseL”def andFalseL (b : Bool) : and false b = falsefalse is left-absorbing for and: and false b is false.
Bool.orTrueR
Section titled “Bool.orTrueR”def orTrueR (b : Bool) : or b true = truetrue is right-absorbing for or: or b true is true.
Bool.orTrueL
Section titled “Bool.orTrueL”def orTrueL (b : Bool) : or true b = truetrue is left-absorbing for or: or true b is true.
Bool.deMorganAnd
Section titled “Bool.deMorganAnd”def deMorganAnd (a : Bool) (b : Bool) : not (and a b) = or (not a) (not b)De Morgan’s law: not (a and b) = (not a) or (not b).
Bool.deMorganOr
Section titled “Bool.deMorganOr”def deMorganOr (a : Bool) (b : Bool) : not (or a b) = and (not a) (not b)De Morgan’s law: not (a or b) = (not a) and (not b).
Bool.andIdem
Section titled “Bool.andIdem”def andIdem (b : Bool) : and b b = band is idempotent: and b b is b.
Bool.orIdem
Section titled “Bool.orIdem”def orIdem (b : Bool) : or b b = bor is idempotent: or b b is b.
Bool.ite
Section titled “Bool.ite”def ite {A : Type} (cond : Bool) (then_val : A) (else_val : A) : AIf-then-else: returns the first value when the condition is true, otherwise the second.
Bool.iteTrue
Section titled “Bool.iteTrue”def iteTrue {A : Type} (x : A) (y : A) : ite true x y = xite with a true condition returns the then-branch.
Bool.iteFalse
Section titled “Bool.iteFalse”def iteFalse {A : Type} (x : A) (y : A) : ite false x y = yite with a false condition returns the else-branch.
Bool.trueNeqFalse
Section titled “Bool.trueNeqFalse”def trueNeqFalse : Not (true = false)The constructors true and false are distinct, proved by encode-decode.
Bool.falseNeqTrue
Section titled “Bool.falseNeqTrue”def falseNeqTrue : Not (false = true)The constructors false and true are distinct, proved by encode-decode.
Bool.boolDecEq
Section titled “Bool.boolDecEq”def boolDecEq : DecEq BoolDecidable equality on Bool, by case analysis on both arguments.
Bool.xorFalseR
Section titled “Bool.xorFalseR”def xorFalseR (a : Bool) : xor a false = afalse is a right identity for xor.
Bool.xorTrueR
Section titled “Bool.xorTrueR”def xorTrueR (a : Bool) : xor a true = not axor with true on the right negates: xor a true is not a.
Bool.andOrAbsorb
Section titled “Bool.andOrAbsorb”def andOrAbsorb (a : Bool) (b : Bool) : and a (or a b) = aAbsorption law: a and (a or b) = a.
Bool.orAndAbsorb
Section titled “Bool.orAndAbsorb”def orAndAbsorb (a : Bool) (b : Bool) : or a (and a b) = aAbsorption law: a or (a and b) = a.
Bool.andDistribOr
Section titled “Bool.andDistribOr”def andDistribOr (a : Bool) (b : Bool) (c : Bool) : and a (or b c) = or (and a b) (and a c)and distributes over or on the left.
Bool.orDistribAnd
Section titled “Bool.orDistribAnd”def orDistribAnd (a : Bool) (b : Bool) (c : Bool) : or a (and b c) = and (or a b) (or a c)or distributes over and on the left.
Bool.boolEq
Section titled “Bool.boolEq”def boolEq (a : Bool) (b : Bool) : BoolBoolean equality test: true exactly when both arguments are equal.
Bool.boolEqRefl
Section titled “Bool.boolEqRefl”def boolEqRefl (a : Bool) : boolEq a a = trueboolEq is reflexive: every boolean equals itself.
Bool.boolEqComm
Section titled “Bool.boolEqComm”def boolEqComm (a : Bool) (b : Bool) : boolEq a b = boolEq b aboolEq is symmetric in its arguments.
Bool.xorAssoc
Section titled “Bool.xorAssoc”def xorAssoc (a : Bool) (b : Bool) (c : Bool) : xor a (xor b c) = xor (xor a b) cxor is associative.
Bool.boolRec
Section titled “Bool.boolRec”def boolRec (C : Type) (ct : C) (cf : C) (b : Bool) : CNon-dependent recursor for Bool: picks the first value for true, the second for false.
Bool.boolRecTrue
Section titled “Bool.boolRecTrue”def boolRecTrue (C : Type) (ct : C) (cf : C) : boolRec C ct cf true = ctboolRec computes to its true case on true.
Bool.boolRecFalse
Section titled “Bool.boolRecFalse”def boolRecFalse (C : Type) (ct : C) (cf : C) : boolRec C ct cf false = cfboolRec computes to its false case on false.
Bool.xorNotL
Section titled “Bool.xorNotL”def xorNotL (a : Bool) (b : Bool) : xor (not a) b = not (xor a b)Negating the left argument of xor negates the result.
Bool.xorNotR
Section titled “Bool.xorNotR”def xorNotR (a : Bool) (b : Bool) : xor a (not b) = not (xor a b)Negating the right argument of xor negates the result.
Bool.nand
Section titled “Bool.nand”def nand (a : Bool) (b : Bool) : BoolBoolean NAND: the negation of and.
Bool.nor
Section titled “Bool.nor”def nor (a : Bool) (b : Bool) : BoolBoolean NOR: the negation of or.
Bool.iff
Section titled “Bool.iff”def iff (a : Bool) (b : Bool) : BoolBoolean biconditional: true when each argument implies the other.
Bool.impliesTrue
Section titled “Bool.impliesTrue”def impliesTrue (a : Bool) : implies a true = trueAnything implies true.
Bool.impliesSelf
Section titled “Bool.impliesSelf”def impliesSelf (a : Bool) : implies a a = trueEvery boolean implies itself.
Bool.boolCases
Section titled “Bool.boolCases”def boolCases (b : Bool) : or (boolEq b true) (boolEq b false) = trueEvery boolean is either true or false, stated as a boolean test.
Bool.xorNeqBoolEq
Section titled “Bool.xorNeqBoolEq”def xorNeqBoolEq (a : Bool) (b : Bool) : xor a b = not (boolEq a b)xor is the negation of boolean equality.
Bool.andDistribXor
Section titled “Bool.andDistribXor”def andDistribXor (a : Bool) (b : Bool) (c : Bool) : and a (xor b c) = xor (and a b) (and a c)and distributes over xor on the left.
Bool.nandComm
Section titled “Bool.nandComm”def nandComm (a : Bool) (b : Bool) : nand a b = nand b anand is commutative.
Bool.norComm
Section titled “Bool.norComm”def norComm (a : Bool) (b : Bool) : nor a b = nor b anor is commutative.
Bool.impliesAsOr
Section titled “Bool.impliesAsOr”def impliesAsOr (a : Bool) (b : Bool) : implies a b = or (not a) bBoolean implication unfolds definitionally to (not a) or b.
Bool.iffRefl
Section titled “Bool.iffRefl”def iffRefl (a : Bool) : iff a a = trueiff is reflexive: every boolean is equivalent to itself.
Bool.iffComm
Section titled “Bool.iffComm”def iffComm (a : Bool) (b : Bool) : iff a b = iff b aiff is symmetric in its arguments.
Bool.majority
Section titled “Bool.majority”def majority (a : Bool) (b : Bool) (c : Bool) : BoolMajority vote of three booleans: true when at least two of them are true.
Bool.cond
Section titled “Bool.cond”def cond {A : Type} (b : Bool) (x : A) (y : A) : AConditional expression: the first value when the boolean is true, otherwise the second.
Bool.boolToNat
Section titled “Bool.boolToNat”def boolToNat (b : Bool) : NatConverts a boolean to a natural number: true to 1 and false to 0.
Bool.condTrueId
Section titled “Bool.condTrueId”def condTrueId {A : Type} (x : A) (y : A) : cond true x y = xcond with true returns its first value.
Bool.condFalseId
Section titled “Bool.condFalseId”def condFalseId {A : Type} (x : A) (y : A) : cond false x y = ycond with false returns its second value.
Bool.condSame
Section titled “Bool.condSame”def condSame {A : Type} (b : Bool) (x : A) : cond b x x = xcond with identical branches returns that value regardless of the condition.
Bool.all3
Section titled “Bool.all3”def all3 (a : Bool) (b : Bool) (c : Bool) : Booltrue when all three booleans are true.
Bool.any3
Section titled “Bool.any3”def any3 (a : Bool) (b : Bool) (c : Bool) : Booltrue when at least one of three booleans is true.
Bool.countTrue3
Section titled “Bool.countTrue3”def countTrue3 (a : Bool) (b : Bool) (c : Bool) : NatCounts how many of three booleans are true.
Bool.allTrue
Section titled “Bool.allTrue”def allTrue (xs : List Bool) : Booltrue when every boolean in the list is true (the empty list gives true).
Bool.anyTrue
Section titled “Bool.anyTrue”def anyTrue (xs : List Bool) : Booltrue when some boolean in the list is true (the empty list gives false).
Bool.allTrueConsTrue
Section titled “Bool.allTrueConsTrue”def allTrueConsTrue (xs : List Bool) : allTrue (cons true xs) = allTrue xsPrepending true does not change allTrue.
Bool.anyTrueConsFalse
Section titled “Bool.anyTrueConsFalse”def anyTrueConsFalse (xs : List Bool) : anyTrue (cons false xs) = anyTrue xsPrepending false does not change anyTrue.
Bool.allTrueConsFalse
Section titled “Bool.allTrueConsFalse”def allTrueConsFalse (xs : List Bool) : allTrue (cons false xs) = falseA list starting with false has allTrue equal to false.
Bool.anyTrueConsTrue
Section titled “Bool.anyTrueConsTrue”def anyTrueConsTrue (xs : List Bool) : anyTrue (cons true xs) = trueA list starting with true has anyTrue equal to true.
Bool.andComplement
Section titled “Bool.andComplement”def andComplement (a : Bool) : and a (not a) = falseComplement law: a and (not a) = false.
Bool.orComplement
Section titled “Bool.orComplement”def orComplement (a : Bool) : or a (not a) = trueComplement law: a or (not a) = true.
Bool.andComplementL
Section titled “Bool.andComplementL”def andComplementL (a : Bool) : and (not a) a = falseComplement law with the negation on the left: (not a) and a = false.
Bool.orComplementL
Section titled “Bool.orComplementL”def orComplementL (a : Bool) : or (not a) a = trueComplement law with the negation on the left: (not a) or a = true.
Bool.eqBool
Section titled “Bool.eqBool”def eqBool (a : Bool) (b : Bool) : BoolBoolean equality test: true exactly when both arguments are equal (same as boolEq).
Bool.eqBoolRefl
Section titled “Bool.eqBoolRefl”def eqBoolRefl (a : Bool) : eqBool a a = trueeqBool is reflexive: every boolean equals itself.
Bool.eqBoolComm
Section titled “Bool.eqBoolComm”def eqBoolComm (a : Bool) (b : Bool) : eqBool a b = eqBool b aeqBool is symmetric in its arguments.
Bool.eqBoolNotNot
Section titled “Bool.eqBoolNotNot”def eqBoolNotNot (a : Bool) (b : Bool) : eqBool (not a) (not b) = eqBool a bNegating both arguments does not change eqBool.
Bool.xorIsNotEqBool
Section titled “Bool.xorIsNotEqBool”def xorIsNotEqBool (a : Bool) (b : Bool) : xor a b = not (eqBool a b)xor is the negation of eqBool.
Bool.xorCancel
Section titled “Bool.xorCancel”def xorCancel (a : Bool) (b : Bool) : xor a (xor a b) = bxor with the same value twice cancels: a xor (a xor b) = b.
Bool.xorCancelR
Section titled “Bool.xorCancelR”def xorCancelR (a : Bool) (b : Bool) : xor (xor a b) b = axor with the same value twice cancels on the right: (a xor b) xor b = a.
Bool.xorFalseL
Section titled “Bool.xorFalseL”def xorFalseL (b : Bool) : xor false b = bfalse is a left identity for xor.
Bool.xorTrueL
Section titled “Bool.xorTrueL”def xorTrueL (b : Bool) : xor true b = not bxor with true on the left negates: xor true b is not b.
Bool.xorNotNot
Section titled “Bool.xorNotNot”def xorNotNot (a : Bool) (b : Bool) : xor (not a) (not b) = xor a bNegating both arguments does not change xor.
Bool.boolMeet
Section titled “Bool.boolMeet”def boolMeet (a : Bool) (b : Bool) : BoolLattice meet on Bool, which is and.
Bool.boolJoin
Section titled “Bool.boolJoin”def boolJoin (a : Bool) (b : Bool) : BoolLattice join on Bool, which is or.
Bool.boolTop
Section titled “Bool.boolTop”def boolTop : BoolTop element of the boolean lattice, true.
Bool.boolBot
Section titled “Bool.boolBot”def boolBot : BoolBottom element of the boolean lattice, false.
Bool.boolMeetComm
Section titled “Bool.boolMeetComm”def boolMeetComm (a : Bool) (b : Bool) : boolMeet a b = boolMeet b aLattice meet on Bool is commutative.
Bool.boolJoinComm
Section titled “Bool.boolJoinComm”def boolJoinComm (a : Bool) (b : Bool) : boolJoin a b = boolJoin b aLattice join on Bool is commutative.
Bool.boolMeetAssoc
Section titled “Bool.boolMeetAssoc”def boolMeetAssoc (a : Bool) (b : Bool) (c : Bool) : boolMeet a (boolMeet b c) = boolMeet (boolMeet a b) cLattice meet on Bool is associative.
Bool.boolJoinAssoc
Section titled “Bool.boolJoinAssoc”def boolJoinAssoc (a : Bool) (b : Bool) (c : Bool) : boolJoin a (boolJoin b c) = boolJoin (boolJoin a b) cLattice join on Bool is associative.
Bool.boolMeetTop
Section titled “Bool.boolMeetTop”def boolMeetTop (a : Bool) : boolMeet a boolTop = aTop is an identity for meet.
Bool.boolMeetBot
Section titled “Bool.boolMeetBot”def boolMeetBot (a : Bool) : boolMeet a boolBot = boolBotBottom is absorbing for meet.
Bool.boolJoinBot
Section titled “Bool.boolJoinBot”def boolJoinBot (a : Bool) : boolJoin a boolBot = aBottom is an identity for join.
Bool.boolJoinTop
Section titled “Bool.boolJoinTop”def boolJoinTop (a : Bool) : boolJoin a boolTop = boolTopTop is absorbing for join.
Bool.boolMeetIdem
Section titled “Bool.boolMeetIdem”def boolMeetIdem (a : Bool) : boolMeet a a = aLattice meet on Bool is idempotent.
Bool.boolJoinIdem
Section titled “Bool.boolJoinIdem”def boolJoinIdem (a : Bool) : boolJoin a a = aLattice join on Bool is idempotent.
Bool.boolMeetAbsorb
Section titled “Bool.boolMeetAbsorb”def boolMeetAbsorb (a : Bool) (b : Bool) : boolMeet a (boolJoin a b) = aLattice absorption: meet a (join a b) = a.
Bool.boolJoinAbsorb
Section titled “Bool.boolJoinAbsorb”def boolJoinAbsorb (a : Bool) (b : Bool) : boolJoin a (boolMeet a b) = aLattice absorption: join a (meet a b) = a.
Bool.nandSelf
Section titled “Bool.nandSelf”def nandSelf (a : Bool) : nand a a = not anand of a value with itself is its negation.
Bool.norSelf
Section titled “Bool.norSelf”def norSelf (a : Bool) : nor a a = not anor of a value with itself is its negation.
Bool.nandTrueL
Section titled “Bool.nandTrueL”def nandTrueL (b : Bool) : nand true b = not bnand true b is not b.
Bool.nandFalseL
Section titled “Bool.nandFalseL”def nandFalseL (b : Bool) : nand false b = truenand false b is true.
Bool.norFalseL
Section titled “Bool.norFalseL”def norFalseL (b : Bool) : nor false b = not bnor false b is not b.
Bool.norTrueL
Section titled “Bool.norTrueL”def norTrueL (b : Bool) : nor true b = falsenor true b is false.
Bool.nandTrueR
Section titled “Bool.nandTrueR”def nandTrueR (a : Bool) : nand a true = not anand a true is not a.
Bool.nandFalseR
Section titled “Bool.nandFalseR”def nandFalseR (a : Bool) : nand a false = truenand a false is true.
Bool.norFalseR
Section titled “Bool.norFalseR”def norFalseR (a : Bool) : nor a false = not anor a false is not a.
Bool.norTrueR
Section titled “Bool.norTrueR”def norTrueR (a : Bool) : nor a true = falsenor a true is false.
Bool.doubleNand
Section titled “Bool.doubleNand”def doubleNand (a : Bool) (b : Bool) : nand (nand a b) (nand a b) = and a band expressed with NAND alone: nand (nand a b) (nand a b) = a and b.
Bool.notInjective
Section titled “Bool.notInjective”def notInjective (a : Bool) (b : Bool) (p : not a = not b) : a = bnot is injective: equal negations imply equal booleans.
Bool.iteSame
Section titled “Bool.iteSame”def iteSame {A : Type} (b : Bool) (x : A) : ite b x x = xite with identical branches returns that value regardless of the condition.
Bool.iteIsCond
Section titled “Bool.iteIsCond”def iteIsCond {A : Type} (b : Bool) (x : A) (y : A) : ite b x y = cond b x yite and cond compute the same result.
Bool.iteNot
Section titled “Bool.iteNot”def iteNot {A : Type} (b : Bool) (x : A) (y : A) : ite (not b) x y = ite b y xNegating the condition of ite swaps its branches.
Bool.notAndTrue
Section titled “Bool.notAndTrue”def notAndTrue (a : Bool) : not (and a true) = not anot (a and true) = not a.
Bool.notAndFalse
Section titled “Bool.notAndFalse”def notAndFalse (a : Bool) : not (and a false) = truenot (a and false) = true.
Bool.notOrTrue
Section titled “Bool.notOrTrue”def notOrTrue (a : Bool) : not (or a true) = falsenot (a or true) = false.
Bool.notOrFalse
Section titled “Bool.notOrFalse”def notOrFalse (a : Bool) : not (or a false) = not anot (a or false) = not a.
Bool.meetDistribXor
Section titled “Bool.meetDistribXor”def meetDistribXor (a : Bool) (b : Bool) (c : Bool) : boolMeet a (xor b c) = xor (boolMeet a b) (boolMeet a c)Lattice meet on Bool distributes over xor.
Bool.nandAsDeMorgan
Section titled “Bool.nandAsDeMorgan”def nandAsDeMorgan (a : Bool) (b : Bool) : nand a b = or (not a) (not b)nand equals (not a) or (not b), by De Morgan.
Bool.norAsDeMorgan
Section titled “Bool.norAsDeMorgan”def norAsDeMorgan (a : Bool) (b : Bool) : nor a b = and (not a) (not b)nor equals (not a) and (not b), by De Morgan.
Bool.impliesFalseL
Section titled “Bool.impliesFalseL”def impliesFalseL (b : Bool) : implies false b = truefalse implies anything.
Bool.iffIsEqBool
Section titled “Bool.iffIsEqBool”def iffIsEqBool (a : Bool) (b : Bool) : iff a b = eqBool a biff agrees with eqBool.
Bool.boolToNatAnd
Section titled “Bool.boolToNatAnd”def boolToNatAnd (a : Bool) (b : Bool) : boolToNat (and a b) = boolToNat (ite a b false)boolToNat of and a b equals boolToNat of ite a b false.
Bool.boolToNatNotNot
Section titled “Bool.boolToNatNotNot”def boolToNatNotNot (a : Bool) : boolToNat (not (not a)) = boolToNat aDouble negation does not change boolToNat.
Bool.boolMeetDistribJoin
Section titled “Bool.boolMeetDistribJoin”def boolMeetDistribJoin (a : Bool) (b : Bool) (c : Bool) : boolMeet a (boolJoin b c) = boolJoin (boolMeet a b) (boolMeet a c)Lattice meet on Bool distributes over join.
Bool.boolJoinDistribMeet
Section titled “Bool.boolJoinDistribMeet”def boolJoinDistribMeet (a : Bool) (b : Bool) (c : Bool) : boolJoin a (boolMeet b c) = boolMeet (boolJoin a b) (boolJoin a c)Lattice join on Bool distributes over meet.
Bool.boolMeetComplement
Section titled “Bool.boolMeetComplement”def boolMeetComplement (a : Bool) : boolMeet a (not a) = boolBotLattice complement: the meet of a value and its negation is bottom.
Bool.boolJoinComplement
Section titled “Bool.boolJoinComplement”def boolJoinComplement (a : Bool) : boolJoin a (not a) = boolTopLattice complement: the join of a value and its negation is top.
Bool.simpAndTrue
Section titled “Bool.simpAndTrue”theorem simpAndTrue (b : Bool) : and true b = btrue is a left identity for and, proved with simp.
Bool.simpOrFalse
Section titled “Bool.simpOrFalse”theorem simpOrFalse (b : Bool) : or false b = bfalse is a left identity for or, proved with simp.
Bool.Empty_Bool
Section titled “Bool.Empty_Bool”data Empty_BoolAn empty type used as the target of trueNeqFalseTac.
Bool.trueNeqFalseTac
Section titled “Bool.trueNeqFalseTac”theorem trueNeqFalseTac (h : true = false) : Empty_BoolA proof of true = false yields an element of the empty type Empty_Bool, proved with discriminate.
Bool.natToBool
Section titled “Bool.natToBool”def natToBool (n : Nat) : BoolConverts a natural number to a boolean: zero to false, any successor to true.
Bool.bool3and
Section titled “Bool.bool3and”def bool3and (a : Bool) (b : Bool) (c : Bool) : BoolThree-way conjunction, grouped as (a and b) and c.
Bool.bool3or
Section titled “Bool.bool3or”def bool3or (a : Bool) (b : Bool) (c : Bool) : BoolThree-way disjunction, grouped as (a or b) or c.
Bool.conditional
Section titled “Bool.conditional”def conditional {A : Type} (b : Bool) (t : A) (f : A) : AIf-then-else as a function: the first value when the boolean is true, otherwise the second.
Bool.natToBoolBoolToNat
Section titled “Bool.natToBoolBoolToNat”def natToBoolBoolToNat (b : Bool) : natToBool (boolToNat b) = bConverting a boolean to a number and back returns the original boolean.
Bool.natToBoolSucc
Section titled “Bool.natToBoolSucc”def natToBoolSucc (n : Nat) : natToBool (succ n) = trueEvery successor converts to true.
Bool.bool3andIsAnd
Section titled “Bool.bool3andIsAnd”def bool3andIsAnd (a : Bool) (b : Bool) (c : Bool) : bool3and a b c = and (and a b) cbool3and unfolds to (a and b) and c.
Bool.bool3andFalseL
Section titled “Bool.bool3andFalseL”def bool3andFalseL (b : Bool) (c : Bool) : bool3and false b c = falsebool3and with false first is false.
Bool.bool3andTrueL
Section titled “Bool.bool3andTrueL”def bool3andTrueL (b : Bool) (c : Bool) : bool3and true b c = and b cbool3and with true first is the and of the other two.
Bool.bool3andFalseM
Section titled “Bool.bool3andFalseM”def bool3andFalseM (a : Bool) (c : Bool) : bool3and a false c = falsebool3and with false in the middle is false.
Bool.bool3andFalseR
Section titled “Bool.bool3andFalseR”def bool3andFalseR (a : Bool) (b : Bool) : bool3and a b false = falsebool3and with false last is false.
Bool.bool3orIsOr
Section titled “Bool.bool3orIsOr”def bool3orIsOr (a : Bool) (b : Bool) (c : Bool) : bool3or a b c = or (or a b) cbool3or unfolds to (a or b) or c.
Bool.bool3orTrueL
Section titled “Bool.bool3orTrueL”def bool3orTrueL (b : Bool) (c : Bool) : bool3or true b c = truebool3or with true first is true.
Bool.bool3orFalseL
Section titled “Bool.bool3orFalseL”def bool3orFalseL (b : Bool) (c : Bool) : bool3or false b c = or b cbool3or with false first is the or of the other two.
Bool.bool3orTrueM
Section titled “Bool.bool3orTrueM”def bool3orTrueM (a : Bool) (c : Bool) : bool3or a true c = truebool3or with true in the middle is true.
Bool.bool3orTrueR
Section titled “Bool.bool3orTrueR”def bool3orTrueR (a : Bool) (b : Bool) : bool3or a b true = truebool3or with true last is true.
Bool.majorityIdem12
Section titled “Bool.majorityIdem12”def majorityIdem12 (a : Bool) (b : Bool) : majority a a b = aWhen the first two votes agree, majority returns that vote.
Bool.majorityIdem13
Section titled “Bool.majorityIdem13”def majorityIdem13 (a : Bool) (b : Bool) : majority a b a = aWhen the first and third votes agree, majority returns that vote.
Bool.majorityAllSame
Section titled “Bool.majorityAllSame”def majorityAllSame (a : Bool) : majority a a a = amajority of three equal votes is that vote.
Bool.conditionalTrue
Section titled “Bool.conditionalTrue”def conditionalTrue {A : Type} (t : A) (f : A) : conditional true t f = tconditional with true returns its first value.
Bool.conditionalFalse
Section titled “Bool.conditionalFalse”def conditionalFalse {A : Type} (t : A) (f : A) : conditional false t f = fconditional with false returns its second value.
Bool.conditionalSame
Section titled “Bool.conditionalSame”def conditionalSame {A : Type} (b : Bool) (x : A) : conditional b x x = xconditional with identical branches returns that value regardless of the condition.
Bool.conditionalNot
Section titled “Bool.conditionalNot”def conditionalNot {A : Type} (b : Bool) (x : A) (y : A) : conditional (not b) x y = conditional b y xNegating the condition of conditional swaps its branches.
Bool.conditionalIsIte
Section titled “Bool.conditionalIsIte”def conditionalIsIte {A : Type} (b : Bool) (x : A) (y : A) : conditional b x y = ite b x yconditional and ite compute the same result.
Bool.natToBoolAdd
Section titled “Bool.natToBoolAdd”def natToBoolAdd (m : Nat) : natToBool (add (succ zero) m) = trueOne plus any natural number converts to true.
Bool.boolToNatOr
Section titled “Bool.boolToNatOr”def boolToNatOr (a : Bool) (b : Bool) : boolToNat (or a b) = boolToNat (ite a true b)boolToNat of or a b equals boolToNat of ite a true b.
Bool.boolToNatNot
Section titled “Bool.boolToNatNot”def boolToNatNot (b : Bool) : add (boolToNat b) (boolToNat (not b)) = succ zeroA boolean and its negation contribute exactly one true between them: their boolToNat values sum to 1.
Bool.bool3andAssoc
Section titled “Bool.bool3andAssoc”def bool3andAssoc (a : Bool) (b : Bool) (c : Bool) : and a (and b c) = and (and a b) cand is associative.
Bool.bool3orAssoc
Section titled “Bool.bool3orAssoc”def bool3orAssoc (a : Bool) (b : Bool) (c : Bool) : or a (or b c) = or (or a b) cor is associative.
Bool.notXorSelf
Section titled “Bool.notXorSelf”def notXorSelf (a : Bool) (b : Bool) : not (xor a b) = eqBool a bThe negation of xor is eqBool.
Bool.notBool3and
Section titled “Bool.notBool3and”def notBool3and (a : Bool) (b : Bool) (c : Bool) : not (bool3and a b c) = bool3or (not a) (not b) (not c)De Morgan for three: the negation of bool3and is bool3or of the negations.
Bool.notBool3or
Section titled “Bool.notBool3or”def notBool3or (a : Bool) (b : Bool) (c : Bool) : not (bool3or a b c) = bool3and (not a) (not b) (not c)De Morgan for three: the negation of bool3or is bool3and of the negations.