proposition: Lemma Dyck_modify_tcount l (s:= (Dyck_modify l)) : DP_balanced l -> ~~nilp ((DP_splita l).1) -> ((DP_Tcount s).+1 == DP_Tcount l) && (DP_Fcount s == (DP_Tcount l).+1).
proof: Proof. move => /eqP ha hb. suff hd: (DP_Tcount s).+1 = DP_Tcount l. have hc: (DP_Tcount s) + (DP_Fcount s) = (DP_Tcount l) + (DP_Fcount l). by rewrite !DP_count Dyck_modify_size. by rewrite hd eqxx /=; move /eqP:hc; rewrite - {1} hd ha addSnnS eqn_add2l. move:(DP_splita_correct l). rewrite ha /= (negbTE hb) /= => /andP[hc /andP[/eqP hd _]]. rewrite -(DP_splita_recover l) /s /Dyck_modify /DP_Tcount /DP_Fcount. by rewrite !count_cat -addSn (swap_but_last_count hc) -/(DP_Tcount _) hd. Qed.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype) mathcomp(ssrnat seq path div) mathcomp(fintype tuple finfun bigop finset binomial)