Section LU2SemiU_to_SysF_TYP.
Variables SUs SUt0 SUt1 : SU.term. (* semi-unification instance *)
(* construct polymorphic type from semi-unification term *)
Fixpoint SU_term_to_poly_type (s: SU.term) :=
match s with
| SU.atom n => poly_var n
| SU.arr s t => poly_arr (SU_term_to_poly_type s) (SU_term_to_poly_type t)
end.
Definition SUs' := SU_term_to_poly_type SUs.
Definition SUt0' := SU_term_to_poly_type SUt0.
Definition SUt1' := SU_term_to_poly_type SUt1.
Definition N_W := pure_abs (many_pure_app (pure_var 2) [pure_var 0; pure_var 0]).
(* x (\z.y z z) as given by Wells *)
Definition M_W : pure_term := many_pure_app (pure_var 0) [N_W].
Definition t_0_W := (poly_arr (poly_arr (poly_var 0) (poly_var 0)) (poly_var 1)).
Definition t_1_W := poly_arr (poly_arr SUt0' SUt0') (poly_arr (poly_arr SUt1' SUt1') (poly_arr SUs' SUs')).
Definition n_W : nat := locked (poly_var_bound t_1_W).
(* similar to Wells' construction ∀((α -> α) -> β) ; ∀ .. ∀ (t1 -> t1) -> (t2 -> t2) -> (s -> s) *)
Definition Gamma_W : list poly_type := [poly_abs (poly_abs t_0_W); many_poly_abs n_W t_1_W].

Lemma closed_t_1_W : allfv_poly_type (gt n_W) t_1_W.