Built with Alectryon, running Coq+SerAPI v8.18.0+0.18.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
(** Demonstrate the [HProp] is a (bounded) lattice w.r.t. the logical operations. This requires Univalence. *) Global Instance join_hor : Join HProp := hor. Definition hand (X Y : HProp) : HProp := Build_HProp (X * Y). Global Instance meet_hprop : Meet HProp := hand. Global Instance bottom_hprop : Bottom HProp := False_hp. Global Instance top_hprop : Top HProp := Unit_hp. Section contents. Context `{Univalence}. (* We use this notation because [hor] can accept arguments of type [Type], which leads to minor confusion in the instances below *) Notation lor := (hor : HProp -> HProp -> HProp). (* This tactic attempts to destruct a truncated sum (disjunction) *) Local Ltac hor_intros := let x := fresh in intro x; repeat (strip_truncations; destruct x as [x | x]).
H: Univalence

Commutative ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence

Commutative ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence
x, y: HProp

hor x y = hor y x
apply path_iff_hprop; hor_intros; apply tr; auto. Defined.
H: Univalence

Commutative hand
H: Univalence

Commutative hand
H: Univalence
x, y: HProp

hand x y = hand y x
H: Univalence
x, y: HProp

hand x y <~> hand y x
apply equiv_prod_symm. Defined.
H: Univalence

Associative ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence

Associative ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence
x, y, z: HProp

hor x (hor y z) = hor (hor x y) z
apply path_iff_hprop; hor_intros; apply tr; ((by auto) || (left; apply tr) || (right; apply tr)); auto. Defined.
H: Univalence

Associative hand
H: Univalence

Associative hand
H: Univalence
x, y, z: HProp

hand x (hand y z) = hand (hand x y) z
H: Univalence
x, y, z: HProp

hand x (hand y z) <~> hand (hand x y) z
apply equiv_prod_assoc. Defined.
H: Univalence

BinaryIdempotent ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence

BinaryIdempotent ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence
x: HProp

Idempotent (fun P Q : HProp => hor P Q) x
H: Univalence
x: HProp

Build_HProp (Trunc (-1) (x + x)) = x
H: Univalence
x: HProp
H0: x

Build_HProp (Trunc (-1) (x + x))
by apply tr, inl. Defined.
H: Univalence

BinaryIdempotent hand
H: Univalence

BinaryIdempotent hand
H: Univalence
x: HProp

Idempotent hand x
H: Univalence
x: HProp

hand x x -> x
H: Univalence
x: HProp
x -> hand x x
H: Univalence
x: HProp

hand x x -> x
intros [a _] ; apply a.
H: Univalence
x: HProp

x -> hand x x
intros a; apply (pair a a). Defined.
H: Univalence

LeftIdentity ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp) False_hp
H: Univalence

LeftIdentity ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp) False_hp
H: Univalence
y: HProp

hor False_hp y = y
H: Univalence
y: HProp
H0: y

hor False_hp y
by apply tr, inr. Defined.
H: Univalence

RightIdentity ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp) False_hp
H: Univalence

RightIdentity ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp) False_hp
H: Univalence
x: HProp

hor x False_hp = x
H: Univalence
x: HProp
H0: x

hor x False_hp
by apply tr, inl. Defined.
H: Univalence

LeftIdentity hand Unit_hp
H: Univalence

LeftIdentity hand Unit_hp
H: Univalence
y: HProp

hand Unit_hp y = y
apply path_trunctype, prod_unit_l. Defined.
H: Univalence

RightIdentity hand Unit_hp
H: Univalence

RightIdentity hand Unit_hp
H: Univalence
x: HProp

hand x Unit_hp = x
apply path_trunctype, prod_unit_r. Defined.
H: Univalence

Absorption ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp) hand
H: Univalence

Absorption ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp) hand
H: Univalence
x, y: HProp

hor x (hand x y) = x
H: Univalence
x, y: HProp

hor x (hand x y) -> x
H: Univalence
x, y: HProp
x -> hor x (hand x y)
H: Univalence
x, y: HProp

hor x (hand x y) -> x
H: Univalence
x, y: HProp
X: (x + hand x y)%type

x
destruct X as [? | [? _]]; assumption.
H: Univalence
x, y: HProp

x -> hor x (hand x y)
H: Univalence
x, y: HProp
X: x

hor x (hand x y)
by apply tr, inl. Defined.
H: Univalence

Absorption hand ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence

Absorption hand ((fun P Q : HProp => hor P Q) : HProp -> HProp -> HProp)
H: Univalence
x, y: HProp

hand x (hor x y) = x
H: Univalence
x, y: HProp

hand x (hor x y) -> x
H: Univalence
x, y: HProp
x -> hand x (hor x y)
H: Univalence
x, y: HProp

hand x (hor x y) -> x
intros [? _]; assumption.
H: Univalence
x, y: HProp

x -> hand x (hor x y)
H: Univalence
x, y: HProp
X: x

hand x (hor x y)
H: Univalence
x, y: HProp
X: x

x
H: Univalence
x, y: HProp
X: x
hor x y
H: Univalence
x, y: HProp
X: x

x
assumption.
H: Univalence
x, y: HProp
X: x

hor x y
by apply tr, inl. Defined.
H: Univalence

IsBoundedLattice HProp
H: Univalence

IsBoundedLattice HProp
repeat split; apply _. Defined. End contents.