Proposition per_subobject_disj_subst {Γ₁ Γ₂ : partial_setoid H} (s : partial_setoid_morphism Γ₁ Γ₂) (ψ₁ ψ₂ : per_subobject Γ₂) : per_subobject_mor_law (id_partial_setoid_morphism Γ₁) (per_subobject_subst s (per_subobject_disj ψ₁ ψ₂)) (per_subobject_disj (per_subobject_subst s ψ₁) (per_subobject_subst s ψ₂)). Proof. do 2 use forall_intro. use impl_intro. use weaken_right. use impl_intro. cbn. rewrite partial_setoid_subst. rewrite !exists_subst. use hyp_sym. use (exists_elim (weaken_left (hyperdoctrine_hyp _) _)). rewrite !conj_subst. use hyp_ltrans. use weaken_right. simplify_form. rewrite !partial_setoid_subst. simplify. pose (γ₁ := π₂ (π₁ (π₁ (tm_var (((𝟙 ×h Γ₁) ×h Γ₁) ×h Γ₂))))). pose (γ₁' := π₂ (π₁ (tm_var (((𝟙 ×h Γ₁) ×h Γ₁) ×h Γ₂)))). pose (γ₂ := π₂ (tm_var (((𝟙 ×h Γ₁) ×h Γ₁) ×h Γ₂))). fold γ₁ γ₁' γ₂. use hyp_rtrans. use hyp_sym. use (disj_elim (weaken_left (hyperdoctrine_hyp _) _)). - use hyp_ltrans. use weaken_right. use disj_intro_left. use exists_intro. + exact γ₂. + simplify. fold γ₁'. use conj_intro. * use weaken_left. use (partial_setoid_mor_eq_defined s). ** exact γ₁. ** exact γ₂. ** use weaken_left. apply hyperdoctrine_hyp. ** use weaken_right. exact (partial_setoid_mor_cod_defined s _ _ (hyperdoctrine_hyp _)). ** use weaken_right. apply hyperdoctrine_hyp. * use weaken_right. apply hyperdoctrine_hyp. - use hyp_ltrans. use weaken_right. use disj_intro_right. use exists_intro. + exact γ₂. + simplify. fold γ₁'. use conj_intro. * use weaken_left. use (partial_setoid_mor_eq_defined s). ** exact γ₁. ** exact γ₂. ** use weaken_left. apply hyperdoctrine_hyp. ** use weaken_right. exact (partial_setoid_mor_cod_defined s _ _ (hyperdoctrine_hyp _)). ** use weaken_right. apply hyperdoctrine_hyp. * use weaken_right. apply hyperdoctrine_hyp. Qed.
Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Prelude. Require Import UniMath.CategoryTheory.DisplayedCats.Core. Require Import UniMath.CategoryTheory.DisplayedCats.Fibrations. Require Import UniMath.CategoryTheory.DisplayedCats.Fiber. Require Import UniMath.CategoryTheory.DisplayedCats.Fiberwise.FiberwiseCoproducts. 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.Logic.SubobjectDispCat.