internlm/Lean-Github huggingface dataset:
Theorem: LRAT.DefaultFormula.clear_insertRat
Proof state before:
case assignments.intro.h₂.inr.inr
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  ∃ j1 j2 i_gt_zero,
    ↑j1 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
      ↑j2 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
        (f.insertRatUnits units).fst.ratUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
          (f.insertRatUnits units).fst.ratUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
            (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments
                    (f.insertRatUnits units).fst.ratUnits 0)[↑⟨i, i_lt_n⟩] =
                both ∧
              f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                  ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                    k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]
Tactic:
. omega
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insertRat
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
h :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i :=
      (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
          0)[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
          ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
            (f.insertRatUnits units).fst.ratUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                    ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                      k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
            ↑j2 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
              (f.insertRatUnits units).fst.ratUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRatUnits units).fst.ratUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                        ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                          k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
⊢ i < n
Tactic:
omega
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insertRat
Proof state before:
case assignments.intro.h₂.inl
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
          0)[↑⟨i, i_lt_n⟩] =
      f.assignments[↑⟨i, i_lt_n⟩] ∧
    ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
      ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]
Tactic:
exact h.1
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insertRat
Proof state before:
case assignments.intro.h₂.inr.inl
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  ∃ j b i_gt_zero,
    ↑j ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
      (f.insertRatUnits units).fst.ratUnits[j] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, b) ∧
        (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments
                (f.insertRatUnits units).fst.ratUnits 0)[↑⟨i, i_lt_n⟩] =
            addAssignment b f.assignments[↑⟨i, i_lt_n⟩] ∧
          ¬hasAssignment b f.assignments[↑⟨i, i_lt_n⟩] = true ∧
            ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
              ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]
Tactic:
omega
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insertRat
Proof state before:
case assignments.intro.h₂.inr.inr
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
motive : Nat → Array Assignment → Prop := f.clear_insert_induction_motive ⋯ (f.insertRatUnits units).fst.ratUnits
h_base : motive 0 (f.insertRatUnits units).fst.assignments
h_inductive :
  ∀ (idx : Fin (f.insertRatUnits units).fst.ratUnits.size) (assignments : Array Assignment),
    motive (↑idx) assignments → motive (↑idx + 1) (clearUnit assignments (f.insertRatUnits units).fst.ratUnits[idx])
h_size :
  (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments (f.insertRatUnits units).fst.ratUnits
        0).size =
    n
i : Nat
hi1 : i < (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0).size
hi2 : i < f.assignments.size
i_lt_n : i < n
h :
  ∃ j1 j2 i_gt_zero,
    ↑j1 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
      ↑j2 ≥ (f.insertRatUnits units).fst.ratUnits.size ∧
        (f.insertRatUnits units).fst.ratUnits[j1] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, true) ∧
          (f.insertRatUnits units).fst.ratUnits[j2] = (⟨↑⟨i, i_lt_n⟩, ⋯⟩, false) ∧
            (Array.foldl (fun b => clearUnit b) (f.insertRatUnits units).fst.assignments
                    (f.insertRatUnits units).fst.ratUnits 0)[↑⟨i, i_lt_n⟩] =
                both ∧
              f.assignments[↑⟨i, i_lt_n⟩] = unassigned ∧
                ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                  ↑k ≥ (f.insertRatUnits units).fst.ratUnits.size →
                    k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑⟨i, i_lt_n⟩
⊢ (Array.foldl clearUnit (f.insertRatUnits units).1.assignments (f.insertRatUnits units).1.ratUnits 0)[i] =
    f.assignments[i]
Tactic:
omega
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_preserves_formula
Proof state before:
case h_2
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHint : Nat × Array Nat
x✝ : Option (DefaultClause n)
heq✝ : f.clauses[ratHint.fst]! = none
⊢ ({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits, assignments := f.assignments }, false).fst =
    f
Tactic:
. rfl
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_preserves_formula
Proof state before:
case isTrue
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHint : Nat × Array Nat
x✝ : Option (DefaultClause n)
c : DefaultClause n
heq✝ : f.clauses[ratHint.fst]! = some c
h✝ :
  ({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits, assignments := f.assignments }.insertRatUnits
        (c.delete p).negate).snd =
    true
⊢ (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                  assignments := f.assignments }.insertRatUnits
              (c.delete p).negate).fst.clearRatUnits,
        true).fst =
    f
Tactic:
rw [clear_insertRat f hf]
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_preserves_formula
Proof state before:
case isFalse
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHint : Nat × Array Nat
x✝ : Option (DefaultClause n)
c : DefaultClause n
heq✝ : f.clauses[ratHint.fst]! = some c
h✝ :
  ¬({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
              assignments := f.assignments }.insertRatUnits
          (c.delete p).negate).snd =
      true
fc : DefaultFormula n := (f.insertRatUnits (c.delete p).negate).fst
fc_assignments_size : fc.assignments.size = n
insertRatUnits_rw :
  (f.insertRatUnits (c.delete p).negate).fst =
    { clauses := (f.insertRatUnits (c.delete p).negate).fst.clauses,
      rupUnits := (f.insertRatUnits (c.delete p).negate).fst.rupUnits,
      ratUnits := (f.insertRatUnits (c.delete p).negate).fst.ratUnits,
      assignments := (f.insertRatUnits (c.delete p).negate).fst.assignments }
⊢ (if
          (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                                assignments := f.assignments }.insertRatUnits
                            (c.delete p).negate).fst.performRupCheck
                      ratHint.snd).2.2.snd =
              true ∨
            (({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
                                assignments := f.assignments }.insertRatUnits
                            (c.delete p).negate).fst.performRupCheck
                      ratHint.snd).2.2.fst =
              false then
        (f, false)
      else (f, true)).fst =
    f
Tactic:
split <;> rfl
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHint : Nat × Array Nat
x✝ : Option (DefaultClause n)
c : DefaultClause n
heq✝ : f.clauses[ratHint.fst]! = some c
h✝ :
  ¬({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits,
              assignments := f.assignments }.insertRatUnits
          (c.delete p).negate).snd =
      true
fc : DefaultFormula n := (f.insertRatUnits (c.delete p).negate).fst
⊢ fc.assignments.size = n
Tactic:
rw [insertRatUnits_preserves_assignments_size, hf.2]
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_preserves_formula
Proof state before:
case h_2
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHint : Nat × Array Nat
x✝ : Option (DefaultClause n)
heq✝ : f.clauses[ratHint.fst]! = none
⊢ ({ clauses := f.clauses, rupUnits := f.rupUnits, ratUnits := f.ratUnits, assignments := f.assignments }, false).fst =
    f
Tactic:
rfl
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Tactic:
let motive (_idx : Nat) (acc : DefaultFormula n × Bool) := acc.1 = f
Proof state after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Tactic:
have h_base : motive 0 (f, true) := rfl
Proof state after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Tactic:
have h_inductive (idx : Fin ratHints.size) (acc : DefaultFormula n × Bool) :
  motive idx.1 acc → motive (idx.1 + 1) (if acc.2 then performRatCheck acc.1 p ratHints[idx] else (acc.1, false)) := by
  intro ih
  rw [ih]
  split
  . exact performRatCheck_preserves_formula f hf p ratHints[idx]
  . rfl
Proof state after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
h_inductive :
  ∀ (idx : Fin ratHints.size) (acc : DefaultFormula n × Bool),
    motive (↑idx) acc →
      motive (↑idx + 1) (if acc.snd = true then acc.fst.performRatCheck p ratHints[idx] else (acc.fst, false))
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
h_inductive :
  ∀ (idx : Fin ratHints.size) (acc : DefaultFormula n × Bool),
    motive (↑idx) acc →
      motive (↑idx + 1) (if acc.snd = true then acc.fst.performRatCheck p ratHints[idx] else (acc.fst, false))
⊢ let performRatCheck_fold_res :=
    Array.foldl (fun x ratHint => if x.snd = true then x.fst.performRatCheck p ratHint else (x.fst, false)) (f, true)
      ratHints 0;
  performRatCheck_fold_res.fst = f
Tactic:
exact Array.foldl_induction motive h_base h_inductive
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
⊢ motive (↑idx) acc →
    motive (↑idx + 1) (if acc.snd = true then acc.fst.performRatCheck p ratHints[idx] else (acc.fst, false))
Tactic:
intro ih
Proof state after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
⊢ motive (↑idx + 1) (if acc.snd = true then acc.fst.performRatCheck p ratHints[idx] else (acc.fst, false))
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
⊢ motive (↑idx + 1) (if acc.snd = true then acc.fst.performRatCheck p ratHints[idx] else (acc.fst, false))
Tactic:
rw [ih]
Proof state after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
⊢ motive (↑idx + 1) (if acc.snd = true then f.performRatCheck p ratHints[idx] else (f, false))
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
⊢ motive (↑idx + 1) (if acc.snd = true then f.performRatCheck p ratHints[idx] else (f, false))
Tactic:
split
Proof state after:
case isTrue
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : acc.snd = true
⊢ motive (↑idx + 1) (f.performRatCheck p ratHints[idx])

case isFalse
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : ¬acc.snd = true
⊢ motive (↑idx + 1) (f, false)
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
case isTrue
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : acc.snd = true
⊢ motive (↑idx + 1) (f.performRatCheck p ratHints[idx])

case isFalse
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : ¬acc.snd = true
⊢ motive (↑idx + 1) (f, false)
Tactic:
. exact performRatCheck_preserves_formula f hf p ratHints[idx]
Proof state after:
case isFalse
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : ¬acc.snd = true
⊢ motive (↑idx + 1) (f, false)
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
case isFalse
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : ¬acc.snd = true
⊢ motive (↑idx + 1) (f, false)
Tactic:
. rfl
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
case isTrue
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : acc.snd = true
⊢ motive (↑idx + 1) (f.performRatCheck p ratHints[idx])
Tactic:
exact performRatCheck_preserves_formula f hf p ratHints[idx]
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.performRatCheck_fold_preserves_formula
Proof state before:
case isFalse
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
p : Literal (PosFin n)
ratHints : Array (Nat × Array Nat)
motive : Nat → DefaultFormula n × Bool → Prop := fun _idx acc => acc.fst = f
h_base : motive 0 (f, true)
idx : Fin ratHints.size
acc : DefaultFormula n × Bool
ih : motive (↑idx) acc
h✝ : ¬acc.snd = true
⊢ motive (↑idx + 1) (f, false)
Tactic:
rfl
Proof state after:
no goals