Proposition monic_to_per_subobject_inv_laws : partial_setoid_morphism_laws ξ₂. Proof. unfold ξ₂. repeat split. - do 2 use forall_intro ; cbn. use impl_intro. use weaken_right. simplify. pose (y := π₂ (π₁ (tm_var ((𝟙 ×h Y) ×h X)))). pose (x := π₂ (tm_var ((𝟙 ×h Y) ×h X))). fold x y. use (partial_setoid_mor_dom_defined φ y x). apply hyperdoctrine_hyp. - do 2 use forall_intro ; cbn. use impl_intro. use weaken_right. simplify. pose (y := π₂ (π₁ (tm_var ((𝟙 ×h Y) ×h X)))). pose (x := π₂ (tm_var ((𝟙 ×h Y) ×h X))). fold x y. use to_subobject_to_partial_setoid_eq. + use (partial_setoid_mor_cod_defined φ y x). apply hyperdoctrine_hyp. + cbn ; unfold ζ. simplify. use exists_intro. { exact y. } simplify. apply hyperdoctrine_hyp. - do 4 use forall_intro ; cbn. use impl_intro. use weaken_right. do 2 use impl_intro. simplify. pose (y₁ := π₂ (π₁ (π₁ (π₁ (tm_var ((((𝟙 ×h Y) ×h Y) ×h X) ×h X)))))). pose (y₂ := π₂ (π₁ (π₁ (tm_var ((((𝟙 ×h Y) ×h Y) ×h X) ×h X))))). pose (x₁ := π₂ (π₁ (tm_var ((((𝟙 ×h Y) ×h Y) ×h X) ×h X)))). pose (x₂ := π₂ (tm_var ((((𝟙 ×h Y) ×h Y) ×h X) ×h X))). fold x₁ x₂ y₁ y₂. use partial_setoid_mor_eq_defined. + exact y₁. + exact x₁. + do 2 use weaken_left. apply hyperdoctrine_hyp. + use weaken_left. use weaken_right. use from_subobject_to_partial_setoid_eq. { apply monic_to_per_subobject. } apply hyperdoctrine_hyp. + use weaken_right. apply hyperdoctrine_hyp. - do 3 use forall_intro ; cbn. use impl_intro. use weaken_right. use impl_intro. simplify. pose (y := π₂ (π₁ (π₁ (tm_var (((𝟙 ×h Y) ×h X) ×h X))))). pose (x₁ := π₂ (π₁ (tm_var (((𝟙 ×h Y) ×h X) ×h X)))). pose (x₂ := π₂ (tm_var (((𝟙 ×h Y) ×h X) ×h X))). fold x₁ x₂ y. use to_subobject_to_partial_setoid_eq. + use (partial_setoid_mor_unique_im φ). * exact y. * use weaken_left. apply hyperdoctrine_hyp. * use weaken_right. apply hyperdoctrine_hyp. + cbn ; unfold ζ. simplify. use exists_intro. { exact y. } simplify. use weaken_left. apply hyperdoctrine_hyp. - use forall_intro ; cbn. use impl_intro. use weaken_right. use (exists_elim (partial_setoid_mor_hom_exists φ _)). + exact (π₂ (tm_var _)). + apply hyperdoctrine_hyp. + simplify_form. rewrite partial_setoid_subst. simplify. pose (y := π₂ (π₁ (tm_var ((𝟙 ×h Y) ×h X)))). pose (x := π₂ (tm_var ((𝟙 ×h Y) ×h X))). fold x y. use exists_intro. { exact x. } simplify. fold y. use weaken_right. apply hyperdoctrine_hyp. Qed.
Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Prelude. Require Import UniMath.CategoryTheory.Monics. Require Import UniMath.CategoryTheory.DisplayedCats.Core. Require Import UniMath.CategoryTheory.DisplayedCats.Functors. Require Import UniMath.CategoryTheory.DisplayedCats.Isos. Require Import UniMath.CategoryTheory.DisplayedCats.Examples.MonoCodomain. Require Import UniMath.CategoryTheory.DisplayedCats.MonoCodomain.FiberMonoCod. 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. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERCategory. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERMonomorphisms. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.Logic.SubobjectDispCat.