Library UniMath.CategoryTheory.Hyperdoctrines.GenericPredicate
Require Import UniMath.Foundations.All.
Require Import UniMath.MoreFoundations.All.
Require Import UniMath.CategoryTheory.Core.Prelude.
Require Import UniMath.CategoryTheory.DisplayedCats.Core.
Require Import UniMath.CategoryTheory.DisplayedCats.Isos.
Require Import UniMath.CategoryTheory.DisplayedCats.Univalence.
Require Import UniMath.CategoryTheory.DisplayedCats.Functors.
Require Import UniMath.CategoryTheory.DisplayedCats.Fibrations.
Require Import UniMath.CategoryTheory.DisplayedCats.Fiber.
Require Import UniMath.CategoryTheory.DisplayedCats.Projection.
Require Import UniMath.CategoryTheory.Hyperdoctrines.Hyperdoctrine.
Require Import UniMath.CategoryTheory.Hyperdoctrines.FirstOrderHyperdoctrine.
Require Import UniMath.CategoryTheory.Hyperdoctrines.Tripos.
Local Open Scope cat.
Local Open Scope hd.
Require Import UniMath.MoreFoundations.All.
Require Import UniMath.CategoryTheory.Core.Prelude.
Require Import UniMath.CategoryTheory.DisplayedCats.Core.
Require Import UniMath.CategoryTheory.DisplayedCats.Isos.
Require Import UniMath.CategoryTheory.DisplayedCats.Univalence.
Require Import UniMath.CategoryTheory.DisplayedCats.Functors.
Require Import UniMath.CategoryTheory.DisplayedCats.Fibrations.
Require Import UniMath.CategoryTheory.DisplayedCats.Fiber.
Require Import UniMath.CategoryTheory.DisplayedCats.Projection.
Require Import UniMath.CategoryTheory.Hyperdoctrines.Hyperdoctrine.
Require Import UniMath.CategoryTheory.Hyperdoctrines.FirstOrderHyperdoctrine.
Require Import UniMath.CategoryTheory.Hyperdoctrines.Tripos.
Local Open Scope cat.
Local Open Scope hd.
Definition is_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : ty H)
(prf : form Ω)
: UU
:= ∏ (Γ : ty H)
(φ : form Γ),
∑ (f : tm Γ Ω),
φ = prf [ f ].
Definition generic_predicate
(H : first_order_hyperdoctrine)
: UU
:= ∑ (Ω : ty H)
(prf : form Ω),
is_generic_predicate Ω prf.
Definition make_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : ty H)
(prf : form Ω)
(HΩ : is_generic_predicate Ω prf)
: generic_predicate H
:= Ω ,, prf ,, HΩ.
Coercion ty_of_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : generic_predicate H)
: ty H.
Proof.
exact (pr1 Ω).
{H : first_order_hyperdoctrine}
(Ω : ty H)
(prf : form Ω)
: UU
:= ∏ (Γ : ty H)
(φ : form Γ),
∑ (f : tm Γ Ω),
φ = prf [ f ].
Definition generic_predicate
(H : first_order_hyperdoctrine)
: UU
:= ∑ (Ω : ty H)
(prf : form Ω),
is_generic_predicate Ω prf.
Definition make_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : ty H)
(prf : form Ω)
(HΩ : is_generic_predicate Ω prf)
: generic_predicate H
:= Ω ,, prf ,, HΩ.
Coercion ty_of_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : generic_predicate H)
: ty H.
Proof.
exact (pr1 Ω).
Definition prf_of_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : generic_predicate H)
: form Ω
:= pr12 Ω.
Definition mor_to_generic_predicate
{H : first_order_hyperdoctrine}
(Ω : generic_predicate H)
{Γ : ty H}
(φ : form Γ)
: tm Γ Ω
:= pr1 (pr22 Ω Γ φ).
Proposition mor_to_generic_predicate_eq
{H : first_order_hyperdoctrine}
(Ω : generic_predicate H)
{Γ : ty H}
(φ : form Γ)
: φ
=
(prf_of_generic_predicate Ω) [ mor_to_generic_predicate Ω φ ].
Show proof.