Definition nelstructontotal2 {X : UU} {n : nat} (P : X -> UU) (f : X -> nat) (sx : nelstruct n X) (fs : ∏ x : X, nelstruct (f x) (P x)) : nelstruct (stnsum (f ∘ sx)) (∑ (y : X), P y) := weqcomp (invweq (weqstnsum (P ∘ sx) (f ∘ sx) (fs ∘ sx))) (weqfp sx P).
Require Import UniMath.MoreFoundations.Tactics. Require Import UniMath.MoreFoundations.DecidablePropositions. Require Import UniMath.MoreFoundations.NegativePropositions. Require Import UniMath.MoreFoundations.Subtypes.