Notation "'∀₁' x : A , B" := (Forall1 A (fun x => B)).Notation "A '⟶₁' B" := (Forall1 A (fun _ => B)).Notation "'λ₁' x , u" := (lam1 _ _ (fun x => u)).Notation "f '·₁' x" := (app1 _ _ f x).Notation "'∀₂' A , F" := (ForallU1 (fun A => F)).Notation "'λ₂' x , u" := (lamU1 _ (fun x => u)).Notation "f '·₁' [ A ]" := (appU1 _ f A).Notation U0 := (El1 u0).Notation "'∀₀' x : A , B" := (Forall0 A (fun x => B)).Notation "A '⟶₀' B" := (Forall0 A (fun _ => B)).Notation "'λ₀' x , u" := (lam0 _ _ (fun x => u)).Notation "f '·₀' x" := (app0 _ _ f x).Notation "'∀₀¹' A : U , F" := (ForallU0 U (fun A => F)).Notation "'λ₀¹' x , u" := (lamU0 _ _ (fun x => u)).Notation "f '·₀' [ A ]" := (appU0 _ _ f A).(** ** Automating the rewrite rules of our encoding. *)
Local Ltac simplify :=
  (* spiwack: ideally we could use [rewrite_strategy] here, but I am a tad
     scared of the idea of depending on setoid rewrite in such a simple
     file. *)
  (repeat rewrite ?beta1, ?betaU1);
  lazy beta.Local Ltac simplify_in h :=
  (repeat rewrite ?beta1, ?betaU1 in h);
  lazy beta in h.(** *** Preliminary definitions *)

Definition V : U1 := ∀₂ A, ((A ⟶₁ u0) ⟶₁ A ⟶₁ u0) ⟶₁ A ⟶₁ u0.Definition U : U1 := V ⟶₁ u0.Definition sb (z:El1 V) : El1 V := λ₂ A, λ₁ r, λ₁ a, r ·₁ (z·₁[A]·₁r) ·₁ a.Definition le (i:El1 (U⟶₁u0)) (x:El1 U) : U0 :=
  x ·₁ (λ₂ A, λ₁ r, λ₁ a, i ·₁ (λ₁ v, (sb v) ·₁ [A] ·₁ r ·₁ a)).Definition le' : El1 ((U⟶₁u0) ⟶₁ U ⟶₁ u0) := λ₁ i, λ₁ x, le i x.Definition induct (i:El1 (U⟶₁u0)) : U0 :=
  ∀₀¹ x:U, le i x ⟶₀ i ·₁ x.Definition WF : El1 U := λ₁ z, (induct (z·₁[U] ·₁ le')).Definition I (x:El1 U) : U0 :=
  (∀₀¹ i:U⟶₁u0, le i x ⟶₀ i ·₁ (λ₁ v, (sb v) ·₁ [U] ·₁ le' ·₁ x)) ⟶₀ F
.

Lemma lemma2 : El0 ((∀₀¹i:U⟶₁u0, induct i ⟶₀ i·₁WF) ⟶₀ F).