-- Module: Mathlib.Data.PFun
Goal:
α : Type u_1
β : Type u_2
C : α → Sort u_7
f : α →. β ⊕ α
b : β
a : α
H : (a' : α) → b ∈ f.fix a' → ((a'' : α) → Sum.inr a'' ∈ f a' → C a'') → C a'
pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a
pf_1 :
  ∀ (a : α) (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y),
    Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) a
pf_2 :
  ∀ (pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a) (a : α)
    (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y)
    (h₂ :
      Membership.mem (γ := Part β)
        (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
            (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
              (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                  match (motive := β ⊕ α → Part β) e : (f a).get hf with
                  | Sum.inl b => Part.some b
                  | Sum.inr a' => IH a' ⋯ :
                Part β))
            a ⋯ :
          Part β)
        b),
    b ∈ f.fix a
pf_3 :
  ∀ (pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a) (a : α)
    (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y) (h : b ∈ f.fix a) (a' : α)
    (fa' : Sum.inr a' ∈ f a),
    Membership.mem (γ := Part β)
      (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
          (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
            (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                match (motive := β ⊕ α → Part β) e : (f a).get hf with
                | Sum.inl b => Part.some b
                | Sum.inr a' => IH a' ⋯ :
              Part β))
          a' ⋯ :
        Part β)
      b
x : α
h_1 : ∀ (y : α), Sum.inr y ∈ f x → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y
h_ih :
  ∀ (y : α) (a : Sum.inr y ∈ f x) (h : b ∈ f.fix y)
    (pf_7 :
      Membership.mem (γ := Part β)
        (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
            (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
              (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                  match (motive := β ⊕ α → Part β) e : (f a).get hf with
                  | Sum.inl b => Part.some b
                  | Sum.inr a' => IH a' ⋯ :
                Part β))
            y ⋯ :
          Part β)
        b)
    (pf_8 : ∀ (x : α) (h' : Sum.inr x ∈ f y), Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) x)
    (pf_9 :
      ∀ (x : α) (h' : Sum.inr x ∈ f y),
        Membership.mem (γ := Part β)
          (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
              (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                    match (motive := β ⊕ α → Part β) e : (f a).get hf with
                    | Sum.inl b => Part.some b
                    | Sum.inr a' => IH a' ⋯ :
                  Part β))
              x ⋯ :
            Part β)
          b),
    (have h₂ := pf_7;
      (fun (pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a)
            (pf_10 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y)
            (h₂ :
              Membership.mem (γ := Part β)
                (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                    (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                      (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                          match (motive := β ⊕ α → Part β) e : (f a).get hf with
                          | Sum.inl b => Part.some b
                          | Sum.inr a' => IH a' ⋯ :
                        Part β))
                    y pf_10 :
                  Part β)
                b) ↦
          (Acc.rec (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (motive :=
              fun {a : α} (pf_11 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) a) ↦
              (h₂ :
                  Membership.mem (γ := Part β)
                    (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                        (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                          (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                              match (motive := β ⊕ α → Part β) e : (f a).get hf with
                              | Sum.inl b => Part.some b
                              | Sum.inr a' => IH a' ⋯ :
                            Part β))
                        a pf_11 :
                      Part β)
                    b) →
                C a)
              (fun (a : α) (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y)
                  (IH :
                    (y : α) →
                      (a : Sum.inr y ∈ f a) →
                        (h₂ :
                            Membership.mem (γ := Part β)
                              (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                                  (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                                    (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                        match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                        | Sum.inl b => Part.some b
                                        | Sum.inr a' => IH a' ⋯ :
                                      Part β))
                                  y ⋯ :
                                Part β)
                              b) →
                          C y)
                  (h₂ :
                    Membership.mem (γ := Part β)
                      (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                          (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                            (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                | Sum.inl b => Part.some b
                                | Sum.inr a' => IH a' ⋯ :
                              Part β))
                          a ⋯ :
                        Part β)
                      b) ↦
                have h := ⋯;
                H a h fun (a' : α) (fa' : Sum.inr a' ∈ f a) ↦ IH a' fa' ⋯)
              pf_10 h₂ :
            C y))
        pf ⋯ h₂) =
      H y h fun (x : α) (h' : Sum.inr x ∈ f y) ↦
        have h₂ := ⋯;
        (fun (pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a)
              (pf_10 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) x)
              (h₂ :
                Membership.mem (γ := Part β)
                  (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                      (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                        (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                            match (motive := β ⊕ α → Part β) e : (f a).get hf with
                            | Sum.inl b => Part.some b
                            | Sum.inr a' => IH a' ⋯ :
                          Part β))
                      x pf_10 :
                    Part β)
                  b) ↦
            (Acc.rec (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (motive :=
                fun {a : α} (pf_11 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) a) ↦
                (h₂ :
                    Membership.mem (γ := Part β)
                      (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                          (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                            (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                | Sum.inl b => Part.some b
                                | Sum.inr a' => IH a' ⋯ :
                              Part β))
                          a pf_11 :
                        Part β)
                      b) →
                  (fun (x : α) ↦ C x) a)
                (fun (a : α) (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y)
                    (IH :
                      (y : α) →
                        (a : Sum.inr y ∈ f a) →
                          (h₂ :
                              Membership.mem (γ := Part β)
                                (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                                    (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                                      (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                          match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                          | Sum.inl b => Part.some b
                                          | Sum.inr a' => IH a' ⋯ :
                                        Part β))
                                    y ⋯ :
                                  Part β)
                                b) →
                            (fun (x : α) ↦ C x) y)
                    (h₂ :
                      Membership.mem (γ := Part β)
                        (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                            (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                              (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                  match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                  | Sum.inl b => Part.some b
                                  | Sum.inr a' => IH a' ⋯ :
                                Part β))
                            a ⋯ :
                          Part β)
                        b) ↦
                  have h := ⋯;
                  H a h fun (a' : α) (fa' : Sum.inr a' ∈ f a) ↦ IH a' fa' ⋯)
                pf_10 h₂ :
              (fun (x : α) ↦ C x) x))
          pf ⋯ h₂
h : b ∈ f.fix x
pf_4 :
  Membership.mem (γ := Part β)
    (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
        (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
          (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
              match (motive := β ⊕ α → Part β) e : (f a).get hf with
              | Sum.inl b => Part.some b
              | Sum.inr a' => IH a' ⋯ :
            Part β))
        x ⋯ :
      Part β)
    b
pf_5 : ∀ (x_1 : α) (h' : Sum.inr x_1 ∈ f x), Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) x_1
pf_6 :
  ∀ (x_1 : α) (h' : Sum.inr x_1 ∈ f x),
    Membership.mem (γ := Part β)
      (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
          (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
            (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                match (motive := β ⊕ α → Part β) e : (f a).get hf with
                | Sum.inl b => Part.some b
                | Sum.inr a' => IH a' ⋯ :
              Part β))
          x_1 ⋯ :
        Part β)
      b
⊢ (have h₂ := pf_4;
    (fun (pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a)
          (pf_7 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) x)
          (h₂ :
            Membership.mem (γ := Part β)
              (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                  (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                    (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                        match (motive := β ⊕ α → Part β) e : (f a).get hf with
                        | Sum.inl b => Part.some b
                        | Sum.inr a' => IH a' ⋯ :
                      Part β))
                  x pf_7 :
                Part β)
              b) ↦
        (Acc.rec (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (motive :=
            fun {a : α} (pf_8 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) a) ↦
            (h₂ :
                Membership.mem (γ := Part β)
                  (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                      (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                        (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                            match (motive := β ⊕ α → Part β) e : (f a).get hf with
                            | Sum.inl b => Part.some b
                            | Sum.inr a' => IH a' ⋯ :
                          Part β))
                      a pf_8 :
                    Part β)
                  b) →
              C a)
            (fun (a : α) (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y)
                (IH :
                  (y : α) →
                    (a : Sum.inr y ∈ f a) →
                      (h₂ :
                          Membership.mem (γ := Part β)
                            (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                                (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                                  (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                      match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                      | Sum.inl b => Part.some b
                                      | Sum.inr a' => IH a' ⋯ :
                                    Part β))
                                y ⋯ :
                              Part β)
                            b) →
                        C y)
                (h₂ :
                  Membership.mem (γ := Part β)
                    (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                        (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                          (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                              match (motive := β ⊕ α → Part β) e : (f a).get hf with
                              | Sum.inl b => Part.some b
                              | Sum.inr a' => IH a' ⋯ :
                            Part β))
                        a ⋯ :
                      Part β)
                    b) ↦
              have h := ⋯;
              H a h fun (a' : α) (fa' : Sum.inr a' ∈ f a) ↦ IH a' fa' ⋯)
            pf_7 h₂ :
          C x))
      pf ⋯ h₂) =
    H x h fun (x_1 : α) (h' : Sum.inr x_1 ∈ f x) ↦
      have h₂ := ⋯;
      (fun (pf : ∀ (a : α) (hf : (f a).Dom) (a' : α) (e : (f a).get hf = Sum.inr a'), Sum.inr a' ∈ f a)
            (pf_7 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) x_1)
            (h₂ :
              Membership.mem (γ := Part β)
                (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                    (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                      (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                          match (motive := β ⊕ α → Part β) e : (f a).get hf with
                          | Sum.inl b => Part.some b
                          | Sum.inr a' => IH a' ⋯ :
                        Part β))
                    x_1 pf_7 :
                  Part β)
                b) ↦
          (Acc.rec (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (motive :=
              fun {a : α} (pf_8 : Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) a) ↦
              (h₂ :
                  Membership.mem (γ := Part β)
                    (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                        (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                          (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                              match (motive := β ⊕ α → Part β) e : (f a).get hf with
                              | Sum.inl b => Part.some b
                              | Sum.inr a' => IH a' ⋯ :
                            Part β))
                        a pf_8 :
                      Part β)
                    b) →
                (fun (x : α) ↦ C x) a)
              (fun (a : α) (ha : ∀ (y : α), Sum.inr y ∈ f a → Acc (fun (x y : α) ↦ Sum.inr x ∈ f y) y)
                  (IH :
                    (y : α) →
                      (a : Sum.inr y ∈ f a) →
                        (h₂ :
                            Membership.mem (γ := Part β)
                              (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                                  (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                                    (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                        match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                        | Sum.inl b => Part.some b
                                        | Sum.inr a' => IH a' ⋯ :
                                      Part β))
                                  y ⋯ :
                                Part β)
                              b) →
                          (fun (x : α) ↦ C x) y)
                  (h₂ :
                    Membership.mem (γ := Part β)
                      (WellFounded.fixF (r := fun (x y : α) ↦ Sum.inr x ∈ f y) (C := fun (a : α) ↦ Part β)
                          (fun (a : α) (IH : (y : α) → Sum.inr y ∈ f a → Part β) ↦
                            (Part.assert (f a).Dom fun (hf : (f a).Dom) ↦
                                match (motive := β ⊕ α → Part β) e : (f a).get hf with
                                | Sum.inl b => Part.some b
                                | Sum.inr a' => IH a' ⋯ :
                              Part β))
                          a ⋯ :
                        Part β)
                      b) ↦
                have h := ⋯;
                H a h fun (a' : α) (fa' : Sum.inr a' ∈ f a) ↦ IH a' fa' ⋯)
              pf_7 h₂ :
            (fun (x : α) ↦ C x) x_1))
        pf ⋯ h₂

Tactic:
rfl