Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.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]
Set Universe Minimization ToSet.(** * Predicates on types *)(** We use the words "predicate" and "(type) family" interchangably to mean something of type [A -> Type]. *)(** ** Predicate equality *)(** Two predicates are considered "equal" if they are pointwise logically equivalent: [forall a, P a <-> Q a]. We express this with [relation_pointwise] to ease typeclass search. *)Definitionpred_eq {A : Type} := relation_pointwise (fun_ : A => iff).(** It follows from [reflexive_pointwise], [transitive_pointwise] and [symmetric_pointwise] that [pred_eq] is reflexive, transitive and symmetric. *)(** ** Subsets of a predicate *)(** A predicate [P] is a "subset" of a predicate [Q] if [forall a, P a -> Q a]. *)Definitionpred_subset {A : Type} := relation_pointwise (fun (_ : A) => (->)).(** *** Predicate Notations *)Declare Scope predicate_scope.LocalOpen Scope predicate_scope.Infix"⊆" := pred_subset : predicate_scope.Infix"↔" := pred_eq : predicate_scope.(** *** Properties of subsets *)(** It follows from [reflexive_pointwise] and [transitive_pointwise] that [pred_subset] is reflexive and transitive. *)Coercionpred_subset_pred_eq {A : Type} (P Q : A -> Type)
: P ↔ Q -> P ⊆ Q
:= funpx => fst (p x).Definitionpred_subset_pred_eq' {A : Type} (PQ : A -> Type)
: P ↔ Q -> Q ⊆ P
:= funpx => snd (p x).(** The subset relation is antisymmetric. Note that this isn't [Antisymmetry] as defined in [Basics.Classes] since we get a [pred_eq] rather than a path. Under being a hprop and univalance, we would get a path. *)
A: Type P, Q: A -> Type
P ⊆ Q -> Q ⊆ P -> P ↔ Q
A: Type P, Q: A -> Type
P ⊆ Q -> Q ⊆ P -> P ↔ Q
intros p q x; specialize (p x); specialize (q x); bysplit.Defined.Definitionpred_subset_precomp {AB : Type} {PQ : B -> Type} (f : A -> B)
: P ⊆ Q -> (P o f) ⊆ (Q o f)
:= pointwise_precomp _ f P Q.Definitionpred_subset_postcomp {A : Type} {PQ : A -> Type}
(F : Type -> Type) (f : forall {XY}, (X -> Y) -> F X -> F Y) (p : P ⊆ Q)
: (F o P) ⊆ (F o Q)
:= funx => f (p x).Definitionpred_subset_moveL_equiv {AB : Type} {P : B -> Type} {Q : A -> Type}
(f : B <~> A)
: (P o f^-1) ⊆ Q -> P ⊆ (Q o f)
:= pointwise_moveL_equiv _ f P Q.Definitionpred_subset_moveR_equiv {AB : Type} {P : B -> Type} {Q : A -> Type}
(f : A <~> B)
: P ⊆ (Q o f^-1) -> (P o f) ⊆ Q
:= pointwise_moveR_equiv _ f P Q.SectionOperationsAndIdentities.(** ** Operations on predicates *)Context {A : Type}.Local NotationPred := (A -> Type).Definitionpred_and (PQ : Pred) : Pred
:= funa => P a /\ Q a.Definitionpred_or (PQ : Pred) : Pred
:= funa => P a + Q a.(** ** True and false predicates *)Definitionpred_unit : Pred
:= fun_ => Unit.Definitionpred_empty : Pred
:= fun_ => Empty.(** ** Relationships between predicates *)Definitionpred_empty_subset (P : Pred) : pred_empty ⊆ P
:= fun_ => Empty_rec _.Definitionpred_unit_subset (P : Pred) : P ⊆ pred_unit
:= fun__ => tt.Definitionpred_and_subset_l (PQ : Pred) : pred_and P Q ⊆ P
:= fun_ => fst.Definitionpred_and_subset_r (PQ : Pred) : pred_and P Q ⊆ Q
:= fun_ => snd.Definitionpred_and_is_meet (PQR : Pred) (p : R ⊆ P) (q : R ⊆ Q)
: R ⊆ pred_and P Q
:= funar => ((p a r), (q a r)).Definitionpred_and_comm' (PQ : Pred)
: pred_and P Q ⊆ pred_and Q P
:= funapq => (snd pq, fst pq).Definitionpred_and_comm (PQ : Pred)
: pred_and P Q ↔ pred_and Q P
:= pred_subset_antisymm (pred_and_comm' P Q) (pred_and_comm' Q P).Definitionpred_or_is_join (PQR : Pred) (p : P ⊆ R) (q : Q ⊆ R)
: pred_or P Q ⊆ R
:= funapq => match pq with
| inl l => p a l
| inr r => q a r end.Definitionpred_or_comm' (PQ : Pred)
: pred_or P Q ⊆ pred_or Q P
:= funapq => match pq with
| inl p => inr p
| inr q => inl q end.Definitionpred_or_comm (PQ : Pred)
: pred_or P Q ↔ pred_or Q P
:= pred_subset_antisymm (pred_or_comm' P Q) (pred_or_comm' Q P).