-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/LRATCheckerSound.lean
theorem lratCheckerSound [DecidableEq α] [Clause α β] [Entails α σ] [Formula α β σ] (f : σ)
    (f_readyForRupAdd : ReadyForRupAdd f) (f_readyForRatAdd : ReadyForRatAdd f)
    (prf : List (Action β α)) (prfWellFormed : ∀ a : Action β α, a ∈ prf → WellFormedAction a) :
    lratChecker f prf = success → Unsatisfiable α f

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
ids : Array Nat
restPrf' : List (Action β α)
h : lratChecker (Formula.delete f ids) restPrf = success
hprf : action = Action.del ids ∧ restPrf = restPrf'
⊢ Unsatisfiable α f

Tactic:
exact delCaseSound f f_readyForRupAdd f_readyForRatAdd ids restPrf restPrfWellFormed ih h

Result:
no goals

Proof state:
case nil
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
prfWellFormed : ∀ (a : Action β α), a ∈ [] → WellFormedAction a
⊢ outOfProof = success → Unsatisfiable α f

Tactic:
simp [false_implies]

Result:
no goals

Proof state:
case nil
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
prfWellFormed : ∀ (a : Action β α), a ∈ [] → WellFormedAction a
⊢ lratChecker f [] = success → Unsatisfiable α f

Tactic:
unfold lratChecker

Result:
case nil
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
prfWellFormed : ∀ (a : Action β α), a ∈ [] → WellFormedAction a
⊢ outOfProof = success → Unsatisfiable α f

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
id : Nat
c : β
pivot : Literal α
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
restPrf' : List (Action β α)
hprf : action :: restPrf = Action.addRat id c pivot rupHints ratHints :: restPrf'
⊢ (match performRatAdd f c pivot rupHints ratHints with
      | (f, checkSuccess) => if checkSuccess = true then lratChecker f restPrf' else rupFailure) =
      success →
    Unsatisfiable α f

Tactic:
split

Result:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
id : Nat
c : β
pivot : Literal α
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
restPrf' : List (Action β α)
hprf : action :: restPrf = Action.addRat id c pivot rupHints ratHints :: restPrf'
x✝ : σ × Bool
fst✝ : σ
checkSuccess✝ : Bool
heq✝ : performRatAdd f c pivot rupHints ratHints = (fst✝, checkSuccess✝)
⊢ (if checkSuccess✝ = true then lratChecker fst✝ restPrf' else rupFailure) = success → Unsatisfiable α f

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
id : Nat
rupHints : Array Nat
restPrf' : List (Action β α)
heq✝ : action :: restPrf = Action.addEmpty id rupHints :: restPrf'
⊢ (performRupAdd f empty rupHints).snd = true → Unsatisfiable α f

Tactic:
intro rupAddSuccess

Result:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
id : Nat
rupHints : Array Nat
restPrf' : List (Action β α)
heq✝ : action :: restPrf = Action.addEmpty id rupHints :: restPrf'
rupAddSuccess : (performRupAdd f empty rupHints).snd = true
⊢ Unsatisfiable α f

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
ids : Array Nat
restPrf' : List (Action β α)
hprf : action :: restPrf = Action.del ids :: restPrf'
h : lratChecker (Formula.delete f ids) restPrf' = success
⊢ Unsatisfiable α f

Tactic:
simp only [List.cons.injEq] at hprf

Result:
α : Type u_1
β : Type u_2
σ : Type u_3
inst✝³ : DecidableEq α
inst✝² : Clause α β
inst✝¹ : Entails α σ
inst✝ : Formula α β σ
action : Action β α
restPrf : List (Action β α)
ih :
  ∀ (f : σ),
    ReadyForRupAdd f →
      ReadyForRatAdd f →
        (∀ (a : Action β α), a ∈ restPrf → WellFormedAction a) → lratChecker f restPrf = success → Unsatisfiable α f
f : σ
f_readyForRupAdd : ReadyForRupAdd f
f_readyForRatAdd : ReadyForRatAdd f
actionWellFormed : WellFormedAction action
restPrfWellFormed : ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
prf✝ : List (Action β α)
ids : Array Nat
restPrf' : List (Action β α)
h : lratChecker (Formula.delete f ids) restPrf' = success
hprf : action = Action.del ids ∧ restPrf = restPrf'
⊢ Unsatisfiable α f