Definition subst_slice {Γ:SET_over_sort}(N : wellsorted_in Γ) (M : wellsorted_in (sorted_option_functor (sort_in N) Γ)): wellsorted_in Γ. Proof. set (aux0 := (CategoryTheory.Monads.η T Γ)). set (auxf := BinCoproductArrow _ (BC _ _) (aux_inject_N N) (CategoryTheory.Monads.η T Γ)). refine (bind_slice (pr1 auxf) _ M). intro a. simpl in a. induction a as [a | a]. + now idtac. + generalize (ii2(A:=unit) a). clear a. apply toforallpaths. change ((BinCoproductArrow HSET (BinCoproductsHSET 1%CS (pr1 Γ)) (λ _ : unit, N) (pr1 ((Monads.η T) Γ))) · sort_in = BinCoproductArrow HSET (BinCoproductsHSET 1%CS (pr1 Γ)) (λ _ : unit, sort_in N) (pr2 Γ)). rewrite postcompWithBinCoproductArrow. apply map_on_two_paths. - apply idpath. - set (aux1 := pr2 ((Monads.η T) Γ)). apply pathsinv0. now (etrans; try eapply aux1). Defined.
Require Import UniMath.Foundations.Sets. Require Import UniMath.MoreFoundations.Tactics. Require Import UniMath.CategoryTheory.Core.Categories. Require Import UniMath.CategoryTheory.Core.Functors. Require Import UniMath.CategoryTheory.Core.NaturalTransformations. Require Import UniMath.CategoryTheory.Limits.BinCoproducts. Require Import UniMath.CategoryTheory.Limits.Terminal. Require Import UniMath.CategoryTheory.Monads.Monads. Require Import UniMath.CategoryTheory.Categories.HSET.Core. Require Import UniMath.CategoryTheory.Categories.HSET.Colimits. Require Import UniMath.CategoryTheory.Categories.HSET.Limits. Require Import UniMath.CategoryTheory.Categories.HSET.Slice. Require Import UniMath.CategoryTheory.slicecat.