-- Mathlib/Algebra/Field/Subfield/Basic.lean
theorem closure_induction {s : Set K} {p : ∀ x ∈ closure s, Prop}
    (mem : ∀ x hx, p x (subset_closure hx))
    (one : p 1 (one_mem _)) (add : ∀ x y hx hy, p x hx → p y hy → p (x + y) (add_mem hx hy))
    (neg : ∀ x hx, p x hx → p (-x) (neg_mem hx)) (inv : ∀ x hx, p x hx → p x⁻¹ (inv_mem hx))
    (mul : ∀ x y hx hy, p x hx → p y hy → p (x * y) (mul_mem hx hy))
    {x} (h : x ∈ closure s) : p x h :=
  letI : Subfield K :=
    { carrier := {x | ∃ hx, p x hx}
      mul_mem'

Proof state:
K : Type u
inst✝ : DivisionRing K
s : Set K
p : (x : K) → x ∈ closure s → Prop
mem : ∀ (x : K) (hx : x ∈ s), p x ⋯
one : p 1 ⋯
add : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x + y) ⋯
neg : ∀ (x : K) (hx : x ∈ closure s), p x hx → p (-x) ⋯
inv : ∀ (x : K) (hx : x ∈ closure s), p x hx → p x⁻¹ ⋯
mul : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x * y) ⋯
x : K
h : x ∈ closure s
⊢ ∀ {a b : K},
    a ∈ { carrier := {x | ∃ (hx : x ∈ closure s), p x hx}, mul_mem' := ⋯, one_mem' := ⋯ }.carrier →
      b ∈ { carrier := {x | ∃ (hx : x ∈ closure s), p x hx}, mul_mem' := ⋯, one_mem' := ⋯ }.carrier →
        a + b ∈ { carrier := {x | ∃ (hx : x ∈ closure s), p x hx}, mul_mem' := ⋯, one_mem' := ⋯ }.carrier

Tactic:
rintro _ _ ⟨_, hx⟩ ⟨_, hy⟩

Result:
case intro.intro
K : Type u
inst✝ : DivisionRing K
s : Set K
p : (x : K) → x ∈ closure s → Prop
mem : ∀ (x : K) (hx : x ∈ s), p x ⋯
one : p 1 ⋯
add : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x + y) ⋯
neg : ∀ (x : K) (hx : x ∈ closure s), p x hx → p (-x) ⋯
inv : ∀ (x : K) (hx : x ∈ closure s), p x hx → p x⁻¹ ⋯
mul : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x * y) ⋯
x : K
h : x ∈ closure s
a✝ b✝ : K
w✝¹ : a✝ ∈ closure s
hx : p a✝ w✝¹
w✝ : b✝ ∈ closure s
hy : p b✝ w✝
⊢ a✝ + b✝ ∈ { carrier := {x | ∃ (hx : x ∈ closure s), p x hx}, mul_mem' := ⋯, one_mem' := ⋯ }.carrier

Proof state:
case intro
K : Type u
inst✝ : DivisionRing K
s : Set K
p : (x : K) → x ∈ closure s → Prop
mem : ∀ (x : K) (hx : x ∈ s), p x ⋯
one : p 1 ⋯
add : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x + y) ⋯
neg : ∀ (x : K) (hx : x ∈ closure s), p x hx → p (-x) ⋯
inv : ∀ (x : K) (hx : x ∈ closure s), p x hx → p x⁻¹ ⋯
mul : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x * y) ⋯
x : K
h : x ∈ closure s
x✝ : K
w✝ : x✝ ∈ closure s
hx : p x✝ w✝
⊢ x✝⁻¹ ∈
    { carrier := {x | ∃ (hx : x ∈ closure s), p x hx}, mul_mem' := ⋯, one_mem' := ⋯, add_mem' := ⋯, zero_mem' := ⋯,
        neg_mem' := ⋯ }.carrier

Tactic:
exact ⟨_, inv _ _ hx⟩

Result:
no goals

Proof state:
case intro.intro
K : Type u
inst✝ : DivisionRing K
s : Set K
p : (x : K) → x ∈ closure s → Prop
mem : ∀ (x : K) (hx : x ∈ s), p x ⋯
one : p 1 ⋯
add : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x + y) ⋯
neg : ∀ (x : K) (hx : x ∈ closure s), p x hx → p (-x) ⋯
inv : ∀ (x : K) (hx : x ∈ closure s), p x hx → p x⁻¹ ⋯
mul : ∀ (x y : K) (hx : x ∈ closure s) (hy : y ∈ closure s), p x hx → p y hy → p (x * y) ⋯
x : K
h : x ∈ closure s
a✝ b✝ : K
w✝¹ : a✝ ∈ closure s
hx : p a✝ w✝¹
w✝ : b✝ ∈ closure s
hy : p b✝ w✝
⊢ a✝ * b✝ ∈ {x | ∃ (hx : x ∈ closure s), p x hx}

Tactic:
exact ⟨_, mul _ _ _ _ hx hy⟩

Result:
no goals