-- 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'
⊢ (match performRupAdd f c rupHints 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 : β
rupHints : Array Nat
restPrf' : List (Action β α)
hprf : action :: restPrf = Action.addRup id c rupHints :: restPrf'
x✝ : σ × Bool
fst✝ : σ
checkSuccess✝ : Bool
heq✝ : performRupAdd f c rupHints = (fst✝, checkSuccess✝)
⊢ (if checkSuccess✝ = true then lratChecker fst✝ restPrf' else rupFailure) = success → Unsatisfiable α f

Proof state:
case intro.h_5
α : 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 β α)
heq✝ : action :: restPrf = Action.del ids✝ :: restPrf✝
⊢ lratChecker (Formula.delete f ids✝) restPrf✝ = success → Unsatisfiable α f

Tactic:
next ids restPrf' hprf =>
intro h
simp only [List.cons.injEq] at hprf
rw [← hprf.2] at h
exact delCaseSound f f_readyForRupAdd f_readyForRatAdd ids restPrf restPrfWellFormed ih h

Result:
no goals

Proof state:
case isTrue
α : 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
f' : σ
checkSuccess : Bool
heq : performRatAdd f c pivot rupHints ratHints = (f', checkSuccess)
h✝ : checkSuccess = true
⊢ lratChecker f' restPrf' = success → Unsatisfiable α f

Tactic:
next hCheckSuccess =>
intro f'_success
simp only [List.cons.injEq] at hprf
rw [← hprf.2] at f'_success
rw [hCheckSuccess] at heq
simp only [WellFormedAction, hprf.1] at actionWellFormed
exact addRatCaseSound f f_readyForRupAdd f_readyForRatAdd c pivot f' rupHints ratHints actionWellFormed heq restPrf
  restPrfWellFormed ih f'_success

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
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

Tactic:
rw [hCheckSuccess] at heq

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', true)
hCheckSuccess : checkSuccess = true
f'_success : lratChecker f' restPrf = success
hprf : action = Action.addRup id c rupHints ∧ restPrf = restPrf'
⊢ 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 = []
⊢ outOfProof = success → Unsatisfiable α f

Tactic:
intro h

Result:
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
⊢ Unsatisfiable α f