proposition: Lemma leftmost_path_length_subst_poly_type {σ t} : leftmost_path_length (subst_poly_type σ t) = (if leftmost_poly_var t is Some x then leftmost_path_length (σ x) else 0) + leftmost_path_length t.
proof: Proof. elim: t σ; [done | by move=> ? + ? _ ? /= => -> |]. move=> t + σ /= => ->. case: (leftmost_poly_var t); last done. move=> [|x] /=; first done. by rewrite /funcomp /= leftmost_path_length_ren_poly_type. Qed.
imports: List Lia Relation_Definitions Relation_Operators Operators_Properties Undecidability.SystemF.SysF Undecidability.SystemF.Autosubst.syntax Undecidability.SystemF.Autosubst.unscoped Undecidability.SystemF.Util(Facts poly_type_facts pure_term_facts term_facts typing_facts iipc2_facts pure_typing_facts) ssreflect ssrbool ssrfun