Theorem: FOL.NV.Sub.Var.One.Rec.substitution_theorem_aux
Proof state before:
D : Type
I : Interpretation D
V' : VarAssignment D
v t : VarName
hd : Definition
tl : List Definition
ih :
  ∀ (V : VarAssignment D) (binders : Finset VarName) (F : Formula),
    fastAdmitsAux v t binders F →
      (∀ v ∉ binders, V' v = V v) →
        (Holds D I (Function.updateITE V v (V' t)) tl F ↔ Holds D I V tl (fastReplaceFree v t F))
X : DefName
xs : List VarName
V : VarAssignment D
binders : Finset VarName
h1 : v ∈ xs → t ∉ binders
h2 : ∀ v ∉ binders, V' v = V v
⊢ (if X = hd.name ∧ xs.length = hd.args.length then
      Holds D I
        (Function.updateListITE (fun c => if c = v then V' t else V c) hd.args
          (List.map (fun c => if c = v then V' t else V c) xs))
        tl hd.q
    else Holds D I (fun c => if c = v then V' t else V c) tl (def_ X xs)) ↔
    if X = hd.name ∧ (List.map (fun x => if v = x then t else x) xs).length = hd.args.length then
      Holds D I (Function.updateListITE V hd.args (List.map V (List.map (fun x => if v = x then t else x) xs))) tl hd.q
    else Holds D I V tl (def_ X (List.map (fun x => if v = x then t else x) xs))
Tactic:
congr! 1
Proof state after:
case a.h₁.a
D : Type
I : Interpretation D
V' : VarAssignment D
v t : VarName
hd : Definition
tl : List Definition
ih :
  ∀ (V : VarAssignment D) (binders : Finset VarName) (F : Formula),
    fastAdmitsAux v t binders F →
      (∀ v ∉ binders, V' v = V v) →
        (Holds D I (Function.updateITE V v (V' t)) tl F ↔ Holds D I V tl (fastReplaceFree v t F))
X : DefName
xs : List VarName
V : VarAssignment D
binders : Finset VarName
h1 : v ∈ xs → t ∉ binders
h2 : ∀ v ∉ binders, V' v = V v
⊢ X = hd.name ∧ xs.length = hd.args.length ↔
    X = hd.name ∧ (List.map (fun x => if v = x then t else x) xs).length = hd.args.length

case a.h₂.a
D : Type
I : Interpretation D
V' : VarAssignment D
v t : VarName
hd : Definition
tl : List Definition
ih :
  ∀ (V : VarAssignment D) (binders : Finset VarName) (F : Formula),
    fastAdmitsAux v t binders F →
      (∀ v ∉ binders, V' v = V v) →
        (Holds D I (Function.updateITE V v (V' t)) tl F ↔ Holds D I V tl (fastReplaceFree v t F))
X : DefName
xs : List VarName
V : VarAssignment D
binders : Finset VarName
h1 : v ∈ xs → t ∉ binders
h2 : ∀ v ∉ binders, V' v = V v
a✝ : X = hd.name ∧ (List.map (fun x => if v = x then t else x) xs).length = hd.args.length
⊢ Holds D I
      (Function.updateListITE (fun c => if c = v then V' t else V c) hd.args
        (List.map (fun c => if c = v then V' t else V c) xs))
      tl hd.q ↔
    Holds D I (Function.updateListITE V hd.args (List.map V (List.map (fun x => if v = x then t else x) xs))) tl hd.q

case a.h₃.a
D : Type
I : Interpretation D
V' : VarAssignment D
v t : VarName
hd : Definition
tl : List Definition
ih :
  ∀ (V : VarAssignment D) (binders : Finset VarName) (F : Formula),
    fastAdmitsAux v t binders F →
      (∀ v ∉ binders, V' v = V v) →
        (Holds D I (Function.updateITE V v (V' t)) tl F ↔ Holds D I V tl (fastReplaceFree v t F))
X : DefName
xs : List VarName
V : VarAssignment D
binders : Finset VarName
h1 : v ∈ xs → t ∉ binders
h2 : ∀ v ∉ binders, V' v = V v
a✝ : ¬(X = hd.name ∧ (List.map (fun x => if v = x then t else x) xs).length = hd.args.length)
⊢ Holds D I (fun c => if c = v then V' t else V c) tl (def_ X xs) ↔
    Holds D I V tl (def_ X (List.map (fun x => if v = x then t else x) xs))