Theorem: FOL.NV.Sub.Var.All.Rec.fastReplaceFree_id (FOL/NV/Sub/Var/All/Rec/ReplaceFree.lean)

State before:
F : Formula
⊢ fastReplaceFree id F = F
Tactic:
induction F
State after:
case pred_const_
a✝¹ : PredName
a✝ : List VarName
⊢ fastReplaceFree id (pred_const_ a✝¹ a✝) = pred_const_ a✝¹ a✝

case pred_var_
a✝¹ : PredName
a✝ : List VarName
⊢ fastReplaceFree id (pred_var_ a✝¹ a✝) = pred_var_ a✝¹ a✝

case eq_
a✝¹ a✝ : VarName
⊢ fastReplaceFree id (eq_ a✝¹ a✝) = eq_ a✝¹ a✝

case true_

⊢ fastReplaceFree id true_ = true_

case false_

⊢ fastReplaceFree id false_ = false_

case not_
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id a✝.not_ = a✝.not_

case imp_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.imp_ a✝) = a✝¹.imp_ a✝

case and_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.and_ a✝) = a✝¹.and_ a✝

case or_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.or_ a✝) = a✝¹.or_ a✝

case iff_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.iff_ a✝) = a✝¹.iff_ a✝

case forall_
a✝¹ : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (forall_ a✝¹ a✝) = forall_ a✝¹ a✝

case exists_
a✝¹ : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (exists_ a✝¹ a✝) = exists_ a✝¹ a✝

case def_
a✝¹ : DefName
a✝ : List VarName
⊢ fastReplaceFree id (def_ a✝¹ a✝) = def_ a✝¹ a✝

State before:
case pred_const_
a✝¹ : PredName
a✝ : List VarName
⊢ fastReplaceFree id (pred_const_ a✝¹ a✝) = pred_const_ a✝¹ a✝

case pred_var_
a✝¹ : PredName
a✝ : List VarName
⊢ fastReplaceFree id (pred_var_ a✝¹ a✝) = pred_var_ a✝¹ a✝

case eq_
a✝¹ a✝ : VarName
⊢ fastReplaceFree id (eq_ a✝¹ a✝) = eq_ a✝¹ a✝

case true_

⊢ fastReplaceFree id true_ = true_

case false_

⊢ fastReplaceFree id false_ = false_

case not_
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id a✝.not_ = a✝.not_

case imp_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.imp_ a✝) = a✝¹.imp_ a✝

case and_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.and_ a✝) = a✝¹.and_ a✝

case or_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.or_ a✝) = a✝¹.or_ a✝

case iff_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (a✝¹.iff_ a✝) = a✝¹.iff_ a✝

case forall_
a✝¹ : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (forall_ a✝¹ a✝) = forall_ a✝¹ a✝

case exists_
a✝¹ : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ fastReplaceFree id (exists_ a✝¹ a✝) = exists_ a✝¹ a✝

case def_
a✝¹ : DefName
a✝ : List VarName
⊢ fastReplaceFree id (def_ a✝¹ a✝) = def_ a✝¹ a✝
Tactic:
all_goals
  simp only [fastReplaceFree]
State after:
case pred_const_
a✝¹ : PredName
a✝ : List VarName
⊢ pred_const_ a✝¹ (List.map id a✝) = pred_const_ a✝¹ a✝

case pred_var_
a✝¹ : PredName
a✝ : List VarName
⊢ pred_var_ a✝¹ (List.map id a✝) = pred_var_ a✝¹ a✝

case eq_
a✝¹ a✝ : VarName
⊢ eq_ (id a✝¹) (id a✝) = eq_ a✝¹ a✝

case not_
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ (fastReplaceFree id a✝).not_ = a✝.not_

case imp_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ (fastReplaceFree id a✝¹).imp_ (fastReplaceFree id a✝) = a✝¹.imp_ a✝

case and_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ (fastReplaceFree id a✝¹).and_ (fastReplaceFree id a✝) = a✝¹.and_ a✝

case or_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ (fastReplaceFree id a✝¹).or_ (fastReplaceFree id a✝) = a✝¹.or_ a✝

case iff_
a✝¹ a✝ : Formula
a_ih✝¹ : fastReplaceFree id a✝¹ = a✝¹
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ (fastReplaceFree id a✝¹).iff_ (fastReplaceFree id a✝) = a✝¹.iff_ a✝

case forall_
a✝¹ : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ forall_ a✝¹ (fastReplaceFree (Function.updateITE id a✝¹ a✝¹) a✝) = forall_ a✝¹ a✝

case exists_
a✝¹ : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree id a✝ = a✝
⊢ exists_ a✝¹ (fastReplaceFree (Function.updateITE id a✝¹ a✝¹) a✝) = exists_ a✝¹ a✝

case def_
a✝¹ : DefName
a✝ : List VarName
⊢ def_ a✝¹ (List.map id a✝) = def_ a✝¹ a✝

State before:
X : DefName
xs : List VarName
⊢ def_ X (List.map id xs) = def_ X xs
Tactic:
case pred_const_ X xs | pred_var_ X xs | def_ X xs =>
  congr!
  simp
State after:
no goals

State before:
x y : VarName
⊢ eq_ (id x) (id y) = eq_ x y
Tactic:
case eq_ x y =>
  congr!
State after:
no goals

State before:
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ (fastReplaceFree id phi).not_ = phi.not_
Tactic:
case not_ phi phi_ih =>
  congr!
State after:
no goals

State before:
phi psi : Formula
phi_ih : fastReplaceFree id phi = phi
psi_ih : fastReplaceFree id psi = psi
⊢ (fastReplaceFree id phi).iff_ (fastReplaceFree id psi) = phi.iff_ 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 =>
  congr!
State after:
no goals

State before:
x : VarName
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ exists_ x (fastReplaceFree (Function.updateITE id x x) phi) = exists_ x phi
Tactic:
case forall_ x phi phi_ih | exists_ x phi phi_ih =>
  congr!
  simp only [Function.updateITE_id]
  exact phi_ih
State after:
no goals

State before:
case def_
a✝¹ : DefName
a✝ : List VarName
⊢ fastReplaceFree id (def_ a✝¹ a✝) = def_ a✝¹ a✝
Tactic:
simp only [fastReplaceFree]
State after:
case def_
a✝¹ : DefName
a✝ : List VarName
⊢ def_ a✝¹ (List.map id a✝) = def_ a✝¹ a✝

State before:
X : DefName
xs : List VarName
⊢ def_ X (List.map id xs) = def_ X xs
Tactic:
congr!
State after:
case h.e'_2
X : DefName
xs : List VarName
⊢ List.map id xs = xs

State before:
case h.e'_2
X : DefName
xs : List VarName
⊢ List.map id xs = xs
Tactic:
simp
State after:
no goals

State before:
x y : VarName
⊢ eq_ (id x) (id y) = eq_ x y
Tactic:
congr!
State after:
no goals

State before:
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ (fastReplaceFree id phi).not_ = phi.not_
Tactic:
congr!
State after:
no goals

State before:
phi psi : Formula
phi_ih : fastReplaceFree id phi = phi
psi_ih : fastReplaceFree id psi = psi
⊢ (fastReplaceFree id phi).iff_ (fastReplaceFree id psi) = phi.iff_ psi
Tactic:
congr!
State after:
no goals

State before:
x : VarName
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ exists_ x (fastReplaceFree (Function.updateITE id x x) phi) = exists_ x phi
Tactic:
congr!
State after:
case h.e'_2
x : VarName
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ fastReplaceFree (Function.updateITE id x x) phi = phi

State before:
case h.e'_2
x : VarName
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ fastReplaceFree (Function.updateITE id x x) phi = phi
Tactic:
simp only [Function.updateITE_id]
State after:
case h.e'_2
x : VarName
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ fastReplaceFree id phi = phi

State before:
case h.e'_2
x : VarName
phi : Formula
phi_ih : fastReplaceFree id phi = phi
⊢ fastReplaceFree id phi = phi
Tactic:
exact phi_ih
State after:
no goals