Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree (FOL/NV/Sub/Var/One/Rec/ReplaceFree.lean)

State before:
F : Formula
v t : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ replaceFreeAux v t binders F = fastReplaceFree v t F
Tactic:
induction F generalizing binders
State after:
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✝) = fastReplaceFree v t (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✝) = fastReplaceFree v t (pred_var_ a✝¹ a✝)

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

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

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

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

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

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

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

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

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

case exists_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders a✝ = fastReplaceFree v t a✝
binders : Finset VarName
h1 : v ∉ binders
⊢ replaceFreeAux v t binders (exists_ a✝¹ a✝) = fastReplaceFree v t (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✝) = fastReplaceFree v t (def_ a✝¹ a✝)

State before:
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✝) = fastReplaceFree v t (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✝) = fastReplaceFree v t (pred_var_ a✝¹ a✝)

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

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

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

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

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

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

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

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

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

case exists_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders a✝ = fastReplaceFree v t a✝
binders : Finset VarName
h1 : v ∉ binders
⊢ replaceFreeAux v t binders (exists_ a✝¹ a✝) = fastReplaceFree v t (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✝) = fastReplaceFree v t (def_ a✝¹ a✝)
Tactic:
any_goals
  simp only [replaceFreeAux]
  simp only [fastReplaceFree]
State after:
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✝¹ (List.map (fun x => if v = x then t else x) 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✝¹ (List.map (fun x => if v = x then t else x) 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_ (if v = a✝¹ then t else a✝¹) (if v = a✝ then t else a✝)

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

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

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

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

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

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

case exists_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders a✝ = fastReplaceFree v t a✝
binders : Finset VarName
h1 : v ∉ binders
⊢ exists_ a✝¹ (replaceFreeAux v t (binders ∪ {a✝¹}) a✝) =
    if v = a✝¹ then exists_ a✝¹ a✝ else exists_ a✝¹ (fastReplaceFree v t 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✝¹ (List.map (fun x => if v = x then t else x) a✝)

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ def_ X (List.map (fun x => if v = x ∧ x ∉ binders then t else x) xs) =
    def_ X (List.map (fun x => if v = x then t else x) xs)
Tactic:
case pred_const_ X xs | pred_var_ X xs | def_ X xs =>
  congr!
  case _ x =>
    constructor
    case mp =>
      tauto
    case mpr =>
      intro a1
      subst a1
      tauto
State after:
no goals

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ eq_ (if v = x ∧ x ∉ binders then t else x) (if v = y ∧ y ∉ binders then t else y) =
    eq_ (if v = x then t else x) (if v = y then t else y)
Tactic:
case eq_ x y =>
  congr!
  case _ | _ =>
    constructor
    case mp =>
      tauto
    case mpr =>
      intro a1
      subst a1
      tauto
State after:
no goals

State before:
v t : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
⊢ (replaceFreeAux v t binders phi).not_ = (fastReplaceFree v t phi).not_
Tactic:
case not_ phi phi_ih =>
  tauto
State after:
no goals

State before:
v t : VarName
phi psi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
psi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders psi = fastReplaceFree v t psi
binders : Finset VarName
h1 : v ∉ binders
⊢ (replaceFreeAux v t binders phi).iff_ (replaceFreeAux v t binders psi) =
    (fastReplaceFree v t phi).iff_ (fastReplaceFree v t psi)
Tactic:
case
    imp_ phi psi phi_ih psi_ih
  | and_ phi psi phi_ih psi_ih
  | or_ phi psi phi_ih psi_ih
  | iff_ phi psi phi_ih psi_ih =>
  simp
  tauto
State after:
no goals

State before:
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) =
    if v = x then exists_ x phi else exists_ x (fastReplaceFree v t phi)
Tactic:
case forall_ x phi phi_ih | exists_ x phi phi_ih =>
  split_ifs
  case pos c1 =>
    congr! 1
    apply replaceFreeAux_mem_binders
    simp
    right
    exact c1
  case neg c1 =>
    congr! 1
    apply phi_ih
    simp
    tauto
State after:
no goals

State before:
case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ replaceFreeAux v t binders (def_ a✝¹ a✝) = fastReplaceFree v t (def_ a✝¹ a✝)
Tactic:
simp only [replaceFreeAux]
State after:
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✝) = fastReplaceFree v t (def_ a✝¹ a✝)

State before:
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✝) = fastReplaceFree v t (def_ a✝¹ a✝)
Tactic:
simp only [fastReplaceFree]
State after:
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✝¹ (List.map (fun x => if v = x then t else x) a✝)

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ def_ X (List.map (fun x => if v = x ∧ x ∉ binders then t else x) xs) =
    def_ X (List.map (fun x => if v = x then t else x) xs)
Tactic:
congr!
State after:
case h.e'_2.h.e'_3.h.h₁.a
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x✝ : VarName
⊢ v = x✝ ∧ x✝ ∉ binders ↔ v = x✝

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x ∧ x ∉ binders ↔ v = x
Tactic:
case _ x =>
  constructor
  case mp =>
    tauto
  case mpr =>
    intro a1
    subst a1
    tauto
State after:
no goals

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x ∧ x ∉ binders ↔ v = x
Tactic:
constructor
State after:
case mp
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x ∧ x ∉ binders → v = x

case mpr
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x → v = x ∧ x ∉ binders

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x ∧ x ∉ binders → v = x
Tactic:
case mp =>
  tauto
State after:
no goals

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x → v = x ∧ x ∉ binders
Tactic:
case mpr =>
  intro a1
  subst a1
  tauto
State after:
no goals

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x ∧ x ∉ binders → v = x
Tactic:
tauto
State after:
no goals

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
⊢ v = x → v = x ∧ x ∉ binders
Tactic:
intro a1
State after:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
a1 : v = x
⊢ v = x ∧ x ∉ binders

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
x : VarName
a1 : v = x
⊢ v = x ∧ x ∉ binders
Tactic:
subst a1
State after:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = v ∧ v ∉ binders

State before:
v t : VarName
X : DefName
xs : List VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = v ∧ v ∉ binders
Tactic:
tauto
State after:
no goals

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ eq_ (if v = x ∧ x ∉ binders then t else x) (if v = y ∧ y ∉ binders then t else y) =
    eq_ (if v = x then t else x) (if v = y then t else y)
Tactic:
congr!
State after:
case h.e'_1.h₁.a
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = x ∧ x ∉ binders ↔ v = x

case h.e'_2.h₁.a
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y ∧ y ∉ binders ↔ v = y

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y ∧ y ∉ binders ↔ v = y
Tactic:
case _ | _ =>
  constructor
  case mp =>
    tauto
  case mpr =>
    intro a1
    subst a1
    tauto
State after:
no goals

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y ∧ y ∉ binders ↔ v = y
Tactic:
constructor
State after:
case mp
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y ∧ y ∉ binders → v = y

case mpr
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y → v = y ∧ y ∉ binders

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y ∧ y ∉ binders → v = y
Tactic:
case mp =>
  tauto
State after:
no goals

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y → v = y ∧ y ∉ binders
Tactic:
case mpr =>
  intro a1
  subst a1
  tauto
State after:
no goals

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y ∧ y ∉ binders → v = y
Tactic:
tauto
State after:
no goals

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = y → v = y ∧ y ∉ binders
Tactic:
intro a1
State after:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
a1 : v = y
⊢ v = y ∧ y ∉ binders

State before:
v t x y : VarName
binders : Finset VarName
h1 : v ∉ binders
a1 : v = y
⊢ v = y ∧ y ∉ binders
Tactic:
subst a1
State after:
v t x : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = v ∧ v ∉ binders

State before:
v t x : VarName
binders : Finset VarName
h1 : v ∉ binders
⊢ v = v ∧ v ∉ binders
Tactic:
tauto
State after:
no goals

State before:
v t : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
⊢ (replaceFreeAux v t binders phi).not_ = (fastReplaceFree v t phi).not_
Tactic:
tauto
State after:
no goals

State before:
v t : VarName
phi psi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
psi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders psi = fastReplaceFree v t psi
binders : Finset VarName
h1 : v ∉ binders
⊢ (replaceFreeAux v t binders phi).iff_ (replaceFreeAux v t binders psi) =
    (fastReplaceFree v t phi).iff_ (fastReplaceFree v t psi)
Tactic:
simp
State after:
v t : VarName
phi psi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
psi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders psi = fastReplaceFree v t psi
binders : Finset VarName
h1 : v ∉ binders
⊢ replaceFreeAux v t binders phi = fastReplaceFree v t phi ∧ replaceFreeAux v t binders psi = fastReplaceFree v t psi

State before:
v t : VarName
phi psi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
psi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders psi = fastReplaceFree v t psi
binders : Finset VarName
h1 : v ∉ binders
⊢ replaceFreeAux v t binders phi = fastReplaceFree v t phi ∧ replaceFreeAux v t binders psi = fastReplaceFree v t psi
Tactic:
tauto
State after:
no goals

State before:
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) =
    if v = x then exists_ x phi else exists_ x (fastReplaceFree v t phi)
Tactic:
split_ifs
State after:
case pos
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
h✝ : v = x
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) = exists_ x phi

case neg
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
h✝ : ¬v = x
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) = exists_ x (fastReplaceFree v t phi)

State before:
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) = exists_ x phi
Tactic:
case pos c1 =>
  congr! 1
  apply replaceFreeAux_mem_binders
  simp
  right
  exact c1
State after:
no goals

State before:
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) = exists_ x (fastReplaceFree v t phi)
Tactic:
case neg c1 =>
  congr! 1
  apply phi_ih
  simp
  tauto
State after:
no goals

State before:
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) = exists_ x phi
Tactic:
congr! 1
State after:
case h.e'_2
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ replaceFreeAux v t (binders ∪ {x}) phi = phi

State before:
case h.e'_2
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ replaceFreeAux v t (binders ∪ {x}) phi = phi
Tactic:
apply replaceFreeAux_mem_binders
State after:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ v ∈ binders ∪ {x}

State before:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ v ∈ binders ∪ {x}
Tactic:
simp
State after:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ v ∈ binders ∨ v = x

State before:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ v ∈ binders ∨ v = x
Tactic:
right
State after:
case h.e'_2.h1.h
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ v = x

State before:
case h.e'_2.h1.h
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : v = x
⊢ v = x
Tactic:
exact c1
State after:
no goals

State before:
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ exists_ x (replaceFreeAux v t (binders ∪ {x}) phi) = exists_ x (fastReplaceFree v t phi)
Tactic:
congr! 1
State after:
case h.e'_2
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ replaceFreeAux v t (binders ∪ {x}) phi = fastReplaceFree v t phi

State before:
case h.e'_2
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ replaceFreeAux v t (binders ∪ {x}) phi = fastReplaceFree v t phi
Tactic:
apply phi_ih
State after:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ v ∉ binders ∪ {x}

State before:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ v ∉ binders ∪ {x}
Tactic:
simp
State after:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ v ∉ binders ∧ ¬v = x

State before:
case h.e'_2.h1
v t x : VarName
phi : Formula
phi_ih : ∀ (binders : Finset VarName), v ∉ binders → replaceFreeAux v t binders phi = fastReplaceFree v t phi
binders : Finset VarName
h1 : v ∉ binders
c1 : ¬v = x
⊢ v ∉ binders ∧ ¬v = x
Tactic:
tauto
State after:
no goals