Theorem: LRAT.DefaultFormula.ratAdd_sound (LeanSAT/LRAT/Formula/RatAddSound.lean)

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
ratAddSuccess : f.performRatAdd c pivot rupHints ratHints = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
have f'_def := ratAdd_result f c pivot rupHints ratHints f' f_readyForRatAdd pivot_in_c ratAddSuccess
State after:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
ratAddSuccess : f.performRatAdd c pivot rupHints ratHints = (f', true)
f'_def : f' = f.insert c
⊢ equisat (PosFin n) f f'

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
ratAddSuccess : f.performRatAdd c pivot rupHints ratHints = (f', true)
f'_def : f' = f.insert c
⊢ equisat (PosFin n) f f'
Tactic:
rw [performRatAdd] at ratAddSuccess
State after:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
ratAddSuccess :
  (if f.ratHintsExhaustive pivot ratHints = true then
      let negC := c.negate;
      match f.insertRupUnits negC with
      | (f, contradictionFound) =>
        if contradictionFound = true then (f, false)
        else
          match f.performRupCheck rupHints with
          | (f, derivedLits, derivedEmpty, encounteredError) =>
            if encounteredError = true then (f, false)
            else
              if derivedEmpty = true then (f, false)
              else
                let fold_fn := fun x ratHint =>
                  match x with
                  | (f, allChecksPassed) =>
                    if allChecksPassed = true then f.performRatCheck pivot.negateLiteral ratHint else (f, false);
                match Array.foldl fold_fn (f, true) ratHints 0 with
                | (f, allChecksPassed) =>
                  if (!allChecksPassed) = true then (f, false)
                  else
                    match f with
                    | { clauses := clauses, rupUnits := rupUnits, ratUnits := ratUnits, assignments := assignments } =>
                      let assignments := restoreAssignments assignments derivedLits;
                      let f :=
                        { clauses := clauses, rupUnits := rupUnits, ratUnits := ratUnits,
                            assignments := assignments }.clearRupUnits;
                      (f.insert c, true)
    else (f, false)) =
    (f', true)
f'_def : f' = f.insert c
⊢ equisat (PosFin n) f f'

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
ratAddSuccess :
  (if f.ratHintsExhaustive pivot ratHints = true then
      let negC := c.negate;
      match f.insertRupUnits negC with
      | (f, contradictionFound) =>
        if contradictionFound = true then (f, false)
        else
          match f.performRupCheck rupHints with
          | (f, derivedLits, derivedEmpty, encounteredError) =>
            if encounteredError = true then (f, false)
            else
              if derivedEmpty = true then (f, false)
              else
                let fold_fn := fun x ratHint =>
                  match x with
                  | (f, allChecksPassed) =>
                    if allChecksPassed = true then f.performRatCheck pivot.negateLiteral ratHint else (f, false);
                match Array.foldl fold_fn (f, true) ratHints 0 with
                | (f, allChecksPassed) =>
                  if (!allChecksPassed) = true then (f, false)
                  else
                    match f with
                    | { clauses := clauses, rupUnits := rupUnits, ratUnits := ratUnits, assignments := assignments } =>
                      let assignments := restoreAssignments assignments derivedLits;
                      let f :=
                        { clauses := clauses, rupUnits := rupUnits, ratUnits := ratUnits,
                            assignments := assignments }.clearRupUnits;
                      (f.insert c, true)
    else (f, false)) =
    (f', true)
f'_def : f' = f.insert c
⊢ equisat (PosFin n) f f'
Tactic:
simp at ratAddSuccess
State after:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratAddSuccess :
  (if f.ratHintsExhaustive pivot ratHints = true then
      if (f.insertRupUnits c.negate).snd = true then ((f.insertRupUnits c.negate).fst, false)
      else
        if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
        else
          if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
          else
            if
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
                  false then
              ((Array.foldl
                    (fun x ratHint =>
                      if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                    (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
                false)
            else
              ({
                        clauses :=
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.clauses,
                        rupUnits :=
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.rupUnits,
                        ratUnits :=
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.ratUnits,
                        assignments :=
                          restoreAssignments
                            (Array.foldl
                                  (fun x ratHint =>
                                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                    else (x.fst, false))
                                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                  0).1.assignments
                            ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
                  c,
                true)
    else (f, false)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratAddSuccess :
  (if f.ratHintsExhaustive pivot ratHints = true then
      if (f.insertRupUnits c.negate).snd = true then ((f.insertRupUnits c.negate).fst, false)
      else
        if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
        else
          if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
          else
            if
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
                  false then
              ((Array.foldl
                    (fun x ratHint =>
                      if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                    (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
                false)
            else
              ({
                        clauses :=
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.clauses,
                        rupUnits :=
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.rupUnits,
                        ratUnits :=
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.ratUnits,
                        assignments :=
                          restoreAssignments
                            (Array.foldl
                                  (fun x ratHint =>
                                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                    else (x.fst, false))
                                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                  0).1.assignments
                            ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
                  c,
                true)
    else (f, false)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
split at ratAddSuccess
State after:
case isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess :
  (if (f.insertRupUnits c.negate).snd = true then ((f.insertRupUnits c.negate).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
        else
          if
              (Array.foldl
                    (fun x ratHint =>
                      if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                    (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
                false then
            ((Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
              false)
          else
            ({
                      clauses :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.clauses,
                      rupUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.rupUnits,
                      ratUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.ratUnits,
                      assignments :=
                        restoreAssignments
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.assignments
                          ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
                c,
              true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : ¬f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess : (f, false) = (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess :
  (if (f.insertRupUnits c.negate).snd = true then ((f.insertRupUnits c.negate).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
        else
          if
              (Array.foldl
                    (fun x ratHint =>
                      if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                    (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
                false then
            ((Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
              false)
          else
            ({
                      clauses :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.clauses,
                      rupUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.rupUnits,
                      ratUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.ratUnits,
                      assignments :=
                        restoreAssignments
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.assignments
                          ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
                c,
              true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : ¬f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess : (f, false) = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. next ratHintsExhaustive_eq_true =>
  split at ratAddSuccess
  . simp at ratAddSuccess
  . split at ratAddSuccess
    . simp at ratAddSuccess
    . split at ratAddSuccess
      . simp at ratAddSuccess
      . split at ratAddSuccess
        . simp at ratAddSuccess
        . next performRatCheck_fold_success =>
          simp only [Bool.not_eq_false] at performRatCheck_fold_success
          rw [f'_def]
          exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
            ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : ¬f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess : (f, false) = (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : ¬f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess : (f, false) = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. simp at ratAddSuccess
State after:
no goals

State before:
case isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess :
  (if (f.insertRupUnits c.negate).snd = true then ((f.insertRupUnits c.negate).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
        else
          if
              (Array.foldl
                    (fun x ratHint =>
                      if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                    (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
                false then
            ((Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
              false)
          else
            ({
                      clauses :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.clauses,
                      rupUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.rupUnits,
                      ratUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.ratUnits,
                      assignments :=
                        restoreAssignments
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.assignments
                          ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
                c,
              true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
next ratHintsExhaustive_eq_true =>
split at ratAddSuccess
. simp at ratAddSuccess
. split at ratAddSuccess
  . simp at ratAddSuccess
  . split at ratAddSuccess
    . simp at ratAddSuccess
    . split at ratAddSuccess
      . simp at ratAddSuccess
      . next performRatCheck_fold_success =>
        simp only [Bool.not_eq_false] at performRatCheck_fold_success
        rw [f'_def]
        exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
          ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess :
  (if (f.insertRupUnits c.negate).snd = true then ((f.insertRupUnits c.negate).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
        else
          if
              (Array.foldl
                    (fun x ratHint =>
                      if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                    (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
                false then
            ((Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
              false)
          else
            ({
                      clauses :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.clauses,
                      rupUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.rupUnits,
                      ratUnits :=
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.ratUnits,
                      assignments :=
                        restoreAssignments
                          (Array.foldl
                                (fun x ratHint =>
                                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                  else (x.fst, false))
                                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                                0).1.assignments
                          ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
                c,
              true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
split at ratAddSuccess
State after:
case isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : (f.insertRupUnits c.negate).snd = true
ratAddSuccess : ((f.insertRupUnits c.negate).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'

case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : ¬(f.insertRupUnits c.negate).snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if
            (Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
              false then
          ((Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
            false)
        else
          ({
                    clauses :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.clauses,
                    rupUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.rupUnits,
                    ratUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.ratUnits,
                    assignments :=
                      restoreAssignments
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.assignments
                        ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
              c,
            true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : (f.insertRupUnits c.negate).snd = true
ratAddSuccess : ((f.insertRupUnits c.negate).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'

case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : ¬(f.insertRupUnits c.negate).snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if
            (Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
              false then
          ((Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
            false)
        else
          ({
                    clauses :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.clauses,
                    rupUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.rupUnits,
                    ratUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.ratUnits,
                    assignments :=
                      restoreAssignments
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.assignments
                        ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
              c,
            true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. simp at ratAddSuccess
State after:
case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : ¬(f.insertRupUnits c.negate).snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if
            (Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
              false then
          ((Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
            false)
        else
          ({
                    clauses :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.clauses,
                    rupUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.rupUnits,
                    ratUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.ratUnits,
                    assignments :=
                      restoreAssignments
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.assignments
                        ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
              c,
            true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : ¬(f.insertRupUnits c.negate).snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if
            (Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
              false then
          ((Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
            false)
        else
          ({
                    clauses :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.clauses,
                    rupUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.rupUnits,
                    ratUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.ratUnits,
                    assignments :=
                      restoreAssignments
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.assignments
                        ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
              c,
            true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. split at ratAddSuccess
  . simp at ratAddSuccess
  . split at ratAddSuccess
    . simp at ratAddSuccess
    . split at ratAddSuccess
      . simp at ratAddSuccess
      . next performRatCheck_fold_success =>
        simp only [Bool.not_eq_false] at performRatCheck_fold_success
        rw [f'_def]
        exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
          ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
case isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : (f.insertRupUnits c.negate).snd = true
ratAddSuccess : ((f.insertRupUnits c.negate).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
simp at ratAddSuccess
State after:
no goals

State before:
case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝ : ¬(f.insertRupUnits c.negate).snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
      else
        if
            (Array.foldl
                  (fun x ratHint =>
                    if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                  (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
              false then
          ((Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
            false)
        else
          ({
                    clauses :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.clauses,
                    rupUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.rupUnits,
                    ratUnits :=
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.ratUnits,
                    assignments :=
                      restoreAssignments
                        (Array.foldl
                              (fun x ratHint =>
                                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                                else (x.fst, false))
                              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                              0).1.assignments
                        ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
              c,
            true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
split at ratAddSuccess
State after:
case isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess : (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'

case isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if
          (Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
            false then
        ((Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
          false)
      else
        ({
                  clauses :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                  rupUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                  ratUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                  assignments :=
                    restoreAssignments
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.assignments
                      ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
            c,
          true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess : (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'

case isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if
          (Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
            false then
        ((Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
          false)
      else
        ({
                  clauses :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                  rupUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                  ratUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                  assignments :=
                    restoreAssignments
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.assignments
                      ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
            c,
          true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. simp at ratAddSuccess
State after:
case isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if
          (Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
            false then
        ((Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
          false)
      else
        ({
                  clauses :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                  rupUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                  ratUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                  assignments :=
                    restoreAssignments
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.assignments
                      ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
            c,
          true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if
          (Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
            false then
        ((Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
          false)
      else
        ({
                  clauses :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                  rupUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                  ratUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                  assignments :=
                    restoreAssignments
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.assignments
                      ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
            c,
          true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. split at ratAddSuccess
  . simp at ratAddSuccess
  . split at ratAddSuccess
    . simp at ratAddSuccess
    . next performRatCheck_fold_success =>
      simp only [Bool.not_eq_false] at performRatCheck_fold_success
      rw [f'_def]
      exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
        ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
case isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess : (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
simp at ratAddSuccess
State after:
no goals

State before:
case isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝¹ : ¬(f.insertRupUnits c.negate).snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
ratAddSuccess :
  (if ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true then
      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false)
    else
      if
          (Array.foldl
                (fun x ratHint =>
                  if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
            false then
        ((Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
          false)
      else
        ({
                  clauses :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                  rupUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                  ratUnits :=
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                  assignments :=
                    restoreAssignments
                      (Array.foldl
                            (fun x ratHint =>
                              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint
                              else (x.fst, false))
                            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                            0).1.assignments
                      ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
            c,
          true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
split at ratAddSuccess
State after:
case isFalse.isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess : (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'

case isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  (if
        (Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
          false then
      ((Array.foldl
            (fun x ratHint =>
              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
        false)
    else
      ({
                clauses :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                rupUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                ratUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                assignments :=
                  restoreAssignments
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                          0).1.assignments
                    ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
          c,
        true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse.isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess : (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'

case isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  (if
        (Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
          false then
      ((Array.foldl
            (fun x ratHint =>
              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
        false)
    else
      ({
                clauses :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                rupUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                ratUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                assignments :=
                  restoreAssignments
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                          0).1.assignments
                    ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
          c,
        true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. simp at ratAddSuccess
State after:
case isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  (if
        (Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
          false then
      ((Array.foldl
            (fun x ratHint =>
              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
        false)
    else
      ({
                clauses :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                rupUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                ratUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                assignments :=
                  restoreAssignments
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                          0).1.assignments
                    ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
          c,
        true)) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  (if
        (Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
          false then
      ((Array.foldl
            (fun x ratHint =>
              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
        false)
    else
      ({
                clauses :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                rupUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                ratUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                assignments :=
                  restoreAssignments
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                          0).1.assignments
                    ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
          c,
        true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. split at ratAddSuccess
  . simp at ratAddSuccess
  . next performRatCheck_fold_success =>
    simp only [Bool.not_eq_false] at performRatCheck_fold_success
    rw [f'_def]
    exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
      ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
case isFalse.isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess : (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, false) = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
simp at ratAddSuccess
State after:
no goals

State before:
case isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  (if
        (Array.foldl
              (fun x ratHint =>
                if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
              (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
          false then
      ((Array.foldl
            (fun x ratHint =>
              if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
            (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
        false)
    else
      ({
                clauses :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
                rupUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
                ratUnits :=
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
                assignments :=
                  restoreAssignments
                    (Array.foldl
                          (fun x ratHint =>
                            if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints
                          0).1.assignments
                    ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
          c,
        true)) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
split at ratAddSuccess
State after:
case isFalse.isFalse.isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    false
ratAddSuccess :
  ((Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
      false) =
    (f', true)
⊢ equisat (PosFin n) f f'

case isFalse.isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  ¬(Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
      false
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse.isFalse.isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    false
ratAddSuccess :
  ((Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
      false) =
    (f', true)
⊢ equisat (PosFin n) f f'

case isFalse.isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  ¬(Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
      false
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. simp at ratAddSuccess
State after:
case isFalse.isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  ¬(Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
      false
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
⊢ equisat (PosFin n) f f'

State before:
case isFalse.isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  ¬(Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
      false
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
. next performRatCheck_fold_success =>
  simp only [Bool.not_eq_false] at performRatCheck_fold_success
  rw [f'_def]
  exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
    ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
case isFalse.isFalse.isFalse.isTrue
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    false
ratAddSuccess :
  ((Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).fst,
      false) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
simp at ratAddSuccess
State after:
no goals

State before:
case isFalse.isFalse.isFalse.isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝³ : ¬(f.insertRupUnits c.negate).snd = true
h✝² : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
h✝ :
  ¬(Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
      false
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
next performRatCheck_fold_success =>
simp only [Bool.not_eq_false] at performRatCheck_fold_success
rw [f'_def]
exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
  ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
performRatCheck_fold_success :
  ¬(Array.foldl
          (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
          (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
      false
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
simp only [Bool.not_eq_false] at performRatCheck_fold_success
State after:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
performRatCheck_fold_success :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    true
⊢ equisat (PosFin n) f f'

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
performRatCheck_fold_success :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    true
⊢ equisat (PosFin n) f f'
Tactic:
rw [f'_def]
State after:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
performRatCheck_fold_success :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    true
⊢ equisat (PosFin n) f (f.insert c)

State before:
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
ratHintsExhaustive_eq_true : f.ratHintsExhaustive pivot ratHints = true
h✝² : ¬(f.insertRupUnits c.negate).snd = true
h✝¹ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.snd = true
h✝ : ¬((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.2.fst = true
ratAddSuccess :
  ({
              clauses :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.clauses,
              rupUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.rupUnits,
              ratUnits :=
                (Array.foldl
                      (fun x ratHint =>
                        if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                      (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.ratUnits,
              assignments :=
                restoreAssignments
                  (Array.foldl
                        (fun x ratHint =>
                          if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
                        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).1.assignments
                  ((f.insertRupUnits c.negate).fst.performRupCheck rupHints).2.fst }.clearRupUnits.insert
        c,
      true) =
    (f', true)
performRatCheck_fold_success :
  (Array.foldl
        (fun x ratHint => if x.snd = true then x.fst.performRatCheck pivot.negateLiteral ratHint else (x.fst, false))
        (((f.insertRupUnits c.negate).fst.performRupCheck rupHints).fst, true) ratHints 0).snd =
    true
⊢ equisat (PosFin n) f (f.insert c)
Tactic:
exact performRatCheck_fold_success_entails_safe_insert f f_readyForRatAdd c pivot rupHints ratHints pivot_in_c
  ratHintsExhaustive_eq_true performRatCheck_fold_success
State after:
no goals

State before:
case isFalse
n : Nat
f : DefaultFormula n
c : DefaultClause n
pivot : Literal (PosFin n)
rupHints : Array Nat
ratHints : Array (Nat × Array Nat)
f' : DefaultFormula n
f_readyForRatAdd : f.readyForRatAdd
pivot_in_c : pivot ∈ Clause.toList c
f'_def : f' = f.insert c
h✝ : ¬f.ratHintsExhaustive pivot ratHints = true
ratAddSuccess : (f, false) = (f', true)
⊢ equisat (PosFin n) f f'
Tactic:
simp at ratAddSuccess
State after:
no goals