l3lab/ntp-mathlib huggingface dataset:
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    

Proof state:
case intro.h_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : b ∈ fix f a
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
b✝ : β
heq✝ : Part.get (f a) h₂ = Sum.inl b✝
h₃ : b ∈ Part.some b✝
⊢ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'
case intro.h_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : b ∈ fix f a
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
a'✝ : α
heq✝ : Part.get (f a) h₂ = Sum.inr a'✝
h₃ :
  b ∈
    WellFounded.fixF
      (fun a IH =>
        Part.assert (f a).Dom fun hf =>
          match e : Part.get (f a) hf with
          | Sum.inl b => Part.some b
          | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
      a'✝ (_ : Acc (fun y x => Sum.inr y ∈ f x) a'✝)
⊢ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'

Next tactic:
next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : b ∈ fix f a
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
b✝ : β
e : Part.get (f a) h₂ = Sum.inl b✝
h₃ : b ∈ Part.some b✝
⊢ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'

Next tactic:
simp only [Part.mem_some_iff] at h₃
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : b ∈ fix f a
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
b✝ : β
e : Part.get (f a) h₂ = Sum.inl b✝
h₃ : b = b✝
⊢ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'

Next tactic:
subst b
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
b✝ : β
e : Part.get (f a) h₂ = Sum.inl b✝
h : b✝ ∈ fix f a
⊢ Sum.inl b✝ ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b✝ ∈ fix f a'

Next tactic:
exact Or.inl ⟨h₂, e⟩
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    

Proof state:
case intro.h_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : b ∈ fix f a
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
a'✝ : α
heq✝ : Part.get (f a) h₂ = Sum.inr a'✝
h₃ :
  b ∈
    WellFounded.fixF
      (fun a IH =>
        Part.assert (f a).Dom fun hf =>
          match e : Part.get (f a) hf with
          | Sum.inl b => Part.some b
          | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
      a'✝ (_ : Acc (fun y x => Sum.inr y ∈ f x) a'✝)
⊢ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'

Next tactic:
next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : b ∈ fix f a
h₁ : Acc (fun x y => Sum.inr x ∈ f y) a
h₂ : (f a).Dom
a'✝ : α
e : Part.get (f a) h₂ = Sum.inr a'✝
h₃ :
  b ∈
    WellFounded.fixF
      (fun a IH =>
        Part.assert (f a).Dom fun hf =>
          match e : Part.get (f a) hf with
          | Sum.inl b => Part.some b
          | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
      a'✝ (_ : Acc (fun y x => Sum.inr y ∈ f x) a'✝)
⊢ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'

Next tactic:
exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'
⊢ b ∈ fix f a

Next tactic:
simp only [fix, Part.mem_assert_iff]
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h : Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ fix f a'
⊢ ∃ (h : Acc (fun x y => Sum.inr x ∈ f y) a),
    b ∈
      WellFounded.fixF
        (fun a IH =>
          Part.assert (f a).Dom fun hf =>
            match e : Part.get (f a) hf with
            | Sum.inl b => Part.some b
            | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
        a h

Next tactic:
rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · 

Proof state:
case inl.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
⊢ ∃ (h : Acc (fun x y => Sum.inr x ∈ f y) a),
    b ∈
      WellFounded.fixF
        (fun a IH =>
          Part.assert (f a).Dom fun hf =>
            match e : Part.get (f a) hf with
            | Sum.inl b => Part.some b
            | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
        a h

Next tactic:
refine' ⟨⟨_, fun y h' => _⟩, _⟩
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · 

Proof state:
case inl.intro.refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
y : α
h' : Sum.inr y ∈ f a
⊢ Acc (fun x y => Sum.inr x ∈ f y) y

Next tactic:
injection Part.mem_unique ⟨h₁, h₂⟩ h'
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · 

Proof state:
case inl.intro.refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
⊢ b ∈
    WellFounded.fixF
      (fun a IH =>
        Part.assert (f a).Dom fun hf =>
          match e : Part.get (f a) hf with
          | Sum.inl b => Part.some b
          | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
      a (_ : Acc (fun x y => Sum.inr x ∈ f y) a)

Next tactic:
rw [WellFounded.fixFEq]
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        

Proof state:
case inl.intro.refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
⊢ b ∈
    Part.assert (f a).Dom fun hf =>
      match e : Part.get (f a) hf with
      | Sum.inl b => Part.some b
      | Sum.inr a' =>
        (fun y p =>
            WellFounded.fixF
              (fun a IH =>
                Part.assert (f a).Dom fun hf =>
                  match e : Part.get (f a) hf with
                  | Sum.inl b => Part.some b
                  | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
              y (_ : Acc (fun y x => Sum.inr y ∈ f x) y))
          a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a')

Next tactic:
apply Part.mem_assert h₁
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        

Proof state:
case inl.intro.refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
⊢ b ∈
    match e : Part.get (f a) h₁ with
    | Sum.inl b => Part.some b
    | Sum.inr a' =>
      (fun y p =>
          WellFounded.fixF
            (fun a IH =>
              Part.assert (f a).Dom fun hf =>
                match e : Part.get (f a) hf with
                | Sum.inl b => Part.some b
                | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
            y (_ : Acc (fun y x => Sum.inr y ∈ f x) y))
        a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a')

Next tactic:
split
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        

Proof state:
case inl.intro.refine'_2.h_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
b✝ : β
heq✝ : Part.get (f a) h₁ = Sum.inl b✝
⊢ b ∈ Part.some b✝
case inl.intro.refine'_2.h_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
a'✝ : α
heq✝ : Part.get (f a) h₁ = Sum.inr a'✝
⊢ b ∈
    (fun y p =>
        WellFounded.fixF
          (fun a IH =>
            Part.assert (f a).Dom fun hf =>
              match e : Part.get (f a) hf with
              | Sum.inl b => Part.some b
              | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
          y (_ : Acc (fun y x => Sum.inr y ∈ f x) y))
      a'✝ (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'✝)

Next tactic:
next e =>
          injection h₂.symm.trans e with h; simp [h]
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        next e =>
          

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
b✝ : β
e : Part.get (f a) h₁ = Sum.inl b✝
⊢ b ∈ Part.some b✝

Next tactic:
injection h₂.symm.trans e with h
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        next e =>
          injection h₂.symm.trans e with h; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
b✝ : β
e : Part.get (f a) h₁ = Sum.inl b✝
h : b = b✝
⊢ b ∈ Part.some b✝

Next tactic:
simp [h]
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        next e =>
          injection h₂.symm.trans e with h; simp [h]
        

Proof state:
case inl.intro.refine'_2.h_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
a'✝ : α
heq✝ : Part.get (f a) h₁ = Sum.inr a'✝
⊢ b ∈
    (fun y p =>
        WellFounded.fixF
          (fun a IH =>
            Part.assert (f a).Dom fun hf =>
              match e : Part.get (f a) hf with
              | Sum.inl b => Part.some b
              | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
          y (_ : Acc (fun y x => Sum.inr y ∈ f x) y))
      a'✝ (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'✝)

Next tactic:
next e =>
          injection h₂.symm.trans e
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        next e =>
          injection h₂.symm.trans e with h; simp [h]
        next e =>
          

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
h₁ : (f a).Dom
h₂ : Part.get (f a) h₁ = Sum.inl b
a'✝ : α
e : Part.get (f a) h₁ = Sum.inr a'✝
⊢ b ∈
    (fun y p =>
        WellFounded.fixF
          (fun a IH =>
            Part.assert (f a).Dom fun hf =>
              match e : Part.get (f a) hf with
              | Sum.inl b => Part.some b
              | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
          y (_ : Acc (fun y x => Sum.inr y ∈ f x) y))
      a'✝ (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'✝)

Next tactic:
injection h₂.symm.trans e
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        next e =>
          injection h₂.symm.trans e with h; simp [h]
        next e =>
          injection h₂.symm.trans e
    · 

Proof state:
case inr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
a' : α
h : Sum.inr a' ∈ f a
h₃ : b ∈ fix f a'
⊢ ∃ (h : Acc (fun x y => Sum.inr x ∈ f y) a),
    b ∈
      WellFounded.fixF
        (fun a IH =>
          Part.assert (f a).Dom fun hf =>
            match e : Part.get (f a) hf with
            | Sum.inl b => Part.some b
            | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
        a h

Next tactic:
simp [fix] at h₃
theorem mem_fix_iff {f : α →. Sum β α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a' :=
  ⟨fun h => by
    let ⟨h₁, h₂⟩ := Part.mem_assert_iff.1 h
    rw [WellFounded.fixFEq] at h₂
    simp only [Part.mem_assert_iff] at h₂
    cases' h₂ with h₂ h₃
    split at h₃
    next e => simp only [Part.mem_some_iff] at h₃; subst b; exact Or.inl ⟨h₂, e⟩
    next e => exact Or.inr ⟨_, ⟨_, e⟩, Part.mem_assert _ h₃⟩,
   fun h => by
    simp only [fix, Part.mem_assert_iff]
    rcases h with (⟨h₁, h₂⟩ | ⟨a', h, h₃⟩)
    · refine' ⟨⟨_, fun y h' => _⟩, _⟩
      · injection Part.mem_unique ⟨h₁, h₂⟩ h'
      · rw [WellFounded.fixFEq]
        -- Porting note: used to be simp [h₁, h₂]
        apply Part.mem_assert h₁
        split
        next e =>
          injection h₂.symm.trans e with h; simp [h]
        next e =>
          injection h₂.symm.trans e
    · simp [fix] at h₃
      

Proof state:
case inr.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ι : Type u_6
f : α →. β ⊕ α
a : α
b : β
a' : α
h : Sum.inr a' ∈ f a
h₃ :
  ∃ (h : Acc (fun x y => Sum.inr x ∈ f y) a'),
    b ∈
      WellFounded.fixF
        (fun a IH =>
          Part.assert (f a).Dom fun hf =>
            match e : Part.get (f a) hf with
            | Sum.inl b => Part.some b
            | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
        a' h
⊢ ∃ (h : Acc (fun x y => Sum.inr x ∈ f y) a),
    b ∈
      WellFounded.fixF
        (fun a IH =>
          Part.assert (f a).Dom fun hf =>
            match e : Part.get (f a) hf with
            | Sum.inl b => Part.some b
            | Sum.inr a' => IH a' (_ : ∃ (h : (f a).Dom), Part.get (f a) h = Sum.inr a'))
        a h

Next tactic:
cases' h₃ with h₃ h₄