Theorem: FOL.NV.Sub.Var.One.Ind.isFreeSub_imp_fastReplaceFree (FOL/NV/Sub/Var/One/Ind/Sub.lean)

State before:
F F' : Formula
v u : VarName
h1 : IsSub F v u F'
⊢ Rec.fastReplaceFree v u F = F'
Tactic:
induction h1
State after:
case pred_const_
F F' : Formula
v u : VarName
X✝ : PredName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (pred_const_ X✝ xs✝) = pred_const_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)

case pred_var_
F F' : Formula
v u : VarName
X✝ : PredName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (pred_var_ X✝ xs✝) = pred_var_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)

case eq_
F F' : Formula
v u x✝ y✝ v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (eq_ x✝ y✝) = eq_ (if v✝ = x✝ then t✝ else x✝) (if v✝ = y✝ then t✝ else y✝)

case true_
F F' : Formula
v u v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ true_ = true_

case false_
F F' : Formula
v u v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ false_ = false_

case not_
F F' : Formula
v u : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ Rec.fastReplaceFree v✝ t✝ phi✝.not_ = phi'✝.not_

case imp_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.imp_ psi✝) = phi'✝.imp_ psi'✝

case and_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.and_ psi✝) = phi'✝.and_ psi'✝

case or_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.or_ psi✝) = phi'✝.or_ psi'✝

case iff_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.iff_ psi✝) = phi'✝.iff_ psi'✝

case forall_not_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
a✝ : ¬isFreeIn v✝ (forall_ x✝ phi✝)
⊢ Rec.fastReplaceFree v✝ t✝ (forall_ x✝ phi✝) = forall_ x✝ phi✝

case forall_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝² : isFreeIn v✝ (forall_ x✝ phi✝)
a✝¹ : ¬x✝ = t✝
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (forall_ x✝ phi✝) = forall_ x✝ phi'✝

case exists_not_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
a✝ : ¬isFreeIn v✝ (exists_ x✝ phi✝)
⊢ Rec.fastReplaceFree v✝ t✝ (exists_ x✝ phi✝) = exists_ x✝ phi✝

case exists_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝² : isFreeIn v✝ (exists_ x✝ phi✝)
a✝¹ : ¬x✝ = t✝
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (exists_ x✝ phi✝) = exists_ x✝ phi'✝

case def_
F F' : Formula
v u : VarName
X✝ : DefName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (def_ X✝ xs✝) = def_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)

State before:
case pred_const_
F F' : Formula
v u : VarName
X✝ : PredName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (pred_const_ X✝ xs✝) = pred_const_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)

case pred_var_
F F' : Formula
v u : VarName
X✝ : PredName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (pred_var_ X✝ xs✝) = pred_var_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)

case eq_
F F' : Formula
v u x✝ y✝ v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (eq_ x✝ y✝) = eq_ (if v✝ = x✝ then t✝ else x✝) (if v✝ = y✝ then t✝ else y✝)

case true_
F F' : Formula
v u v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ true_ = true_

case false_
F F' : Formula
v u v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ false_ = false_

case not_
F F' : Formula
v u : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ Rec.fastReplaceFree v✝ t✝ phi✝.not_ = phi'✝.not_

case imp_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.imp_ psi✝) = phi'✝.imp_ psi'✝

case and_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.and_ psi✝) = phi'✝.and_ psi'✝

case or_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.or_ psi✝) = phi'✝.or_ psi'✝

case iff_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (phi✝.iff_ psi✝) = phi'✝.iff_ psi'✝

case forall_not_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
a✝ : ¬isFreeIn v✝ (forall_ x✝ phi✝)
⊢ Rec.fastReplaceFree v✝ t✝ (forall_ x✝ phi✝) = forall_ x✝ phi✝

case forall_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝² : isFreeIn v✝ (forall_ x✝ phi✝)
a✝¹ : ¬x✝ = t✝
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (forall_ x✝ phi✝) = forall_ x✝ phi'✝

case exists_not_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
a✝ : ¬isFreeIn v✝ (exists_ x✝ phi✝)
⊢ Rec.fastReplaceFree v✝ t✝ (exists_ x✝ phi✝) = exists_ x✝ phi✝

case exists_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝² : isFreeIn v✝ (exists_ x✝ phi✝)
a✝¹ : ¬x✝ = t✝
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ Rec.fastReplaceFree v✝ t✝ (exists_ x✝ phi✝) = exists_ x✝ phi'✝

case def_
F F' : Formula
v u : VarName
X✝ : DefName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (def_ X✝ xs✝) = def_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)
Tactic:
all_goals
  simp only [Rec.fastReplaceFree]
State after:
case not_
F F' : Formula
v u : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ (Rec.fastReplaceFree v✝ t✝ phi✝).not_ = phi'✝.not_

case imp_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ (Rec.fastReplaceFree v✝ t✝ phi✝).imp_ (Rec.fastReplaceFree v✝ t✝ psi✝) = phi'✝.imp_ psi'✝

case and_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ (Rec.fastReplaceFree v✝ t✝ phi✝).and_ (Rec.fastReplaceFree v✝ t✝ psi✝) = phi'✝.and_ psi'✝

case or_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ (Rec.fastReplaceFree v✝ t✝ phi✝).or_ (Rec.fastReplaceFree v✝ t✝ psi✝) = phi'✝.or_ psi'✝

case iff_
F F' : Formula
v u : VarName
phi✝ psi✝ : Formula
v✝ t✝ : VarName
phi'✝ psi'✝ : Formula
a✝¹ : IsSub phi✝ v✝ t✝ phi'✝
a✝ : IsSub psi✝ v✝ t✝ psi'✝
a_ih✝¹ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ psi✝ = psi'✝
⊢ (Rec.fastReplaceFree v✝ t✝ phi✝).iff_ (Rec.fastReplaceFree v✝ t✝ psi✝) = phi'✝.iff_ psi'✝

case forall_not_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
a✝ : ¬isFreeIn v✝ (forall_ x✝ phi✝)
⊢ (if v✝ = x✝ then forall_ x✝ phi✝ else forall_ x✝ (Rec.fastReplaceFree v✝ t✝ phi✝)) = forall_ x✝ phi✝

case forall_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝² : isFreeIn v✝ (forall_ x✝ phi✝)
a✝¹ : ¬x✝ = t✝
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ (if v✝ = x✝ then forall_ x✝ phi✝ else forall_ x✝ (Rec.fastReplaceFree v✝ t✝ phi✝)) = forall_ x✝ phi'✝

case exists_not_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
a✝ : ¬isFreeIn v✝ (exists_ x✝ phi✝)
⊢ (if v✝ = x✝ then exists_ x✝ phi✝ else exists_ x✝ (Rec.fastReplaceFree v✝ t✝ phi✝)) = exists_ x✝ phi✝

case exists_free_in
F F' : Formula
v u x✝ : VarName
phi✝ : Formula
v✝ t✝ : VarName
phi'✝ : Formula
a✝² : isFreeIn v✝ (exists_ x✝ phi✝)
a✝¹ : ¬x✝ = t✝
a✝ : IsSub phi✝ v✝ t✝ phi'✝
a_ih✝ : Rec.fastReplaceFree v✝ t✝ phi✝ = phi'✝
⊢ (if v✝ = x✝ then exists_ x✝ phi✝ else exists_ x✝ (Rec.fastReplaceFree v✝ t✝ phi✝)) = exists_ x✝ phi'✝

State before:
F F' : Formula
v u : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
h1_1 : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).not_ = h1_phi'.not_
Tactic:
case not_ h1_phi h1_v h1_t h1_phi' h1_1 h1_ih =>
  tauto
State after:
no goals

State before:
F F' : Formula
v u : VarName
h1_phi h1_psi : Formula
h1_v h1_t : VarName
h1_phi' h1_psi' : Formula
h1_1 : IsSub h1_phi h1_v h1_t h1_phi'
h1_2 : IsSub h1_psi h1_v h1_t h1_psi'
h1_ih_1 : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
h1_ih_2 : Rec.fastReplaceFree h1_v h1_t h1_psi = h1_psi'
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi) = h1_phi'.iff_ h1_psi'
Tactic:
case
  imp_ h1_phi h1_psi h1_v h1_t h1_phi' h1_psi' h1_1 h1_2 h1_ih_1 h1_ih_2
| and_ h1_phi h1_psi h1_v h1_t h1_phi' h1_psi' h1_1 h1_2 h1_ih_1 h1_ih_2
| or_ h1_phi h1_psi h1_v h1_t h1_phi' h1_psi' h1_1 h1_2 h1_ih_1 h1_ih_2
| iff_ h1_phi h1_psi h1_v h1_t h1_phi' h1_psi' h1_1 h1_2 h1_ih_1 h1_ih_2 =>
  subst h1_ih_1
  subst h1_ih_2
  rfl
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬isFreeIn h1_v (exists_ h1_x h1_phi)
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi
Tactic:
case
  forall_not_free_in h1_x h1_phi h1_v h1_t h1_1
| exists_not_free_in h1_x h1_phi h1_v h1_t h1_1 =>
  simp only [isFreeIn] at h1_1
  simp at h1_1
  split_ifs
  case pos c1 =>
    rfl
  case neg c1 =>
    congr!
    apply Rec.not_free_in_fastReplaceFree_self
    exact h1_1 c1
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
h1_1 : isFreeIn h1_v (exists_ h1_x h1_phi)
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'
Tactic:
case
  forall_free_in h1_x h1_phi h1_v h1_t h1_phi' h1_1 _ _ h1_ih
| exists_free_in h1_x h1_phi h1_v h1_t h1_phi' h1_1 _ _ h1_ih =>
  simp only [isFreeIn] at h1_1
  cases h1_1
  case intro h1_1_left h1_1_right =>
    simp only [if_neg h1_1_left]
    subst h1_ih
    rfl
State after:
no goals

State before:
case def_
F F' : Formula
v u : VarName
X✝ : DefName
xs✝ : List VarName
v✝ t✝ : VarName
⊢ Rec.fastReplaceFree v✝ t✝ (def_ X✝ xs✝) = def_ X✝ (List.map (fun x => if v✝ = x then t✝ else x) xs✝)
Tactic:
simp only [Rec.fastReplaceFree]
State after:
no goals

State before:
F F' : Formula
v u : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
h1_1 : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).not_ = h1_phi'.not_
Tactic:
tauto
State after:
no goals

State before:
F F' : Formula
v u : VarName
h1_phi h1_psi : Formula
h1_v h1_t : VarName
h1_phi' h1_psi' : Formula
h1_1 : IsSub h1_phi h1_v h1_t h1_phi'
h1_2 : IsSub h1_psi h1_v h1_t h1_psi'
h1_ih_1 : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
h1_ih_2 : Rec.fastReplaceFree h1_v h1_t h1_psi = h1_psi'
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi) = h1_phi'.iff_ h1_psi'
Tactic:
subst h1_ih_1
State after:
F F' : Formula
v u : VarName
h1_phi h1_psi : Formula
h1_v h1_t : VarName
h1_psi' : Formula
h1_2 : IsSub h1_psi h1_v h1_t h1_psi'
h1_ih_2 : Rec.fastReplaceFree h1_v h1_t h1_psi = h1_psi'
h1_1 : IsSub h1_phi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_phi)
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi) =
    (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ h1_psi'

State before:
F F' : Formula
v u : VarName
h1_phi h1_psi : Formula
h1_v h1_t : VarName
h1_psi' : Formula
h1_2 : IsSub h1_psi h1_v h1_t h1_psi'
h1_ih_2 : Rec.fastReplaceFree h1_v h1_t h1_psi = h1_psi'
h1_1 : IsSub h1_phi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_phi)
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi) =
    (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ h1_psi'
Tactic:
subst h1_ih_2
State after:
F F' : Formula
v u : VarName
h1_phi h1_psi : Formula
h1_v h1_t : VarName
h1_1 : IsSub h1_phi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_phi)
h1_2 : IsSub h1_psi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_psi)
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi) =
    (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi)

State before:
F F' : Formula
v u : VarName
h1_phi h1_psi : Formula
h1_v h1_t : VarName
h1_1 : IsSub h1_phi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_phi)
h1_2 : IsSub h1_psi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_psi)
⊢ (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi) =
    (Rec.fastReplaceFree h1_v h1_t h1_phi).iff_ (Rec.fastReplaceFree h1_v h1_t h1_psi)
Tactic:
rfl
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬isFreeIn h1_v (exists_ h1_x h1_phi)
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi
Tactic:
simp only [isFreeIn] at h1_1
State after:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬(¬h1_v = h1_x ∧ isFreeIn h1_v h1_phi)
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬(¬h1_v = h1_x ∧ isFreeIn h1_v h1_phi)
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi
Tactic:
simp at h1_1
State after:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi
Tactic:
split_ifs
State after:
case pos
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
h✝ : h1_v = h1_x
⊢ exists_ h1_x h1_phi = exists_ h1_x h1_phi

case neg
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
h✝ : ¬h1_v = h1_x
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x h1_phi

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : h1_v = h1_x
⊢ exists_ h1_x h1_phi = exists_ h1_x h1_phi
Tactic:
case pos c1 =>
  rfl
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : ¬h1_v = h1_x
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x h1_phi
Tactic:
case neg c1 =>
  congr!
  apply Rec.not_free_in_fastReplaceFree_self
  exact h1_1 c1
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : h1_v = h1_x
⊢ exists_ h1_x h1_phi = exists_ h1_x h1_phi
Tactic:
rfl
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : ¬h1_v = h1_x
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x h1_phi
Tactic:
congr!
State after:
case h.e'_2
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : ¬h1_v = h1_x
⊢ Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi

State before:
case h.e'_2
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : ¬h1_v = h1_x
⊢ Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi
Tactic:
apply Rec.not_free_in_fastReplaceFree_self
State after:
case h.e'_2.h1
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : ¬h1_v = h1_x
⊢ ¬isFreeIn h1_v h1_phi

State before:
case h.e'_2.h1
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_1 : ¬h1_v = h1_x → ¬isFreeIn h1_v h1_phi
c1 : ¬h1_v = h1_x
⊢ ¬isFreeIn h1_v h1_phi
Tactic:
exact h1_1 c1
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
h1_1 : isFreeIn h1_v (exists_ h1_x h1_phi)
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'
Tactic:
simp only [isFreeIn] at h1_1
State after:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
h1_1 : ¬h1_v = h1_x ∧ isFreeIn h1_v h1_phi
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
h1_1 : ¬h1_v = h1_x ∧ isFreeIn h1_v h1_phi
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'
Tactic:
cases h1_1
State after:
case intro
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
left✝ : ¬h1_v = h1_x
right✝ : isFreeIn h1_v h1_phi
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
h1_1_left : ¬h1_v = h1_x
h1_1_right : isFreeIn h1_v h1_phi
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'
Tactic:
case intro h1_1_left h1_1_right =>
  simp only [if_neg h1_1_left]
  subst h1_ih
  rfl
State after:
no goals

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
h1_1_left : ¬h1_v = h1_x
h1_1_right : isFreeIn h1_v h1_phi
⊢ (if h1_v = h1_x then exists_ h1_x h1_phi else exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)) =
    exists_ h1_x h1_phi'
Tactic:
simp only [if_neg h1_1_left]
State after:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
h1_1_left : ¬h1_v = h1_x
h1_1_right : isFreeIn h1_v h1_phi
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x h1_phi'

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
h1_phi' : Formula
a✝¹ : ¬h1_x = h1_t
a✝ : IsSub h1_phi h1_v h1_t h1_phi'
h1_ih : Rec.fastReplaceFree h1_v h1_t h1_phi = h1_phi'
h1_1_left : ¬h1_v = h1_x
h1_1_right : isFreeIn h1_v h1_phi
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x h1_phi'
Tactic:
subst h1_ih
State after:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
a✝¹ : ¬h1_x = h1_t
h1_1_left : ¬h1_v = h1_x
h1_1_right : isFreeIn h1_v h1_phi
a✝ : IsSub h1_phi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_phi)
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)

State before:
F F' : Formula
v u h1_x : VarName
h1_phi : Formula
h1_v h1_t : VarName
a✝¹ : ¬h1_x = h1_t
h1_1_left : ¬h1_v = h1_x
h1_1_right : isFreeIn h1_v h1_phi
a✝ : IsSub h1_phi h1_v h1_t (Rec.fastReplaceFree h1_v h1_t h1_phi)
⊢ exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi) = exists_ h1_x (Rec.fastReplaceFree h1_v h1_t h1_phi)
Tactic:
rfl
State after:
no goals