internlm/Lean-Github huggingface dataset:
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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)
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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}
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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}
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof 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
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFreeAux_eq_fastReplaceFree
Proof 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
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFree_eq_fastReplaceFree
Proof state before:
F : Formula
v t : VarName
⊢ replaceFree v t F = fastReplaceFree v t F
Tactic:
simp only [replaceFree]
Proof state after:
F : Formula
v t : VarName
⊢ replaceFreeAux v t ∅ F = fastReplaceFree v t F
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFree_eq_fastReplaceFree
Proof state before:
F : Formula
v t : VarName
⊢ replaceFreeAux v t ∅ F = fastReplaceFree v t F
Tactic:
apply replaceFreeAux_eq_fastReplaceFree
Proof state after:
case h1
F : Formula
v t : VarName
⊢ v ∉ ∅
Theorem: FOL.NV.Sub.Var.One.Rec.replaceFree_eq_fastReplaceFree
Proof state before:
case h1
F : Formula
v t : VarName
⊢ v ∉ ∅
Tactic:
simp
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
F : Formula
v : VarName
⊢ fastReplaceFree v v F = F
Tactic:
induction F
Proof state after:
case pred_const_
v : VarName
a✝¹ : PredName
a✝ : List VarName
⊢ fastReplaceFree v v (pred_const_ a✝¹ a✝) = pred_const_ a✝¹ a✝

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

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

case true_
v : VarName
⊢ fastReplaceFree v v true_ = true_

case false_
v : VarName
⊢ fastReplaceFree v v false_ = false_

case not_
v : VarName
a✝ : Formula
a_ih✝ : fastReplaceFree v v a✝ = a✝
⊢ fastReplaceFree v v a✝.not_ = a✝.not_

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

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

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

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

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

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

case def_
v : VarName
a✝¹ : DefName
a✝ : List VarName
⊢ fastReplaceFree v v (def_ a✝¹ a✝) = def_ a✝¹ a✝
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
X : DefName
xs : List VarName
⊢ def_ X (List.map (fun x => if v = x then v else x) xs) = def_ X xs
Tactic:
case pred_const_ X xs | pred_var_ X xs | def_ X xs =>
  simp
  simp only [List.map_eq_self_iff]
  simp
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v x y : VarName
⊢ eq_ (if v = x then v else x) (if v = y then v else y) = eq_ x y
Tactic:
case eq_ x y =>
  simp
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
⊢ (fastReplaceFree v v phi).not_ = phi.not_
Tactic:
case not_ phi phi_ih =>
  congr!
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
phi psi : Formula
phi_ih : fastReplaceFree v v phi = phi
psi_ih : fastReplaceFree v v psi = psi
⊢ (fastReplaceFree v v phi).iff_ (fastReplaceFree v v 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!
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v x : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
⊢ (if v = x then exists_ x phi else exists_ x (fastReplaceFree v v phi)) = exists_ x phi
Tactic:
case forall_ x phi phi_ih | exists_ x phi phi_ih =>
  simp
  intro _
  exact phi_ih
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
case def_
v : VarName
a✝¹ : DefName
a✝ : List VarName
⊢ fastReplaceFree v v (def_ a✝¹ a✝) = def_ a✝¹ a✝
Tactic:
simp only [fastReplaceFree]
Proof state after:
case def_
v : VarName
a✝¹ : DefName
a✝ : List VarName
⊢ def_ a✝¹ (List.map (fun x => if v = x then v else x) a✝) = def_ a✝¹ a✝
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
X : DefName
xs : List VarName
⊢ def_ X (List.map (fun x => if v = x then v else x) xs) = def_ X xs
Tactic:
simp
Proof state after:
v : VarName
X : DefName
xs : List VarName
⊢ List.map (fun x => if v = x then v else x) xs = xs
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
X : DefName
xs : List VarName
⊢ List.map (fun x => if v = x then v else x) xs = xs
Tactic:
simp only [List.map_eq_self_iff]
Proof state after:
v : VarName
X : DefName
xs : List VarName
⊢ ∀ x ∈ xs, (if v = x then v else x) = x
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
X : DefName
xs : List VarName
⊢ ∀ x ∈ xs, (if v = x then v else x) = x
Tactic:
simp
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v x y : VarName
⊢ eq_ (if v = x then v else x) (if v = y then v else y) = eq_ x y
Tactic:
simp
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
⊢ (fastReplaceFree v v phi).not_ = phi.not_
Tactic:
congr!
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v : VarName
phi psi : Formula
phi_ih : fastReplaceFree v v phi = phi
psi_ih : fastReplaceFree v v psi = psi
⊢ (fastReplaceFree v v phi).iff_ (fastReplaceFree v v psi) = phi.iff_ psi
Tactic:
congr!
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v x : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
⊢ (if v = x then exists_ x phi else exists_ x (fastReplaceFree v v phi)) = exists_ x phi
Tactic:
simp
Proof state after:
v x : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
⊢ ¬v = x → fastReplaceFree v v phi = phi
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v x : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
⊢ ¬v = x → fastReplaceFree v v phi = phi
Tactic:
intro _
Proof state after:
v x : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
a✝ : ¬v = x
⊢ fastReplaceFree v v phi = phi
Theorem: FOL.NV.Sub.Var.One.Rec.fastReplaceFree_self
Proof state before:
v x : VarName
phi : Formula
phi_ih : fastReplaceFree v v phi = phi
a✝ : ¬v = x
⊢ fastReplaceFree v v phi = phi
Tactic:
exact phi_ih
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
F : Formula
v t : VarName
h1 : ¬isFreeIn v F
⊢ fastReplaceFree v t F = F
Tactic:
induction F
Proof state after:
case pred_const_
v t : VarName
a✝¹ : PredName
a✝ : List VarName
h1 : ¬isFreeIn v (pred_const_ a✝¹ a✝)
⊢ fastReplaceFree v t (pred_const_ a✝¹ a✝) = pred_const_ a✝¹ a✝

case pred_var_
v t : VarName
a✝¹ : PredName
a✝ : List VarName
h1 : ¬isFreeIn v (pred_var_ a✝¹ a✝)
⊢ fastReplaceFree v t (pred_var_ a✝¹ a✝) = pred_var_ a✝¹ a✝

case eq_
v t a✝¹ a✝ : VarName
h1 : ¬isFreeIn v (eq_ a✝¹ a✝)
⊢ fastReplaceFree v t (eq_ a✝¹ a✝) = eq_ a✝¹ a✝

case true_
v t : VarName
h1 : ¬isFreeIn v true_
⊢ fastReplaceFree v t true_ = true_

case false_
v t : VarName
h1 : ¬isFreeIn v false_
⊢ fastReplaceFree v t false_ = false_

case not_
v t : VarName
a✝ : Formula
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v a✝.not_
⊢ fastReplaceFree v t a✝.not_ = a✝.not_

case imp_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ¬isFreeIn v a✝¹ → fastReplaceFree v t a✝¹ = a✝¹
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v (a✝¹.imp_ a✝)
⊢ fastReplaceFree v t (a✝¹.imp_ a✝) = a✝¹.imp_ a✝

case and_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ¬isFreeIn v a✝¹ → fastReplaceFree v t a✝¹ = a✝¹
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v (a✝¹.and_ a✝)
⊢ fastReplaceFree v t (a✝¹.and_ a✝) = a✝¹.and_ a✝

case or_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ¬isFreeIn v a✝¹ → fastReplaceFree v t a✝¹ = a✝¹
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v (a✝¹.or_ a✝)
⊢ fastReplaceFree v t (a✝¹.or_ a✝) = a✝¹.or_ a✝

case iff_
v t : VarName
a✝¹ a✝ : Formula
a_ih✝¹ : ¬isFreeIn v a✝¹ → fastReplaceFree v t a✝¹ = a✝¹
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v (a✝¹.iff_ a✝)
⊢ fastReplaceFree v t (a✝¹.iff_ a✝) = a✝¹.iff_ a✝

case forall_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v (forall_ a✝¹ a✝)
⊢ fastReplaceFree v t (forall_ a✝¹ a✝) = forall_ a✝¹ a✝

case exists_
v t a✝¹ : VarName
a✝ : Formula
a_ih✝ : ¬isFreeIn v a✝ → fastReplaceFree v t a✝ = a✝
h1 : ¬isFreeIn v (exists_ a✝¹ a✝)
⊢ fastReplaceFree v t (exists_ a✝¹ a✝) = exists_ a✝¹ a✝

case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
h1 : ¬isFreeIn v (def_ a✝¹ a✝)
⊢ fastReplaceFree v t (def_ a✝¹ a✝) = def_ a✝¹ a✝
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ def_ X (List.map (fun x => if v = x then t else x) xs) = def_ X xs
Tactic:
case pred_const_ X xs | pred_var_ X xs | def_ X xs =>
  simp
  simp only [List.map_eq_self_iff]
  simp
  intro x a1 a2
  subst a2
  contradiction
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t x y : VarName
h1 : ¬(v = x ∨ v = y)
⊢ eq_ (if v = x then t else x) (if v = y then t else y) = eq_ x y
Tactic:
case eq_ x y =>
  simp
  tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
phi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
h1 : ¬isFreeIn v phi
⊢ (fastReplaceFree v t phi).not_ = phi.not_
Tactic:
case not_ phi phi_ih =>
  tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
phi psi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
psi_ih : ¬isFreeIn v psi → fastReplaceFree v t psi = psi
h1 : ¬(isFreeIn v phi ∨ isFreeIn v psi)
⊢ (fastReplaceFree v t phi).iff_ (fastReplaceFree v t 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 =>
  simp
  tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t x : VarName
phi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
h1 : ¬(¬v = x ∧ isFreeIn v phi)
⊢ (if v = x then exists_ x phi else exists_ x (fastReplaceFree v t phi)) = exists_ x phi
Tactic:
case forall_ x phi phi_ih | exists_ x phi phi_ih =>
  simp
  tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
h1 : ¬isFreeIn v (def_ a✝¹ a✝)
⊢ fastReplaceFree v t (def_ a✝¹ a✝) = def_ a✝¹ a✝
Tactic:
simp only [isFreeIn] at h1
Proof state after:
case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
h1 : v ∉ a✝
⊢ fastReplaceFree v t (def_ a✝¹ a✝) = def_ a✝¹ a✝
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
h1 : v ∉ a✝
⊢ fastReplaceFree v t (def_ a✝¹ a✝) = def_ a✝¹ a✝
Tactic:
simp only [fastReplaceFree]
Proof state after:
case def_
v t : VarName
a✝¹ : DefName
a✝ : List VarName
h1 : v ∉ a✝
⊢ def_ a✝¹ (List.map (fun x => if v = x then t else x) a✝) = def_ a✝¹ a✝
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ def_ X (List.map (fun x => if v = x then t else x) xs) = def_ X xs
Tactic:
simp
Proof state after:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ List.map (fun x => if v = x then t else x) xs = xs
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ List.map (fun x => if v = x then t else x) xs = xs
Tactic:
simp only [List.map_eq_self_iff]
Proof state after:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ ∀ x ∈ xs, (if v = x then t else x) = x
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ ∀ x ∈ xs, (if v = x then t else x) = x
Tactic:
simp
Proof state after:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ ∀ x ∈ xs, v = x → t = x
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
⊢ ∀ x ∈ xs, v = x → t = x
Tactic:
intro x a1 a2
Proof state after:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
x : VarName
a1 : x ∈ xs
a2 : v = x
⊢ t = x
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
x : VarName
a1 : x ∈ xs
a2 : v = x
⊢ t = x
Tactic:
subst a2
Proof state after:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
a1 : v ∈ xs
⊢ t = v
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
X : DefName
xs : List VarName
h1 : v ∉ xs
a1 : v ∈ xs
⊢ t = v
Tactic:
contradiction
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t x y : VarName
h1 : ¬(v = x ∨ v = y)
⊢ eq_ (if v = x then t else x) (if v = y then t else y) = eq_ x y
Tactic:
simp
Proof state after:
v t x y : VarName
h1 : ¬(v = x ∨ v = y)
⊢ (v = x → t = x) ∧ (v = y → t = y)
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t x y : VarName
h1 : ¬(v = x ∨ v = y)
⊢ (v = x → t = x) ∧ (v = y → t = y)
Tactic:
tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
phi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
h1 : ¬isFreeIn v phi
⊢ (fastReplaceFree v t phi).not_ = phi.not_
Tactic:
tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
phi psi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
psi_ih : ¬isFreeIn v psi → fastReplaceFree v t psi = psi
h1 : ¬(isFreeIn v phi ∨ isFreeIn v psi)
⊢ (fastReplaceFree v t phi).iff_ (fastReplaceFree v t psi) = phi.iff_ psi
Tactic:
simp
Proof state after:
v t : VarName
phi psi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
psi_ih : ¬isFreeIn v psi → fastReplaceFree v t psi = psi
h1 : ¬(isFreeIn v phi ∨ isFreeIn v psi)
⊢ fastReplaceFree v t phi = phi ∧ fastReplaceFree v t psi = psi
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t : VarName
phi psi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
psi_ih : ¬isFreeIn v psi → fastReplaceFree v t psi = psi
h1 : ¬(isFreeIn v phi ∨ isFreeIn v psi)
⊢ fastReplaceFree v t phi = phi ∧ fastReplaceFree v t psi = psi
Tactic:
tauto
Proof state after:
no goals
Theorem: FOL.NV.Sub.Var.One.Rec.not_free_in_fastReplaceFree_self
Proof state before:
v t x : VarName
phi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
h1 : ¬(¬v = x ∧ isFreeIn v phi)
⊢ (if v = x then exists_ x phi else exists_ x (fastReplaceFree v t phi)) = exists_ x phi
Tactic:
simp
Proof state after:
v t x : VarName
phi : Formula
phi_ih : ¬isFreeIn v phi → fastReplaceFree v t phi = phi
h1 : ¬(¬v = x ∧ isFreeIn v phi)
⊢ ¬v = x → fastReplaceFree v t phi = phi