-- 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 β α)
id : Nat
c : β
rupHints : Array Nat
restPrf' : List (Action β α)
hprf : action :: restPrf = Action.addRup id c rupHints :: restPrf'
x✝ : σ × Bool
f' : σ
checkSuccess : Bool
heq : performRupAdd f c rupHints = (f', checkSuccess)
hCheckSuccess : checkSuccess = true
f'_success : lratChecker f' 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 β α)
id : Nat
c : β
rupHints : Array Nat
restPrf' : List (Action β α)
x✝ : σ × Bool
f' : σ
checkSuccess : Bool
heq : performRupAdd f c rupHints = (f', checkSuccess)
hCheckSuccess : checkSuccess = true
f'_success : lratChecker f' restPrf' = success
hprf : action = Action.addRup id c rupHints ∧ restPrf = restPrf'
⊢ 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
prfWellFormed : ∀ (a : Action β α), a ∈ action :: restPrf → WellFormedAction a
⊢ lratChecker f (action :: restPrf) = success → Unsatisfiable α f

Tactic:
simp only [List.find?, List.mem_cons, forall_eq_or_imp] at prfWellFormed

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
prfWellFormed : WellFormedAction action ∧ ∀ (a : Action β α), a ∈ restPrf → WellFormedAction a
⊢ lratChecker f (action :: restPrf) = success → Unsatisfiable α f

Proof state:
case intro.h_2
α : 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
tail✝ : List (Action β α)
heq✝ : action :: restPrf = Action.addEmpty id✝ rupHints✝ :: tail✝
⊢ (match performRupAdd f empty rupHints✝ with
      | (fst, checkSuccess) => if checkSuccess = true then success else rupFailure) =
      success →
    Unsatisfiable α f

Tactic:
next id rupHints restPrf' _ =>
simp [ite_eq_left_iff, Bool.not_eq_true]
intro rupAddSuccess
exact addEmptyCaseSound f f_readyForRupAdd rupHints rupAddSuccess

Result:
no goals

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'
⊢ (match performRupAdd f empty rupHints with
      | (fst, checkSuccess) => if checkSuccess = true then success else rupFailure) =
      success →
    Unsatisfiable α f

Tactic:
simp [ite_eq_left_iff, Bool.not_eq_true]

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'
⊢ (performRupAdd f empty rupHints).snd = true → Unsatisfiable α f

Proof state:
case intro.h_1
α : 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 β α)
heq✝ : action :: restPrf = []
h : outOfProof = success
⊢ False

Tactic:
simp at h

Result:
no goals