Proposition id_partial_setoid_morphism_laws {H : first_order_hyperdoctrine} (X : partial_setoid H) : partial_setoid_morphism_laws (id_partial_setoid_morphism_form X). Proof. repeat split. - unfold partial_setoid_mor_dom_defined_law. pose (T := X). pose (x := π₂ (π₁ (tm_var ((𝟙 ×h T) ×h T)))). pose (y := π₂ (tm_var ((𝟙 ×h T) ×h T))). unfold T in *. fold x y. cbn. use forall_intro. use forall_intro. use impl_intro. use weaken_right. rewrite partial_setoid_subst. simplify. exact (partial_setoid_refl_l (hyperdoctrine_hyp _)). - unfold partial_setoid_mor_cod_defined_law. pose (T := X). pose (x := π₂ (π₁ (tm_var ((𝟙 ×h T) ×h T)))). pose (y := π₂ (tm_var ((𝟙 ×h T) ×h T))). unfold T in *. fold x y. cbn. use forall_intro. use forall_intro. use impl_intro. use weaken_right. rewrite partial_setoid_subst. simplify. exact (partial_setoid_refl_r (hyperdoctrine_hyp _)). - unfold partial_setoid_mor_eq_defined_law. pose (T := X). pose (x₁ := π₂ (π₁ (π₁ (π₁ (tm_var ((((𝟙 ×h T) ×h T) ×h T) ×h T)))))). pose (x₂ := π₂ (π₁ (π₁ (tm_var ((((𝟙 ×h T) ×h T) ×h T) ×h T))))). pose (y₁ := π₂ (π₁ (tm_var ((((𝟙 ×h T) ×h T) ×h T) ×h T)))). pose (y₂ := π₂ (tm_var ((((𝟙 ×h T) ×h T) ×h T) ×h T))). unfold T in *. fold x₁ x₂ y₁ y₂. cbn. use forall_intro. use forall_intro. use forall_intro. use forall_intro. use impl_intro. use weaken_right. use impl_intro. use impl_intro. rewrite !partial_setoid_subst. simplify. use partial_setoid_trans. + exact x₁. + use partial_setoid_sym. do 2 use weaken_left. use hyperdoctrine_hyp. + use partial_setoid_trans. * exact y₁. * use weaken_right. use hyperdoctrine_hyp. * use weaken_left. use weaken_right. use hyperdoctrine_hyp. - unfold partial_setoid_mor_unique_im_law. pose (T := X). pose (x := π₂ (π₁ (π₁ (tm_var (((𝟙 ×h T) ×h T) ×h T))))). pose (y₁ := π₂ (π₁ (tm_var (((𝟙 ×h T) ×h T) ×h T)))). pose (y₂ := π₂ (tm_var (((𝟙 ×h T) ×h T) ×h T))). unfold T in *. fold x y₁ y₂. cbn. use forall_intro. use forall_intro. use forall_intro. use impl_intro. use weaken_right. use impl_intro. rewrite !partial_setoid_subst. simplify. use partial_setoid_trans. + exact x. + use partial_setoid_sym. use weaken_left. use hyperdoctrine_hyp. + use weaken_right. use hyperdoctrine_hyp. - unfold partial_setoid_mor_hom_exists_law. pose (T := X). pose (x := π₂ (tm_var (𝟙 ×h T))). pose (y := π₂ (tm_var ((𝟙 ×h T) ×h T))). unfold T in *. fold x y. cbn. use forall_intro. use impl_intro. use weaken_right. rewrite partial_setoid_subst. simplify. use exists_intro. + exact x. + unfold y. rewrite partial_setoid_subst. simplify. use hyperdoctrine_hyp. Qed.
Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Prelude. Require Import UniMath.CategoryTheory.Hyperdoctrines.Hyperdoctrine. Require Import UniMath.CategoryTheory.Hyperdoctrines.FirstOrderHyperdoctrine. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERs. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERMorphisms.