Proposition from_exp_partial_setoid_eq {Γ : ty H} {Δ : form Γ} {f g : tm Γ (ℙ (X ×h Y))} (p : Δ ⊢ exp_partial_setoid_eq [ ⟨ f , g ⟩ ]) {x : tm Γ X} {y : tm Γ Y} (q : Δ ⊢ ⟨ x , y ⟩ ∈ f) : Δ ⊢ ⟨ x , y ⟩ ∈ g. Proof. unfold exp_partial_setoid_eq in p. rewrite !forall_subst in p. pose proof (forall_elim p x) as p'. clear p ; rename p' into p. rewrite forall_subst in p. pose proof (forall_elim p y) as p'. clear p ; rename p' into p. refine (weaken_cut p _). simplify. use (iff_elim_left (weaken_right (hyperdoctrine_hyp _) _)). use weaken_left. exact q. 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.Tripos. Require Import UniMath.CategoryTheory.Hyperdoctrines.GenericPredicate. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERs. Require Import UniMath.CategoryTheory.Hyperdoctrines.PartialEqRels.PERMorphisms.