Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant
Proof state before:
case intro.isTrue
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
i : Fin rupHints.size
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
hsize' : (confirmRupHint f.clauses acc rupHints[i]).fst.size = n
h✝ : (acc.2.2.snd || acc.2.2.fst) = true
⊢ f.derivedLits_invariant f_assignments_size (acc.fst, acc.2.fst, acc.2.2.fst, acc.2.2.snd).fst ⋯
    (acc.fst, acc.2.fst, acc.2.2.fst, acc.2.2.snd).snd.fst

case intro.isFalse
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
i : Fin rupHints.size
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
hsize' : (confirmRupHint f.clauses acc rupHints[i]).fst.size = n
h✝ : ¬(acc.2.2.snd || acc.2.2.fst) = true
⊢ f.derivedLits_invariant f_assignments_size
    (match f.clauses[rupHints[↑i]]? with
      | some (some c) =>
        match c.reduce acc.fst with
        | ReduceResult.encounteredBoth => (acc.fst, acc.2.fst, true, false)
        | ReduceResult.reducedToEmpty => (acc.fst, acc.2.fst, true, false)
        | ReduceResult.reducedToUnit (l, b) =>
          if hasAssignment b acc.fst[l.val]! = true then (acc.fst, acc.2.fst, false, false)
          else (acc.fst.modify l.val (addAssignment b), (l, b) :: acc.2.fst, false, false)
        | ReduceResult.reducedToNonunit => (acc.fst, acc.2.fst, false, true)
      | some none => (acc.fst, acc.2.fst, false, true)
      | none => (acc.fst, acc.2.fst, false, true)).fst
    ⋯
    (match f.clauses[rupHints[↑i]]? with
        | some (some c) =>
          match c.reduce acc.fst with
          | ReduceResult.encounteredBoth => (acc.fst, acc.2.fst, true, false)
          | ReduceResult.reducedToEmpty => (acc.fst, acc.2.fst, true, false)
          | ReduceResult.reducedToUnit (l, b) =>
            if hasAssignment b acc.fst[l.val]! = true then (acc.fst, acc.2.fst, false, false)
            else (acc.fst.modify l.val (addAssignment b), (l, b) :: acc.2.fst, false, false)
          | ReduceResult.reducedToNonunit => (acc.fst, acc.2.fst, false, true)
        | some none => (acc.fst, acc.2.fst, false, true)
        | none => (acc.fst, acc.2.fst, false, true)).snd.fst
Tactic:
. exact ih
Proof state after:
case intro.isFalse
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
rupHints : Array Nat
i : Fin rupHints.size
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
hsize' : (confirmRupHint f.clauses acc rupHints[i]).fst.size = n
h✝ : ¬(acc.2.2.snd || acc.2.2.fst) = true
⊢ f.derivedLits_invariant f_assignments_size
    (match f.clauses[rupHints[↑i]]? with
      | some (some c) =>
        match c.reduce acc.fst with
        | ReduceResult.encounteredBoth => (acc.fst, acc.2.fst, true, false)
        | ReduceResult.reducedToEmpty => (acc.fst, acc.2.fst, true, false)
        | ReduceResult.reducedToUnit (l, b) =>
          if hasAssignment b acc.fst[l.val]! = true then (acc.fst, acc.2.fst, false, false)
          else (acc.fst.modify l.val (addAssignment b), (l, b) :: acc.2.fst, false, false)
        | ReduceResult.reducedToNonunit => (acc.fst, acc.2.fst, false, true)
      | some none => (acc.fst, acc.2.fst, false, true)
      | none => (acc.fst, acc.2.fst, false, true)).fst
    ⋯
    (match f.clauses[rupHints[↑i]]? with
        | some (some c) =>
          match c.reduce acc.fst with
          | ReduceResult.encounteredBoth => (acc.fst, acc.2.fst, true, false)
          | ReduceResult.reducedToEmpty => (acc.fst, acc.2.fst, true, false)
          | ReduceResult.reducedToUnit (l, b) =>
            if hasAssignment b acc.fst[l.val]! = true then (acc.fst, acc.2.fst, false, false)
            else (acc.fst.modify l.val (addAssignment b), (l, b) :: acc.2.fst, false, false)
          | ReduceResult.reducedToNonunit => (acc.fst, acc.2.fst, false, true)
        | some none => (acc.fst, acc.2.fst, false, true)
        | none => (acc.fst, acc.2.fst, false, true)).snd.fst