any_goals
  simp only [replaceFreeAux]
case pred_const_
v t : VarName
a✝¹ : PredName
a✝ : List VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (pred_const_ a✝¹ a✝) = pred_const_ a✝¹ a✝

case pred_var_
v t : VarName
a✝¹ : PredName
a✝ : List VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (pred_var_ a✝¹ a✝) = pred_var_ a✝¹ a✝

case eq_
v t a✝¹ a✝ : VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (eq_ a✝¹ a✝) = eq_ a✝¹ a✝

case true_
v t : VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders true_ = true_

case false_
v t : VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders false_ = false_

case not_
v t : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders a✝.not_ = a✝.not_

case imp_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (a✝¹.imp_ a✝) = a✝¹.imp_ a✝

case and_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (a✝¹.and_ a✝) = a✝¹.and_ a✝

case or_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (a✝¹.or_ a✝) = a✝¹.or_ a✝

case iff_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (a✝¹.iff_ a✝) = a✝¹.iff_ a✝

case forall_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (forall_ a✝¹ a✝) = forall_ a✝¹ a✝

case exists_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (exists_ a✝¹ a✝) = exists_ a✝¹ a✝

case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ replaceFreeAux v t binders (def_ a✝¹ a✝) = def_ a✝¹ a✝
case pred_const_
v t : VarName
a✝¹ : PredName
a✝ : List VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ pred_const_ a✝¹ (List.map (fun x => if v = x ∧ x ∉ binders then t else x) a✝) = pred_const_ a✝¹ a✝

case pred_var_
v t : VarName
a✝¹ : PredName
a✝ : List VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ pred_var_ a✝¹ (List.map (fun x => if v = x ∧ x ∉ binders then t else x) a✝) = pred_var_ a✝¹ a✝

case eq_
v t a✝¹ a✝ : VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ eq_ (if v = a✝¹ ∧ a✝¹ ∉ binders then t else a✝¹) (if v = a✝ ∧ a✝ ∉ binders then t else a✝) = eq_ a✝¹ a✝

case not_
v t : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ (replaceFreeAux v t binders a✝).not_ = a✝.not_

case imp_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ (replaceFreeAux v t binders a✝¹).imp_ (replaceFreeAux v t binders a✝) = a✝¹.imp_ a✝

case and_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ (replaceFreeAux v t binders a✝¹).and_ (replaceFreeAux v t binders a✝) = a✝¹.and_ a✝

case or_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ (replaceFreeAux v t binders a✝¹).or_ (replaceFreeAux v t binders a✝) = a✝¹.or_ a✝

case iff_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝¹ = a✝¹
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ (replaceFreeAux v t binders a✝¹).iff_ (replaceFreeAux v t binders a✝) = a✝¹.iff_ a✝

case forall_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ forall_ a✝¹ (replaceFreeAux v t (binders ∪ {a✝¹}) a✝) = forall_ a✝¹ a✝

case exists_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∈ binders → replaceFreeAux v t binders a✝ = a✝
binders : Finset VarName
h1 : v ∈ binders
⊢ exists_ a✝¹ (replaceFreeAux v t (binders ∪ {a✝¹}) a✝) = exists_ a✝¹ a✝

case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
binders : Finset VarName
h1 : v ∈ binders
⊢ def_ a✝¹ (List.map (fun x => if v = x ∧ x ∉ binders then t else x) a✝) = def_ a✝¹ a✝