Theorem: FOL.NV.Sub.Pred.All.Rec.substitution_is_valid (FOL/NV/Sub/Pred/All/Rec/Sub.lean)

State before:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : F.IsValid
⊢ (replace τ F).IsValid
Tactic:
simp only [IsValid] at h2
State after:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
⊢ (replace τ F).IsValid

State before:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
⊢ (replace τ F).IsValid
Tactic:
simp only [IsValid]
State after:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
⊢ ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E (replace τ F)

State before:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
⊢ ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E (replace τ F)
Tactic:
intro D I V E
State after:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
D : Type
I : Interpretation D
V : VarAssignment D
E : Env
⊢ Holds D I V E (replace τ F)

State before:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
D : Type
I : Interpretation D
V : VarAssignment D
E : Env
⊢ Holds D I V E (replace τ F)
Tactic:
obtain s1 := substitution_theorem D I V E τ F h1
State after:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
D : Type
I : Interpretation D
V : VarAssignment D
E : Env
s1 :
  Holds D
      { nonempty := ⋯, pred_const_ := I.pred_const_,
        pred_var_ := fun X ds =>
          let zs := (τ X ds.length).1;
          let H := (τ X ds.length).2;
          if ds.length = zs.length then Holds D I (Function.updateListITE V zs ds) E H else I.pred_var_ X ds }
      V E F ↔
    Holds D I V E (replace τ F)
⊢ Holds D I V E (replace τ F)

State before:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
D : Type
I : Interpretation D
V : VarAssignment D
E : Env
s1 :
  Holds D
      { nonempty := ⋯, pred_const_ := I.pred_const_,
        pred_var_ := fun X ds =>
          let zs := (τ X ds.length).1;
          let H := (τ X ds.length).2;
          if ds.length = zs.length then Holds D I (Function.updateListITE V zs ds) E H else I.pred_var_ X ds }
      V E F ↔
    Holds D I V E (replace τ F)
⊢ Holds D I V E (replace τ F)
Tactic:
simp only [← s1]
State after:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
D : Type
I : Interpretation D
V : VarAssignment D
E : Env
s1 :
  Holds D
      { nonempty := ⋯, pred_const_ := I.pred_const_,
        pred_var_ := fun X ds =>
          let zs := (τ X ds.length).1;
          let H := (τ X ds.length).2;
          if ds.length = zs.length then Holds D I (Function.updateListITE V zs ds) E H else I.pred_var_ X ds }
      V E F ↔
    Holds D I V E (replace τ F)
⊢ Holds D
    { nonempty := ⋯, pred_const_ := I.pred_const_,
      pred_var_ := fun X ds =>
        if ds.length = (τ X ds.length).1.length then
          Holds D I (Function.updateListITE V (τ X ds.length).1 ds) E (τ X ds.length).2
        else I.pred_var_ X ds }
    V E F

State before:
F : Formula
τ : PredName → ℕ → List VarName × Formula
h1 : admits τ F
h2 : ∀ (D : Type) (I : Interpretation D) (V : VarAssignment D) (E : Env), Holds D I V E F
D : Type
I : Interpretation D
V : VarAssignment D
E : Env
s1 :
  Holds D
      { nonempty := ⋯, pred_const_ := I.pred_const_,
        pred_var_ := fun X ds =>
          let zs := (τ X ds.length).1;
          let H := (τ X ds.length).2;
          if ds.length = zs.length then Holds D I (Function.updateListITE V zs ds) E H else I.pred_var_ X ds }
      V E F ↔
    Holds D I V E (replace τ F)
⊢ Holds D
    { nonempty := ⋯, pred_const_ := I.pred_const_,
      pred_var_ := fun X ds =>
        if ds.length = (τ X ds.length).1.length then
          Holds D I (Function.updateListITE V (τ X ds.length).1 ds) E (τ X ds.length).2
        else I.pred_var_ X ds }
    V E F
Tactic:
apply h2
State after:
no goals