l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
⊢ (∃ xs,
      Realize φ
        (fun x =>
          Sum.elim (fun x => v x)
            (fun x =>
              xs
                (Fin.cast
                  (_ :
                    Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)) = Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))
                  ((Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))) x)))
            (f x))
        fun x => xs (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) x)) ↔
    ∃ i, Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
rw [← not_iff_not, not_exists, not_exists]
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
⊢ (∀ (x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M),
      ¬Realize φ
          (fun x_1 =>
            Sum.elim (fun x => v x)
              (fun x_2 =>
                x
                  (Fin.cast
                    (_ :
                      Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)) =
                        Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))
                    ((Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                      x_2)))
              (f x_1))
          fun x_1 => x (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) x_1)) ↔
    ∀ (x : γ → M), ¬Formula.Realize φ fun a => Sum.elim v x (f a)

Next tactic:
refine Equiv.forall_congr ?_ ?_
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · 

Proof state:
case refine_1
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
⊢ (Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M) ≃ (γ → M)

Next tactic:
exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by simp [Function.comp]⟩
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by 

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
x✝ : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M
⊢ (fun v => v ∘ ⇑e.symm) ((fun v => v ∘ ⇑e) x✝) = x✝

Next tactic:
simp [Function.comp]
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by 

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
x✝ : γ → M
⊢ (fun v => v ∘ ⇑e) ((fun v => v ∘ ⇑e.symm) x✝) = x✝

Next tactic:
simp [Function.comp]
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by simp [Function.comp]⟩
  · 

Proof state:
case refine_2
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
⊢ ∀ {x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M},
    (¬Realize φ
          (fun x_1 =>
            Sum.elim (fun x => v x)
              (fun x_2 =>
                x
                  (Fin.cast
                    (_ :
                      Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)) =
                        Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))
                    ((Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                      x_2)))
              (f x_1))
          fun x_1 => x (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) x_1)) ↔
      ¬Formula.Realize φ fun a =>
          Sum.elim v
            ({ toFun := fun v => v ∘ ⇑e, invFun := fun v => v ∘ ⇑e.symm,
                left_inv :=
                  (_ :
                    ∀ (x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M),
                      (fun x_1 =>
                          x
                            ((Classical.choice
                                (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                              ((Classical.choice
                                    (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))).symm
                                x_1))) =
                        x),
                right_inv :=
                  (_ :
                    ∀ (x : γ → M),
                      (fun x_1 =>
                          x
                            ((Classical.choice
                                  (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))).symm
                              ((Classical.choice
                                  (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                                x_1))) =
                        x) }
              x)
            (f a)

Next tactic:
intro x
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by simp [Function.comp]⟩
  · intro x
    

Proof state:
case refine_2
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M
⊢ (¬Realize φ
        (fun x_1 =>
          Sum.elim (fun x => v x)
            (fun x_2 =>
              x
                (Fin.cast
                  (_ :
                    Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)) = Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))
                  ((Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))) x_2)))
            (f x_1))
        fun x_1 => x (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) x_1)) ↔
    ¬Formula.Realize φ fun a =>
        Sum.elim v
          ({ toFun := fun v => v ∘ ⇑e, invFun := fun v => v ∘ ⇑e.symm,
              left_inv :=
                (_ :
                  ∀ (x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M),
                    (fun x_1 =>
                        x
                          ((Classical.choice
                              (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                            ((Classical.choice
                                  (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))).symm
                              x_1))) =
                      x),
              right_inv :=
                (_ :
                  ∀ (x : γ → M),
                    (fun x_1 =>
                        x
                          ((Classical.choice
                                (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))).symm
                            ((Classical.choice
                                (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                              x_1))) =
                      x) }
            x)
          (f a)

Next tactic:
rw [Formula.Realize, iff_iff_eq]
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by simp [Function.comp]⟩
  · intro x
    rw [Formula.Realize, iff_iff_eq]
    

Proof state:
case refine_2
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M
⊢ (¬Realize φ
        (fun x_1 =>
          Sum.elim (fun x => v x)
            (fun x_2 =>
              x
                (Fin.cast
                  (_ :
                    Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)) = Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))
                  ((Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))) x_2)))
            (f x_1))
        fun x_1 => x (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) x_1)) =
    ¬Realize φ
        (fun a =>
          Sum.elim v
            ({ toFun := fun v => v ∘ ⇑e, invFun := fun v => v ∘ ⇑e.symm,
                left_inv :=
                  (_ :
                    ∀ (x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M),
                      (fun x_1 =>
                          x
                            ((Classical.choice
                                (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                              ((Classical.choice
                                    (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))).symm
                                x_1))) =
                        x),
                right_inv :=
                  (_ :
                    ∀ (x : γ → M),
                      (fun x_1 =>
                          x
                            ((Classical.choice
                                  (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))).symm
                              ((Classical.choice
                                  (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))))))
                                x_1))) =
                        x) }
              x)
            (f a))
        default

Next tactic:
congr
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by simp [Function.comp]⟩
  · intro x
    rw [Formula.Realize, iff_iff_eq]
    congr
    · 

Proof state:
case refine_2.e_a.e__xs
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M
⊢ (fun x_1 => x (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) x_1)) = default

Next tactic:
funext i
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iExs
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iExs f).Realize v ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
  rw [Formula.iExs]
  simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  rw [← not_iff_not, not_exists, not_exists]
  refine Equiv.forall_congr ?_ ?_
  · exact ⟨fun v => v ∘ e, fun v => v ∘ e.symm,
      fun _ => by simp [Function.comp],
      fun _ => by simp [Function.comp]⟩
  · intro x
    rw [Formula.Realize, iff_iff_eq]
    congr
    · funext i
      

Proof state:
case refine_2.e_a.e__xs.h
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
e : γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) :=
  Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))))
x : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M
i : Fin 0
⊢ x (natAdd (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) i) = default i

Next tactic:
exact i.elim0
@[simp]
theorem realize_iExs [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iExs f) v v' ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
v' : Fin 0 → M
⊢ Realize (Formula.iExs f φ) v v' ↔ ∃ i, Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
rw [← Formula.realize_iExs, iff_iff_eq]
@[simp]
theorem realize_iExs [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iExs f) v v' ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  rw [← Formula.realize_iExs, iff_iff_eq]; 

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
v' : Fin 0 → M
⊢ Realize (Formula.iExs f φ) v v' = Formula.Realize (Formula.iExs (fun a => f a) φ) v

Next tactic:
congr
@[simp]
theorem realize_iExs [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iExs f) v v' ↔
      ∃ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  rw [← Formula.realize_iExs, iff_iff_eq]; congr; 

Proof state:
case e__xs
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝³ : Structure L M
inst✝² : Structure L N
inst✝¹ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
inst✝ : Finite γ
f : α → β ⊕ γ
φ : Formula L α
v : β → M
v' : Fin 0 → M
⊢ v' = default

Next tactic:
simp [eq_iff_true_of_subsingleton]
@[simp]
theorem realize_toFormula (φ : L.BoundedFormula α n) (v : Sum α (Fin n) → M) :
    φ.toFormula.Realize v ↔ φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr) := by
  

Proof state:
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
φ : BoundedFormula L α n
v : α ⊕ Fin n → M
⊢ Formula.Realize (toFormula φ) v ↔ Realize φ (v ∘ Sum.inl) (v ∘ Sum.inr)

Next tactic:
induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih3 a8 a9 a0
@[simp]
theorem realize_toFormula (φ : L.BoundedFormula α n) (v : Sum α (Fin n) → M) :
    φ.toFormula.Realize v ↔ φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr) := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih3 a8 a9 a0
  · 

Proof state:
case falsum
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
n✝ : ℕ
v : α ⊕ Fin n✝ → M
⊢ Formula.Realize (toFormula falsum) v ↔ Realize falsum (v ∘ Sum.inl) (v ∘ Sum.inr)

Next tactic:
rfl
@[simp]
theorem realize_toFormula (φ : L.BoundedFormula α n) (v : Sum α (Fin n) → M) :
    φ.toFormula.Realize v ↔ φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr) := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih3 a8 a9 a0
  · rfl
  · 

Proof state:
case equal
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
n✝ : ℕ
t₁✝ t₂✝ : Term L (α ⊕ Fin n✝)
v : α ⊕ Fin n✝ → M
⊢ Formula.Realize (toFormula (equal t₁✝ t₂✝)) v ↔ Realize (equal t₁✝ t₂✝) (v ∘ Sum.inl) (v ∘ Sum.inr)

Next tactic:
simp [BoundedFormula.Realize]
@[simp]
theorem realize_toFormula (φ : L.BoundedFormula α n) (v : Sum α (Fin n) → M) :
    φ.toFormula.Realize v ↔ φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr) := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih3 a8 a9 a0
  · rfl
  · simp [BoundedFormula.Realize]
  · 

Proof state:
case rel
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
n✝ l✝ : ℕ
R✝ : Relations L l✝
ts✝ : Fin l✝ → Term L (α ⊕ Fin n✝)
v : α ⊕ Fin n✝ → M
⊢ Formula.Realize (toFormula (rel R✝ ts✝)) v ↔ Realize (rel R✝ ts✝) (v ∘ Sum.inl) (v ∘ Sum.inr)

Next tactic:
simp [BoundedFormula.Realize]
@[simp]
theorem realize_toFormula (φ : L.BoundedFormula α n) (v : Sum α (Fin n) → M) :
    φ.toFormula.Realize v ↔ φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr) := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih3 a8 a9 a0
  · rfl
  · simp [BoundedFormula.Realize]
  · simp [BoundedFormula.Realize]
  · 

Proof state:
case imp
L : Language
L' : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
γ : Type u_3
n : ℕ
T : Theory L
n✝ : ℕ
f₁✝ f₂✝ : BoundedFormula L α n✝
ih1 : ∀ (v : α ⊕ Fin n✝ → M), Formula.Realize (toFormula f₁✝) v ↔ Realize f₁✝ (v ∘ Sum.inl) (v ∘ Sum.inr)
ih2 : ∀ (v : α ⊕ Fin n✝ → M), Formula.Realize (toFormula f₂✝) v ↔ Realize f₂✝ (v ∘ Sum.inl) (v ∘ Sum.inr)
v : α ⊕ Fin n✝ → M
⊢ Formula.Realize (toFormula (f₁✝ ⟹ f₂✝)) v ↔ Realize (f₁✝ ⟹ f₂✝) (v ∘ Sum.inl) (v ∘ Sum.inr)

Next tactic:
rw [toFormula, Formula.Realize, realize_imp, ← Formula.Realize, ih1, ← Formula.Realize, ih2,
      realize_imp]