Theorem: Set.definable_iff_finitely_definable
File: Mathlib/ModelTheory/Definability.lean

tactic: letI := Classical.decEq M
state_before: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
⊢ A.Definable L s ↔ ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s
state_after: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this : DecidableEq M := Classical.decEq M
⊢ A.Definable L s ↔ ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s

tactic: letI := Classical.decEq α
state_before: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this : DecidableEq M := Classical.decEq M
⊢ A.Definable L s ↔ ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s
state_after: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ A.Definable L s ↔ ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s

tactic: constructor
state_before: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ A.Definable L s ↔ ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s
state_after: case mp
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ A.Definable L s → ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s

case mpr
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ (∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s) → A.Definable L s

tactic: simp only [definable_iff_exists_formula_sum]
state_before: case mp
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ A.Definable L s → ∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s
state_after: case mp
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ (∃ φ, s = {v | φ.Realize (Sum.elim Subtype.val v)}) →
    ∃ A0, ↑A0 ⊆ A ∧ ∃ φ, s = {v | φ.Realize (Sum.elim Subtype.val v)}

tactic: rintro ⟨φ, rfl⟩
state_before: case mp
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ (∃ φ, s = {v | φ.Realize (Sum.elim Subtype.val v)}) →
    ∃ A0, ↑A0 ⊆ A ∧ ∃ φ, s = {v | φ.Realize (Sum.elim Subtype.val v)}
state_after: case mp.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
⊢ ∃ A0, ↑A0 ⊆ A ∧ ∃ φ_1, {v | φ.Realize (Sum.elim Subtype.val v)} = {v | φ_1.Realize (Sum.elim Subtype.val v)}

tactic: let A0 := (φ.freeVarFinset.preimage Sum.inl
  (Function.Injective.injOn Sum.inl_injective)).image Subtype.val
state_before: case mp.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
⊢ ∃ A0, ↑A0 ⊆ A ∧ ∃ φ_1, {v | φ.Realize (Sum.elim Subtype.val v)} = {v | φ_1.Realize (Sum.elim Subtype.val v)}
state_after: case mp.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
⊢ ∃ A0, ↑A0 ⊆ A ∧ ∃ φ_1, {v | φ.Realize (Sum.elim Subtype.val v)} = {v | φ_1.Realize (Sum.elim Subtype.val v)}

tactic: have hA0 : (A0 : Set M) ⊆ A := by simp [A0]
state_before: case mp.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
⊢ ∃ A0, ↑A0 ⊆ A ∧ ∃ φ_1, {v | φ.Realize (Sum.elim Subtype.val v)} = {v | φ_1.Realize (Sum.elim Subtype.val v)}
state_after: case mp.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
⊢ ∃ A0, ↑A0 ⊆ A ∧ ∃ φ_1, {v | φ.Realize (Sum.elim Subtype.val v)} = {v | φ_1.Realize (Sum.elim Subtype.val v)}

tactic: refine ⟨A0, hA0, (φ.restrictFreeVar
  (Set.inclusion (Set.Subset.refl _))).relabel ?_, ?_⟩
state_before: case mp.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
⊢ ∃ A0, ↑A0 ⊆ A ∧ ∃ φ_1, {v | φ.Realize (Sum.elim Subtype.val v)} = {v | φ_1.Realize (Sum.elim Subtype.val v)}
state_after: case mp.intro.refine_1
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
⊢ (↑fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0

case mp.intro.refine_2
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
⊢ {v | φ.Realize (Sum.elim Subtype.val v)} =
    {v |
      Formula.Realize (BoundedFormula.relabel ?mp.intro.refine_1 (BoundedFormula.restrictFreeVar φ (inclusion ⋯)))
        (Sum.elim Subtype.val v)}

tactic: simp [A0]
state_before: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
⊢ ↑A0 ⊆ A
state_after: no goals

tactic: rintro ⟨a | a, ha⟩
state_before: case mp.intro.refine_1
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
⊢ (↑fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0
state_after: case mp.intro.refine_1.mk.inl
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
a : ↑A
ha : Sum.inl a ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ (↑↑A0 ⊕ α) ⊕ Fin 0

case mp.intro.refine_1.mk.inr
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
a : α
ha : Sum.inr a ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ (↑↑A0 ⊕ α) ⊕ Fin 0

tactic: exact Sum.inl (Sum.inl ⟨a, by simpa [A0] using ha⟩)
state_before: case mp.intro.refine_1.mk.inl
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
a : ↑A
ha : Sum.inl a ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ (↑↑A0 ⊕ α) ⊕ Fin 0
state_after: no goals

tactic: simpa [A0] using ha
state_before: M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
a : ↑A
ha : Sum.inl a ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ ↑a ∈ ↑A0
state_after: no goals

tactic: exact Sum.inl (Sum.inr a)
state_before: case mp.intro.refine_1.mk.inr
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
a : α
ha : Sum.inr a ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ (↑↑A0 ⊕ α) ⊕ Fin 0
state_after: no goals

tactic: ext v
state_before: case mp.intro.refine_2
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
⊢ {v | φ.Realize (Sum.elim Subtype.val v)} =
    {v |
      Formula.Realize
        (BoundedFormula.relabel
          (fun a =>
            Subtype.casesOn a fun val ha =>
              Sum.casesOn (motive := fun x =>
                (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0) val
                (fun a ha => Sum.inl (Sum.inl ⟨↑a, ⋯⟩)) (fun a ha => Sum.inl (Sum.inr a)) ha)
          (BoundedFormula.restrictFreeVar φ (inclusion ⋯)))
        (Sum.elim Subtype.val v)}
state_after: case mp.intro.refine_2.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ v ∈ {v | φ.Realize (Sum.elim Subtype.val v)} ↔
    v ∈
      {v |
        Formula.Realize
          (BoundedFormula.relabel
            (fun a =>
              Subtype.casesOn a fun val ha =>
                Sum.casesOn (motive := fun x =>
                  (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0) val
                  (fun a ha => Sum.inl (Sum.inl ⟨↑a, ⋯⟩)) (fun a ha => Sum.inl (Sum.inr a)) ha)
            (BoundedFormula.restrictFreeVar φ (inclusion ⋯)))
          (Sum.elim Subtype.val v)}

tactic: simp only [Formula.Realize, BoundedFormula.realize_relabel,
  Set.mem_setOf_eq]
state_before: case mp.intro.refine_2.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ v ∈ {v | φ.Realize (Sum.elim Subtype.val v)} ↔
    v ∈
      {v |
        Formula.Realize
          (BoundedFormula.relabel
            (fun a =>
              Subtype.casesOn a fun val ha =>
                Sum.casesOn (motive := fun x =>
                  (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0) val
                  (fun a ha => Sum.inl (Sum.inl ⟨↑a, ⋯⟩)) (fun a ha => Sum.inl (Sum.inr a)) ha)
            (BoundedFormula.restrictFreeVar φ (inclusion ⋯)))
          (Sum.elim Subtype.val v)}
state_after: case mp.intro.refine_2.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ BoundedFormula.Realize φ (Sum.elim Subtype.val v) default ↔
    (BoundedFormula.restrictFreeVar φ (inclusion ⋯)).Realize
      (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
        Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
          (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯)
      (default ∘ Fin.natAdd 0)

tactic: apply Iff.symm
state_before: case mp.intro.refine_2.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ BoundedFormula.Realize φ (Sum.elim Subtype.val v) default ↔
    (BoundedFormula.restrictFreeVar φ (inclusion ⋯)).Realize
      (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
        Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
          (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯)
      (default ∘ Fin.natAdd 0)
state_after: case mp.intro.refine_2.h.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ (BoundedFormula.restrictFreeVar φ (inclusion ⋯)).Realize
      (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
        Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
          (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯)
      (default ∘ Fin.natAdd 0) ↔
    BoundedFormula.Realize φ (Sum.elim Subtype.val v) default

tactic: convert BoundedFormula.realize_restrictFreeVar _
state_before: case mp.intro.refine_2.h.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ (BoundedFormula.restrictFreeVar φ (inclusion ⋯)).Realize
      (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
        Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
          (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯)
      (default ∘ Fin.natAdd 0) ↔
    BoundedFormula.Realize φ (Sum.elim Subtype.val v) default
state_after: case h.e'_1.h.e'_7
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
      Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
        (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯) =
    Sum.elim Subtype.val v ∘ Subtype.val

tactic: ext a
state_before: case h.e'_1.h.e'_7
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
⊢ (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
      Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
        (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯) =
    Sum.elim Subtype.val v ∘ Subtype.val
state_after: case h.e'_1.h.e'_7.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
a : ↑fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
        Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
          (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯)
      a =
    (Sum.elim Subtype.val v ∘ Subtype.val) a

tactic: rcases a with ⟨_ | _, _⟩ <;> simp
state_before: case h.e'_1.h.e'_7.h
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
φ : L.Formula (↑A ⊕ α)
A0 : Finset M := Finset.image Subtype.val ((BoundedFormula.freeVarFinset φ).preimage Sum.inl ⋯)
hA0 : ↑A0 ⊆ A
v : α → M
a : ↑fun x => x ∈ (BoundedFormula.freeVarFinset φ).val
⊢ (Sum.elim (Sum.elim Subtype.val v) (default ∘ Fin.castAdd 0) ∘ fun a =>
        Sum.rec (motive := fun x => (x ∈ fun x => x ∈ (BoundedFormula.freeVarFinset φ).val) → (↑↑A0 ⊕ α) ⊕ Fin 0)
          (fun val ha => Sum.inl (Sum.inl ⟨↑val, ⋯⟩)) (fun val ha => Sum.inl (Sum.inr val)) ↑a ⋯)
      a =
    (Sum.elim Subtype.val v ∘ Subtype.val) a
state_after: no goals

tactic: rintro ⟨A0, hA0, hd⟩
state_before: case mpr
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
⊢ (∃ A0, ↑A0 ⊆ A ∧ (↑A0).Definable L s) → A.Definable L s
state_after: case mpr.intro.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
A0 : Finset M
hA0 : ↑A0 ⊆ A
hd : (↑A0).Definable L s
⊢ A.Definable L s

tactic: exact Definable.mono hd hA0
state_before: case mpr.intro.intro
M : Type w
A : Set M
L : Language
inst✝ : L.Structure M
α : Type u₁
β : Type u_1
B : Set M
s : Set (α → M)
this✝ : DecidableEq M := Classical.decEq M
this : DecidableEq α := Classical.decEq α
A0 : Finset M
hA0 : ↑A0 ⊆ A
hd : (↑A0).Definable L s
⊢ A.Definable L s
state_after: no goals