-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Formula/RatAddSound.lean
theorem c_without_negPivot_of_performRatCheck_success {n : Nat} (f : DefaultFormula n)
    (hf : f.ratUnits = #[] ∧ AssignmentsInvariant f) (negPivot : Literal (PosFin n))
    (ratHint : Nat × Array Nat) (performRatCheck_success : (performRatCheck f negPivot ratHint).2)
    (c : DefaultClause n) :
    f.clauses[ratHint.1]! = some c → Limplies (PosFin n) f (c.delete negPivot)

Proof state:
case isFalse.isTrue
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.AssignmentsInvariant
negPivot : Literal (PosFin n)
ratHint : Nat × Array Nat
c : DefaultClause n
hc : f.clauses[ratHint.fst]! = some c
p : PosFin n → Bool
pf : p ⊨ f
h✝¹ :
  ¬({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
              assignments := f.assignments }.insertRatUnits
          (c.delete negPivot).negate).snd =
      true
h✝ :
  (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                        assignments := f.assignments }.insertRatUnits
                    (c.delete negPivot).negate).fst.performRupCheck
              ratHint.snd).2.2.snd =
      true ∨
    (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                        assignments := f.assignments }.insertRatUnits
                    (c.delete negPivot).negate).fst.performRupCheck
              ratHint.snd).2.2.fst =
      false
performRatCheck_success :
  ({
            clauses :=
              (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                              assignments := f.assignments }.insertRatUnits
                          (c.delete negPivot).negate).fst.performRupCheck
                    ratHint.snd).1.clauses,
            rupUnits :=
              (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                              assignments := f.assignments }.insertRatUnits
                          (c.delete negPivot).negate).fst.performRupCheck
                    ratHint.snd).1.rupUnits,
            ratUnits :=
              (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                              assignments := f.assignments }.insertRatUnits
                          (c.delete negPivot).negate).fst.performRupCheck
                    ratHint.snd).1.ratUnits,
            assignments :=
              restoreAssignments
                (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                                assignments := f.assignments }.insertRatUnits
                            (c.delete negPivot).negate).fst.performRupCheck
                      ratHint.snd).1.assignments
                (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                                assignments := f.assignments }.insertRatUnits
                            (c.delete negPivot).negate).fst.performRupCheck
                      ratHint.snd).2.fst }.clearRatUnits,
        false).snd =
    true
⊢ p ⊨ c.delete negPivot

Tactic:
simp at performRatCheck_success

Result:
no goals

Proof state:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.AssignmentsInvariant
negPivot : Literal (PosFin n)
ratHint : Nat × Array Nat
performRatCheck_success : (f.performRatCheck negPivot ratHint).snd = true
c : DefaultClause n
⊢ f.clauses[ratHint.fst]! = some c → Limplies (PosFin n) f (c.delete negPivot)

Tactic:
intro hc p pf

Result:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.AssignmentsInvariant
negPivot : Literal (PosFin n)
ratHint : Nat × Array Nat
performRatCheck_success : (f.performRatCheck negPivot ratHint).snd = true
c : DefaultClause n
hc : f.clauses[ratHint.fst]! = some c
p : PosFin n → Bool
pf : p ⊨ f
⊢ p ⊨ c.delete negPivot

Proof state:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.AssignmentsInvariant
negPivot : Literal (PosFin n)
ratHint : Nat × Array Nat
c : DefaultClause n
hc : f.clauses[ratHint.fst]! = some c
p : PosFin n → Bool
pf : p ⊨ f
h✝ :
  ¬({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
              assignments := f.assignments }.insertRatUnits
          (c.delete negPivot).negate).snd =
      true
performRatCheck_success :
  ({
            clauses :=
              (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                              assignments := f.assignments }.insertRatUnits
                          (c.delete negPivot).negate).fst.performRupCheck
                    ratHint.snd).1.clauses,
            rupUnits :=
              (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                              assignments := f.assignments }.insertRatUnits
                          (c.delete negPivot).negate).fst.performRupCheck
                    ratHint.snd).1.rupUnits,
            ratUnits :=
              (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                              assignments := f.assignments }.insertRatUnits
                          (c.delete negPivot).negate).fst.performRupCheck
                    ratHint.snd).1.ratUnits,
            assignments :=
              restoreAssignments
                (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                                assignments := f.assignments }.insertRatUnits
                            (c.delete negPivot).negate).fst.performRupCheck
                      ratHint.snd).1.assignments
                (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                                assignments := f.assignments }.insertRatUnits
                            (c.delete negPivot).negate).fst.performRupCheck
                      ratHint.snd).2.fst }.clearRatUnits,
        true).snd =
    true
h :
  (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                        assignments := f.assignments }.insertRatUnits
                    (c.delete negPivot).negate).fst.performRupCheck
              ratHint.snd).2.2.snd =
      false ∧
    (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                        assignments := f.assignments }.insertRatUnits
                    (c.delete negPivot).negate).fst.performRupCheck
              ratHint.snd).2.2.fst =
      true
pfc : ∀ (x : DefaultClause n), x ∈ (f.insert (c.delete negPivot)).toList → decide (p ⊨ x) = true
⊢ c.delete negPivot ∈ (f.insert (c.delete negPivot)).toList

Tactic:
simp [insert_iff]

Result:
no goals

Proof state:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.AssignmentsInvariant
negPivot : Literal (PosFin n)
ratHint : Nat × Array Nat
c : DefaultClause n
hc : f.clauses[ratHint.fst]! = some c
p : PosFin n → Bool
pf : p ⊨ f
h :
  ({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits, assignments := f.assignments }.insertRatUnits
        (c.delete negPivot).negate).snd =
    true
performRatCheck_success :
  (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                  assignments := f.assignments }.insertRatUnits
              (c.delete negPivot).negate).fst.clearRatUnits,
        true).snd =
    true
⊢ p ⊨ c.delete negPivot

Tactic:
exact sat_of_insertRat f hf (c.delete negPivot) p pf h

Result:
no goals