l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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 γ))
  

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)))))
⊢ Formula.Realize (Formula.iAlls f φ) v ↔ ∀ (i : γ → M), Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
rw [Formula.iAlls]
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  

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)))))
⊢ Formula.Realize
      (let e := Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))));
      alls (relabel (fun a => Sum.map id (⇑e) (f a)) φ))
      v ↔
    ∀ (i : γ → M), Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, 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 : Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n))) → M),
      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 : γ → M), Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
refine Equiv.forall_congr ?_ ?_
@[simp]
theorem _root_.FirstOrder.Language.Formula.realize_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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__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_iAlls
    [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} : (φ.iAlls 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.iAlls]
  simp only [Nat.add_zero, realize_alls, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]
  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__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_iAlls [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iAlls 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.iAlls f φ) v v' ↔ ∀ (i : γ → M), Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
rw [← Formula.realize_iAlls, iff_iff_eq]
@[simp]
theorem realize_iAlls [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iAlls f) v v' ↔
      ∀ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  rw [← Formula.realize_iAlls, 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.iAlls f φ) v v' = Formula.Realize (Formula.iAlls (fun a => f a) φ) v

Next tactic:
congr
@[simp]
theorem realize_iAlls [Finite γ] {f : α → β ⊕ γ}
    {φ : L.Formula α} {v : β → M} {v' : Fin 0 → M} :
    BoundedFormula.Realize (φ.iAlls f) v v' ↔
      ∀ (i : γ → M), φ.Realize (fun a => Sum.elim v i (f a)) := by
  rw [← Formula.realize_iAlls, 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 _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
  

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
⊢ Formula.Realize (Formula.iExs f φ) v ↔ ∃ i, Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin γ))
@[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 γ))
  

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)))))
⊢ Formula.Realize (Formula.iExs f φ) v ↔ ∃ i, Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
rw [Formula.iExs]
@[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]
  

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)))))
⊢ Formula.Realize
      (let e := Classical.choice (_ : Nonempty (γ ≃ Fin (Classical.choose (_ : ∃ n, Nonempty (γ ≃ Fin n)))));
      exs (relabel (fun a => Sum.map id (⇑e) (f a)) φ))
      v ↔
    ∃ i, Formula.Realize φ fun a => Sum.elim v i (f a)

Next tactic:
simp only [Nat.add_zero, realize_exs, realize_relabel, Function.comp,
    castAdd_zero, castIso_refl, OrderIso.refl_apply, Sum.elim_map, id_eq]