proposition: Lemma leftmost_poly_var_contains_poly_arr {s x s' t'} : leftmost_poly_var s = Some x -> contains s (poly_arr s' t') -> exists n'' s'' t'', s = many_poly_abs n'' (poly_arr s'' t'').
proof: Proof. have [n'' [s'' [?]]] := many_poly_absI s. subst. case Es'': (s''); [ move=> _ | by move=> *; do 3 eexists | by move=> /=]. rewrite leftmost_poly_var_many_poly_abs /=. move=> [?]. subst => /contains_tidyI. rewrite tidy_many_poly_abs_le /=; first by lia. by move=> /containsE. 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