Section BOOLEAN_ALGEBRA. (* Reference: << Constructive Completeness Proofs and Delimited Control >> written by "Danko Ilik" *)
Context {B : Type} {BA : isBA B}.
#[local] Notation andB := (@andB B BA).
Definition andsB : list B -> B :=
fold_right andB trueB.
Context {SETOID : isSetoid B}.
Definition leB (lhs : B) (rhs : B) : Prop :=
andB lhs rhs == lhs.
Context {BOOLEAN_ALGEBRA_LAWS : BooleanAlgebraLaws BA}.
#[global]
Instance leB_PreOrder
: PreOrder leB.
#[global]
Instance leB_PartialOrder
: PartialOrder eqProp leB.
#[global]
Instance BA_isProset : isProset B :=
{ leProp lhs rhs := andB lhs rhs == lhs
; Proset_isSetoid := SETOID
; leProp_PreOrder := leB_PreOrder
; leProp_PartialOrder := leB_PartialOrder
}.
#[global]
Instance andB_compathWith_leProp
: isMonotonic2 andB.

Lemma andsB_app xs1 xs2
: andsB (xs1 ++ xs2) == andB (andsB xs1) (andsB xs2).