l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem Hom.realize_term (g : M →[L] N) {t : L.Term α} {v : α → M} :
    t.realize (g ∘ v) = g (t.realize v) := by
  induction t
  · rfl
  · rw [Term.realize, Term.realize, g.map_fun]
    

Proof state:
case func
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
g : M →[L] N
v : α → M
l✝ : ℕ
_f✝ : Functions L l✝
_ts✝ : Fin l✝ → Term L α
_ts_ih✝ : ∀ (a : Fin l✝), Term.realize (⇑g ∘ v) (_ts✝ a) = g (Term.realize v (_ts✝ a))
⊢ (funMap _f✝ fun i => Term.realize (⇑g ∘ v) (_ts✝ i)) = funMap _f✝ (⇑g ∘ fun i => Term.realize v (_ts✝ i))

Next tactic:
refine' congr rfl _
@[simp]
theorem Hom.realize_term (g : M →[L] N) {t : L.Term α} {v : α → M} :
    t.realize (g ∘ v) = g (t.realize v) := by
  induction t
  · rfl
  · rw [Term.realize, Term.realize, g.map_fun]
    refine' congr rfl _
    

Proof state:
case func
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
g : M →[L] N
v : α → M
l✝ : ℕ
_f✝ : Functions L l✝
_ts✝ : Fin l✝ → Term L α
_ts_ih✝ : ∀ (a : Fin l✝), Term.realize (⇑g ∘ v) (_ts✝ a) = g (Term.realize v (_ts✝ a))
⊢ (fun i => Term.realize (⇑g ∘ v) (_ts✝ i)) = ⇑g ∘ fun i => Term.realize v (_ts✝ i)

Next tactic:
ext x
@[simp]
theorem Hom.realize_term (g : M →[L] N) {t : L.Term α} {v : α → M} :
    t.realize (g ∘ v) = g (t.realize v) := by
  induction t
  · rfl
  · rw [Term.realize, Term.realize, g.map_fun]
    refine' congr rfl _
    ext x
    

Proof state:
case func.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
g : M →[L] N
v : α → M
l✝ : ℕ
_f✝ : Functions L l✝
_ts✝ : Fin l✝ → Term L α
_ts_ih✝ : ∀ (a : Fin l✝), Term.realize (⇑g ∘ v) (_ts✝ a) = g (Term.realize v (_ts✝ a))
x : Fin l✝
⊢ Term.realize (⇑g ∘ v) (_ts✝ x) = (⇑g ∘ fun i => Term.realize v (_ts✝ i)) x

Next tactic:
simp [*]
@[simp]
theorem realize_top : (⊤ : L.BoundedFormula α l).Realize v xs ↔ True := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize ⊤ v xs ↔ True

Next tactic:
simp [Top.top]
@[simp]
theorem realize_inf : (φ ⊓ ψ).Realize v xs ↔ φ.Realize v xs ∧ ψ.Realize v xs := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize (φ ⊓ ψ) v xs ↔ Realize φ v xs ∧ Realize ψ v xs

Next tactic:
simp [Inf.inf, Realize]
@[simp]
theorem realize_foldr_inf (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊓ ·) ⊤).Realize v xs ↔ ∀ φ ∈ l, BoundedFormula.Realize φ v xs := 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 l✝ : ℕ
φ ψ : BoundedFormula L α l✝
θ : BoundedFormula L α (Nat.succ l✝)
v✝ : α → M
xs✝ : Fin l✝ → M
l : List (BoundedFormula L α n)
v : α → M
xs : Fin n → M
⊢ Realize (List.foldr (fun x x_1 => x ⊓ x_1) ⊤ l) v xs ↔ ∀ φ ∈ l, Realize φ v xs

Next tactic:
induction' l with φ l ih
@[simp]
theorem realize_foldr_inf (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊓ ·) ⊤).Realize v xs ↔ ∀ φ ∈ l, BoundedFormula.Realize φ v xs := by
  induction' l with φ l ih
  · 

Proof state:
case nil
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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
v : α → M
xs : Fin n → M
⊢ Realize (List.foldr (fun x x_1 => x ⊓ x_1) ⊤ []) v xs ↔ ∀ φ ∈ [], Realize φ v xs

Next tactic:
simp
@[simp]
theorem realize_foldr_inf (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊓ ·) ⊤).Realize v xs ↔ ∀ φ ∈ l, BoundedFormula.Realize φ v xs := by
  induction' l with φ l ih
  · simp
  · 

Proof state:
case cons
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 l✝ : ℕ
φ✝ ψ : BoundedFormula L α l✝
θ : BoundedFormula L α (Nat.succ l✝)
v✝ : α → M
xs✝ : Fin l✝ → M
v : α → M
xs : Fin n → M
φ : BoundedFormula L α n
l : List (BoundedFormula L α n)
ih : Realize (List.foldr (fun x x_1 => x ⊓ x_1) ⊤ l) v xs ↔ ∀ φ ∈ l, Realize φ v xs
⊢ Realize (List.foldr (fun x x_1 => x ⊓ x_1) ⊤ (φ :: l)) v xs ↔ ∀ φ_1 ∈ φ :: l, Realize φ_1 v xs

Next tactic:
simp [ih]
@[simp]
theorem realize_imp : (φ.imp ψ).Realize v xs ↔ φ.Realize v xs → ψ.Realize v xs := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize (φ ⟹ ψ) v xs ↔ Realize φ v xs → Realize ψ v xs

Next tactic:
simp only [Realize]
@[simp]
theorem realize_rel₁ {R : L.Relations 1} {t : L.Term _} :
    (R.boundedFormula₁ t).Realize v xs ↔ RelMap R ![t.realize (Sum.elim v xs)] := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 1
t : Term L (α ⊕ Fin l)
⊢ Realize (Relations.boundedFormula₁ R t) v xs ↔ RelMap R ![realize (Sum.elim v xs) t]

Next tactic:
rw [Relations.boundedFormula₁, realize_rel, iff_eq_eq]
@[simp]
theorem realize_rel₁ {R : L.Relations 1} {t : L.Term _} :
    (R.boundedFormula₁ t).Realize v xs ↔ RelMap R ![t.realize (Sum.elim v xs)] := by
  rw [Relations.boundedFormula₁, realize_rel, iff_eq_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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 1
t : Term L (α ⊕ Fin l)
⊢ (RelMap R fun i => realize (Sum.elim v xs) (Matrix.vecCons t ![] i)) = RelMap R ![realize (Sum.elim v xs) t]

Next tactic:
refine' congr rfl (funext fun _ => _)
@[simp]
theorem realize_rel₁ {R : L.Relations 1} {t : L.Term _} :
    (R.boundedFormula₁ t).Realize v xs ↔ RelMap R ![t.realize (Sum.elim v xs)] := by
  rw [Relations.boundedFormula₁, realize_rel, iff_eq_eq]
  refine' congr rfl (funext fun _ => _)
  

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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 1
t : Term L (α ⊕ Fin l)
x✝ : Fin 1
⊢ realize (Sum.elim v xs) (Matrix.vecCons t ![] x✝) = Matrix.vecCons (realize (Sum.elim v xs) t) ![] x✝

Next tactic:
simp only [Matrix.cons_val_fin_one]
@[simp]
theorem realize_rel₂ {R : L.Relations 2} {t₁ t₂ : L.Term _} :
    (R.boundedFormula₂ t₁ t₂).Realize v xs ↔
      RelMap R ![t₁.realize (Sum.elim v xs), t₂.realize (Sum.elim v xs)] := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 2
t₁ t₂ : Term L (α ⊕ Fin l)
⊢ Realize (Relations.boundedFormula₂ R t₁ t₂) v xs ↔ RelMap R ![realize (Sum.elim v xs) t₁, realize (Sum.elim v xs) t₂]

Next tactic:
rw [Relations.boundedFormula₂, realize_rel, iff_eq_eq]
@[simp]
theorem realize_rel₂ {R : L.Relations 2} {t₁ t₂ : L.Term _} :
    (R.boundedFormula₂ t₁ t₂).Realize v xs ↔
      RelMap R ![t₁.realize (Sum.elim v xs), t₂.realize (Sum.elim v xs)] := by
  rw [Relations.boundedFormula₂, realize_rel, iff_eq_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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 2
t₁ t₂ : Term L (α ⊕ Fin l)
⊢ (RelMap R fun i => realize (Sum.elim v xs) (Matrix.vecCons t₁ ![t₂] i)) =
    RelMap R ![realize (Sum.elim v xs) t₁, realize (Sum.elim v xs) t₂]

Next tactic:
refine' congr rfl (funext (Fin.cases _ _))
@[simp]
theorem realize_rel₂ {R : L.Relations 2} {t₁ t₂ : L.Term _} :
    (R.boundedFormula₂ t₁ t₂).Realize v xs ↔
      RelMap R ![t₁.realize (Sum.elim v xs), t₂.realize (Sum.elim v xs)] := by
  rw [Relations.boundedFormula₂, realize_rel, iff_eq_eq]
  refine' congr rfl (funext (Fin.cases _ _))
  · 

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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 2
t₁ t₂ : Term L (α ⊕ Fin l)
⊢ realize (Sum.elim v xs) (Matrix.vecCons t₁ ![t₂] 0) =
    Matrix.vecCons (realize (Sum.elim v xs) t₁) ![realize (Sum.elim v xs) t₂] 0

Next tactic:
simp only [Matrix.cons_val_zero]
@[simp]
theorem realize_rel₂ {R : L.Relations 2} {t₁ t₂ : L.Term _} :
    (R.boundedFormula₂ t₁ t₂).Realize v xs ↔
      RelMap R ![t₁.realize (Sum.elim v xs), t₂.realize (Sum.elim v xs)] := by
  rw [Relations.boundedFormula₂, realize_rel, iff_eq_eq]
  refine' congr rfl (funext (Fin.cases _ _))
  · simp only [Matrix.cons_val_zero]
  · 

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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
R : Relations L 2
t₁ t₂ : Term L (α ⊕ Fin l)
⊢ ∀ (i : Fin 1),
    realize (Sum.elim v xs) (Matrix.vecCons t₁ ![t₂] (succ i)) =
      Matrix.vecCons (realize (Sum.elim v xs) t₁) ![realize (Sum.elim v xs) t₂] (succ i)

Next tactic:
simp only [Matrix.cons_val_succ, Matrix.cons_val_fin_one, forall_const]
@[simp]
theorem realize_sup : (φ ⊔ ψ).Realize v xs ↔ φ.Realize v xs ∨ ψ.Realize v xs := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize (φ ⊔ ψ) v xs ↔ Realize φ v xs ∨ Realize ψ v xs

Next tactic:
simp only [realize, Sup.sup, realize_not, eq_iff_iff]
@[simp]
theorem realize_sup : (φ ⊔ ψ).Realize v xs ↔ φ.Realize v xs ∨ ψ.Realize v xs := by
  simp only [realize, Sup.sup, realize_not, eq_iff_iff]
  

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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize (∼φ ⟹ ψ) v xs ↔ Realize φ v xs ∨ Realize ψ v xs

Next tactic:
tauto
@[simp]
theorem realize_foldr_sup (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊔ ·) ⊥).Realize v xs ↔ ∃ φ ∈ l, BoundedFormula.Realize φ v xs := 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 l✝ : ℕ
φ ψ : BoundedFormula L α l✝
θ : BoundedFormula L α (Nat.succ l✝)
v✝ : α → M
xs✝ : Fin l✝ → M
l : List (BoundedFormula L α n)
v : α → M
xs : Fin n → M
⊢ Realize (List.foldr (fun x x_1 => x ⊔ x_1) ⊥ l) v xs ↔ ∃ φ ∈ l, Realize φ v xs

Next tactic:
induction' l with φ l ih
@[simp]
theorem realize_foldr_sup (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊔ ·) ⊥).Realize v xs ↔ ∃ φ ∈ l, BoundedFormula.Realize φ v xs := by
  induction' l with φ l ih
  · 

Proof state:
case nil
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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
v : α → M
xs : Fin n → M
⊢ Realize (List.foldr (fun x x_1 => x ⊔ x_1) ⊥ []) v xs ↔ ∃ φ ∈ [], Realize φ v xs

Next tactic:
simp
@[simp]
theorem realize_foldr_sup (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊔ ·) ⊥).Realize v xs ↔ ∃ φ ∈ l, BoundedFormula.Realize φ v xs := by
  induction' l with φ l ih
  · simp
  · 

Proof state:
case cons
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 l✝ : ℕ
φ✝ ψ : BoundedFormula L α l✝
θ : BoundedFormula L α (Nat.succ l✝)
v✝ : α → M
xs✝ : Fin l✝ → M
v : α → M
xs : Fin n → M
φ : BoundedFormula L α n
l : List (BoundedFormula L α n)
ih : Realize (List.foldr (fun x x_1 => x ⊔ x_1) ⊥ l) v xs ↔ ∃ φ ∈ l, Realize φ v xs
⊢ Realize (List.foldr (fun x x_1 => x ⊔ x_1) ⊥ (φ :: l)) v xs ↔ ∃ φ_1 ∈ φ :: l, Realize φ_1 v xs

Next tactic:
simp_rw [List.foldr_cons, realize_sup, ih, List.mem_cons, or_and_right, exists_or,
      exists_eq_left]
@[simp]
theorem realize_ex : θ.ex.Realize v xs ↔ ∃ a : M, θ.Realize v (Fin.snoc xs 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize (∃'θ) v xs ↔ ∃ a, Realize θ v (snoc xs a)

Next tactic:
rw [BoundedFormula.ex, realize_not, realize_all, not_forall]
@[simp]
theorem realize_ex : θ.ex.Realize v xs ↔ ∃ a : M, θ.Realize v (Fin.snoc xs a) := by
  rw [BoundedFormula.ex, realize_not, realize_all, not_forall]
  

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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ (∃ x, ¬Realize (∼θ) v (snoc xs x)) ↔ ∃ a, Realize θ v (snoc xs a)

Next tactic:
simp_rw [realize_not, Classical.not_not]
@[simp]
theorem realize_iff : (φ.iff ψ).Realize v xs ↔ (φ.Realize v xs ↔ ψ.Realize v xs) := 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 l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v : α → M
xs : Fin l → M
⊢ Realize (φ ⇔ ψ) v xs ↔ (Realize φ v xs ↔ Realize ψ v xs)

Next tactic:
simp only [BoundedFormula.iff, realize_inf, realize_imp, and_imp, ← iff_def]
theorem realize_castLE_of_eq {m n : ℕ} (h : m = n) {h' : m ≤ n} {φ : L.BoundedFormula α m}
    {v : α → M} {xs : Fin n → M} : (φ.castLE h').Realize v xs ↔ φ.Realize v (xs ∘ cast h) := 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✝ l : ℕ
φ✝ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
m n : ℕ
h : m = n
h' : m ≤ n
φ : BoundedFormula L α m
v : α → M
xs : Fin n → M
⊢ Realize (castLE h' φ) v xs ↔ Realize φ v (xs ∘ Fin.cast h)

Next tactic:
subst h
theorem realize_castLE_of_eq {m n : ℕ} (h : m = n) {h' : m ≤ n} {φ : L.BoundedFormula α m}
    {v : α → M} {xs : Fin n → M} : (φ.castLE h').Realize v xs ↔ φ.Realize v (xs ∘ cast h) := by
  subst h
  

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 l : ℕ
φ✝ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
m : ℕ
φ : BoundedFormula L α m
v : α → M
h' : m ≤ m
xs : Fin m → M
⊢ Realize (castLE h' φ) v xs ↔ Realize φ v (xs ∘ Fin.cast (_ : m = m))

Next tactic:
simp only [castLE_rfl, cast_refl, OrderIso.coe_refl, Function.comp.right_id]
theorem realize_mapTermRel_id [L'.Structure M]
    {ft : ∀ n, L.Term (Sum α (Fin n)) → L'.Term (Sum β (Fin n))}
    {fr : ∀ n, L.Relations n → L'.Relations n} {n} {φ : L.BoundedFormula α n} {v : α → M}
    {v' : β → M} {xs : Fin n → M}
    (h1 :
      ∀ (n) (t : L.Term (Sum α (Fin n))) (xs : Fin n → M),
        (ft n t).realize (Sum.elim v' xs) = t.realize (Sum.elim v xs))
    (h2 : ∀ (n) (R : L.Relations n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x) :
    (φ.mapTermRel ft fr fun _ => id).Realize v' xs ↔ φ.Realize v xs := 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✝ l : ℕ
φ✝ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
inst✝ : Structure L' M
ft : (n : ℕ) → Term L (α ⊕ Fin n) → Term L' (β ⊕ Fin n)
fr : (n : ℕ) → Relations L n → Relations L' n
n : ℕ
φ : BoundedFormula L α n
v : α → M
v' : β → M
xs : Fin n → M
h1 : ∀ (n : ℕ) (t : Term L (α ⊕ Fin n)) (xs : Fin n → M), realize (Sum.elim v' xs) (ft n t) = realize (Sum.elim v xs) t
h2 : ∀ (n : ℕ) (R : Relations L n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x
⊢ Realize (mapTermRel ft fr (fun x => id) φ) v' xs ↔ Realize φ v xs

Next tactic:
induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih
theorem realize_mapTermRel_id [L'.Structure M]
    {ft : ∀ n, L.Term (Sum α (Fin n)) → L'.Term (Sum β (Fin n))}
    {fr : ∀ n, L.Relations n → L'.Relations n} {n} {φ : L.BoundedFormula α n} {v : α → M}
    {v' : β → M} {xs : Fin n → M}
    (h1 :
      ∀ (n) (t : L.Term (Sum α (Fin n))) (xs : Fin n → M),
        (ft n t).realize (Sum.elim v' xs) = t.realize (Sum.elim v xs))
    (h2 : ∀ (n) (R : L.Relations n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x) :
    (φ.mapTermRel ft fr fun _ => id).Realize v' xs ↔ φ.Realize v xs := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih
  · 

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✝¹ l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
inst✝ : Structure L' M
ft : (n : ℕ) → Term L (α ⊕ Fin n) → Term L' (β ⊕ Fin n)
fr : (n : ℕ) → Relations L n → Relations L' n
n : ℕ
v : α → M
v' : β → M
h1 : ∀ (n : ℕ) (t : Term L (α ⊕ Fin n)) (xs : Fin n → M), realize (Sum.elim v' xs) (ft n t) = realize (Sum.elim v xs) t
h2 : ∀ (n : ℕ) (R : Relations L n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x
n✝ : ℕ
xs : Fin n✝ → M
⊢ Realize (mapTermRel ft fr (fun x => id) falsum) v' xs ↔ Realize falsum v xs

Next tactic:
rfl
theorem realize_mapTermRel_id [L'.Structure M]
    {ft : ∀ n, L.Term (Sum α (Fin n)) → L'.Term (Sum β (Fin n))}
    {fr : ∀ n, L.Relations n → L'.Relations n} {n} {φ : L.BoundedFormula α n} {v : α → M}
    {v' : β → M} {xs : Fin n → M}
    (h1 :
      ∀ (n) (t : L.Term (Sum α (Fin n))) (xs : Fin n → M),
        (ft n t).realize (Sum.elim v' xs) = t.realize (Sum.elim v xs))
    (h2 : ∀ (n) (R : L.Relations n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x) :
    (φ.mapTermRel ft fr fun _ => id).Realize v' xs ↔ φ.Realize v xs := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih
  · 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✝¹ l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
inst✝ : Structure L' M
ft : (n : ℕ) → Term L (α ⊕ Fin n) → Term L' (β ⊕ Fin n)
fr : (n : ℕ) → Relations L n → Relations L' n
n : ℕ
v : α → M
v' : β → M
h1 : ∀ (n : ℕ) (t : Term L (α ⊕ Fin n)) (xs : Fin n → M), realize (Sum.elim v' xs) (ft n t) = realize (Sum.elim v xs) t
h2 : ∀ (n : ℕ) (R : Relations L n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x
n✝ : ℕ
t₁✝ t₂✝ : Term L (α ⊕ Fin n✝)
xs : Fin n✝ → M
⊢ Realize (mapTermRel ft fr (fun x => id) (equal t₁✝ t₂✝)) v' xs ↔ Realize (equal t₁✝ t₂✝) v xs

Next tactic:
simp [mapTermRel, Realize, h1]
theorem realize_mapTermRel_id [L'.Structure M]
    {ft : ∀ n, L.Term (Sum α (Fin n)) → L'.Term (Sum β (Fin n))}
    {fr : ∀ n, L.Relations n → L'.Relations n} {n} {φ : L.BoundedFormula α n} {v : α → M}
    {v' : β → M} {xs : Fin n → M}
    (h1 :
      ∀ (n) (t : L.Term (Sum α (Fin n))) (xs : Fin n → M),
        (ft n t).realize (Sum.elim v' xs) = t.realize (Sum.elim v xs))
    (h2 : ∀ (n) (R : L.Relations n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x) :
    (φ.mapTermRel ft fr fun _ => id).Realize v' xs ↔ φ.Realize v xs := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih
  · rfl
  · simp [mapTermRel, Realize, h1]
  · 

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✝¹ l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
inst✝ : Structure L' M
ft : (n : ℕ) → Term L (α ⊕ Fin n) → Term L' (β ⊕ Fin n)
fr : (n : ℕ) → Relations L n → Relations L' n
n : ℕ
v : α → M
v' : β → M
h1 : ∀ (n : ℕ) (t : Term L (α ⊕ Fin n)) (xs : Fin n → M), realize (Sum.elim v' xs) (ft n t) = realize (Sum.elim v xs) t
h2 : ∀ (n : ℕ) (R : Relations L n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x
n✝ l✝ : ℕ
R✝ : Relations L l✝
ts✝ : Fin l✝ → Term L (α ⊕ Fin n✝)
xs : Fin n✝ → M
⊢ Realize (mapTermRel ft fr (fun x => id) (rel R✝ ts✝)) v' xs ↔ Realize (rel R✝ ts✝) v xs

Next tactic:
simp [mapTermRel, Realize, h1, h2]
theorem realize_mapTermRel_id [L'.Structure M]
    {ft : ∀ n, L.Term (Sum α (Fin n)) → L'.Term (Sum β (Fin n))}
    {fr : ∀ n, L.Relations n → L'.Relations n} {n} {φ : L.BoundedFormula α n} {v : α → M}
    {v' : β → M} {xs : Fin n → M}
    (h1 :
      ∀ (n) (t : L.Term (Sum α (Fin n))) (xs : Fin n → M),
        (ft n t).realize (Sum.elim v' xs) = t.realize (Sum.elim v xs))
    (h2 : ∀ (n) (R : L.Relations n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x) :
    (φ.mapTermRel ft fr fun _ => id).Realize v' xs ↔ φ.Realize v xs := by
  induction' φ with _ _ _ _ _ _ _ _ _ _ _ ih1 ih2 _ _ ih
  · rfl
  · simp [mapTermRel, Realize, h1]
  · simp [mapTermRel, Realize, h1, h2]
  · 

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✝¹ l : ℕ
φ ψ : BoundedFormula L α l
θ : BoundedFormula L α (Nat.succ l)
v✝ : α → M
xs✝ : Fin l → M
inst✝ : Structure L' M
ft : (n : ℕ) → Term L (α ⊕ Fin n) → Term L' (β ⊕ Fin n)
fr : (n : ℕ) → Relations L n → Relations L' n
n : ℕ
v : α → M
v' : β → M
h1 : ∀ (n : ℕ) (t : Term L (α ⊕ Fin n)) (xs : Fin n → M), realize (Sum.elim v' xs) (ft n t) = realize (Sum.elim v xs) t
h2 : ∀ (n : ℕ) (R : Relations L n) (x : Fin n → M), RelMap (fr n R) x = RelMap R x
n✝ : ℕ
f₁✝ f₂✝ : BoundedFormula L α n✝
ih1 : ∀ {xs : Fin n✝ → M}, Realize (mapTermRel ft fr (fun x => id) f₁✝) v' xs ↔ Realize f₁✝ v xs
ih2 : ∀ {xs : Fin n✝ → M}, Realize (mapTermRel ft fr (fun x => id) f₂✝) v' xs ↔ Realize f₂✝ v xs
xs : Fin n✝ → M
⊢ Realize (mapTermRel ft fr (fun x => id) (f₁✝ ⟹ f₂✝)) v' xs ↔ Realize (f₁✝ ⟹ f₂✝) v xs

Next tactic:
simp [mapTermRel, Realize, ih1, ih2]