internlm/Lean-Github huggingface dataset:
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case right.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ ¬hasAssignment (acc.snd.fst.get ⟨↑j, ⋯⟩).snd f.assignments[↑i] = true ∧
    ∀ (k : Fin (l :: acc.snd.fst).length), k ≠ ⟨↑j + 1, j_succ_in_bounds⟩ → ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
. apply And.intro h2
  intro k k_ne_j_succ
  by_cases k.1 = 0
  . next k_eq_zero =>
    have k_eq_zero : k = ⟨0, zero_in_bounds⟩ := by
      apply Fin.eq_of_val_eq
      simp only [List.length_cons]
      exact k_eq_zero
    simp only [k_eq_zero, List.length_cons, List.get, ne_eq]
    exact l_ne_i
  . next k_ne_zero =>
    have k_eq_succ : ∃ k' : Nat, ∃ k'_succ_in_bounds : k' + 1 < (l :: acc.2.1).length, k = ⟨k' + 1, k'_succ_in_bounds⟩ := by
      have k_val_ne_zero : k.1 ≠ 0 := by
        intro k_eq_zero
        simp only [List.length_cons, ← k_eq_zero, ne_eq, not_true] at k_ne_zero
      rcases Nat.exists_eq_succ_of_ne_zero k_val_ne_zero with ⟨k', k_eq_k'_succ⟩
      rw [Nat.succ_eq_add_one] at k_eq_k'_succ
      have k'_succ_in_bounds : k' + 1 < (l :: acc.2.1).length := by rw [← k_eq_k'_succ]; exact k.2
      apply Exists.intro k' ∘ Exists.intro k'_succ_in_bounds
      apply Fin.eq_of_val_eq
      exact k_eq_k'_succ
    rcases k_eq_succ with ⟨k', k'_succ_in_bounds, k_eq_succ⟩
    rw [k_eq_succ]
    simp only [List.get, Nat.add_eq, Nat.add_zero, ne_eq]
    have k'_in_bounds : k' < acc.2.1.length := by
      simp only [List.length_cons, Nat.succ_eq_add_one] at k'_succ_in_bounds
      exact Nat.lt_of_succ_lt_succ k'_succ_in_bounds
    have k'_ne_j : ⟨k', k'_in_bounds⟩ ≠ j := by
      simp only [List.length_cons] at k_eq_succ
      simp only [List.length_cons, k_eq_succ, ne_eq, Fin.mk.injEq, Nat.succ.injEq] at k_ne_j_succ
      exact Fin.ne_of_val_ne k_ne_j_succ
    exact h3 ⟨k', k'_in_bounds⟩ k'_ne_j
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case right.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ (acc.fst.modify l.fst.val (addAssignment l.snd))[↑i] = addAssignment (acc.snd.fst.get ⟨↑j, ⋯⟩).snd f.assignments[↑i]
Tactic:
rw [Array.get_modify_unchanged l_in_bounds i_in_bounds _ l_ne_i]
Proof state after:
case right.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ acc.fst[↑i] = addAssignment (acc.snd.fst.get ⟨↑j, ⋯⟩).snd f.assignments[↑i]
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case right.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ acc.fst[↑i] = addAssignment (acc.snd.fst.get ⟨↑j, ⋯⟩).snd f.assignments[↑i]
Tactic:
exact h1
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case right.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ ¬hasAssignment (acc.snd.fst.get ⟨↑j, ⋯⟩).snd f.assignments[↑i] = true ∧
    ∀ (k : Fin (l :: acc.snd.fst).length), k ≠ ⟨↑j + 1, j_succ_in_bounds⟩ → ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
apply And.intro h2
Proof state after:
case right.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ ∀ (k : Fin (l :: acc.snd.fst).length), k ≠ ⟨↑j + 1, j_succ_in_bounds⟩ → ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case right.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
⊢ ∀ (k : Fin (l :: acc.snd.fst).length), k ≠ ⟨↑j + 1, j_succ_in_bounds⟩ → ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
intro k k_ne_j_succ
Proof state after:
case right.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
⊢ ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case neg
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
h✝ : ¬↑k = 0
⊢ ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
. next k_ne_zero =>
  have k_eq_succ : ∃ k' : Nat, ∃ k'_succ_in_bounds : k' + 1 < (l :: acc.2.1).length, k = ⟨k' + 1, k'_succ_in_bounds⟩ := by
    have k_val_ne_zero : k.1 ≠ 0 := by
      intro k_eq_zero
      simp only [List.length_cons, ← k_eq_zero, ne_eq, not_true] at k_ne_zero
    rcases Nat.exists_eq_succ_of_ne_zero k_val_ne_zero with ⟨k', k_eq_k'_succ⟩
    rw [Nat.succ_eq_add_one] at k_eq_k'_succ
    have k'_succ_in_bounds : k' + 1 < (l :: acc.2.1).length := by rw [← k_eq_k'_succ]; exact k.2
    apply Exists.intro k' ∘ Exists.intro k'_succ_in_bounds
    apply Fin.eq_of_val_eq
    exact k_eq_k'_succ
  rcases k_eq_succ with ⟨k', k'_succ_in_bounds, k_eq_succ⟩
  rw [k_eq_succ]
  simp only [List.get, Nat.add_eq, Nat.add_zero, ne_eq]
  have k'_in_bounds : k' < acc.2.1.length := by
    simp only [List.length_cons, Nat.succ_eq_add_one] at k'_succ_in_bounds
    exact Nat.lt_of_succ_lt_succ k'_succ_in_bounds
  have k'_ne_j : ⟨k', k'_in_bounds⟩ ≠ j := by
    simp only [List.length_cons] at k_eq_succ
    simp only [List.length_cons, k_eq_succ, ne_eq, Fin.mk.injEq, Nat.succ.injEq] at k_ne_j_succ
    exact Fin.ne_of_val_ne k_ne_j_succ
  exact h3 ⟨k', k'_in_bounds⟩ k'_ne_j
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
case pos
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
h✝ : ↑k = 0
⊢ ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
next k_eq_zero =>
have k_eq_zero : k = ⟨0, zero_in_bounds⟩ := by
  apply Fin.eq_of_val_eq
  simp only [List.length_cons]
  exact k_eq_zero
simp only [k_eq_zero, List.length_cons, List.get, ne_eq]
exact l_ne_i
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero : ↑k = 0
⊢ ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
have k_eq_zero : k = ⟨0, zero_in_bounds⟩ := by
  apply Fin.eq_of_val_eq
  simp only [List.length_cons]
  exact k_eq_zero
Proof state after:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero✝ : ↑k = 0
k_eq_zero : k = ⟨0, zero_in_bounds⟩
⊢ ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero✝ : ↑k = 0
k_eq_zero : k = ⟨0, zero_in_bounds⟩
⊢ ((l :: acc.snd.fst).get k).fst.val ≠ ↑i
Tactic:
simp only [k_eq_zero, List.length_cons, List.get, ne_eq]
Proof state after:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero✝ : ↑k = 0
k_eq_zero : k = ⟨0, zero_in_bounds⟩
⊢ ¬l.fst.val = ↑i
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero✝ : ↑k = 0
k_eq_zero : k = ⟨0, zero_in_bounds⟩
⊢ ¬l.fst.val = ↑i
Tactic:
exact l_ne_i
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.confirmRupHint_preserves_invariant_helper
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero : ↑k = 0
⊢ k = ⟨0, zero_in_bounds⟩
Tactic:
apply Fin.eq_of_val_eq
Proof state after:
case a
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
acc : Array Assignment × List (Literal (PosFin n)) × Bool × Bool
hsize : acc.fst.size = n
l : Literal (PosFin n)
ih : f.derivedLits_invariant f_assignments_size acc.fst hsize acc.snd.fst
h : ¬hasAssignment l.snd acc.fst[l.fst.val]! = true
hsize'✝ : (acc.fst.modify l.fst.val (addAssignment l.snd)).size = n :=
  Eq.mpr (id (congrArg (fun _a => _a = n) Array.modify_preserves_size)) hsize
i : Fin n
i_in_bounds : ↑i < acc.fst.size
l_in_bounds : l.fst.val < acc.fst.size
j : Fin acc.snd.fst.length
j_eq_i : (acc.snd.fst.get j).fst.val = ↑i
h1 : acc.fst[↑i] = addAssignment (acc.snd.fst.get j).snd f.assignments[↑i]
h2 : ¬hasAssignment (acc.snd.fst.get j).snd f.assignments[↑i] = true
h3 : ∀ (k : Fin acc.snd.fst.length), k ≠ j → (acc.snd.fst.get k).fst.val ≠ ↑i
l' : Literal (PosFin n) := acc.snd.fst.get j
zero_in_bounds : 0 < (l :: acc.snd.fst).length
j_succ_in_bounds : ↑j + 1 < (l :: acc.snd.fst).length
l_ne_i : ¬l.fst.val = ↑i
k : Fin (l :: acc.snd.fst).length
k_ne_j_succ : k ≠ ⟨↑j + 1, j_succ_in_bounds⟩
k_eq_zero : ↑k = 0
⊢ ↑k = ↑⟨0, zero_in_bounds⟩