internlm/Lean-Github huggingface dataset:
Theorem: LRAT.DefaultFormula.insertUnit_fold_preserves_invariant
Proof state before:
n : Nat
assignments0 : Array Assignment
assignments0_size : assignments0.size = n
hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ (rupUnits : Array (Literal (PosFin n))) (assignments : Array Assignment) (assignments_size : assignments.size = n)
    (b : Bool),
    insertUnit_invariant assignments0 assignments0_size rupUnits assignments assignments_size →
      let update_res := List.foldl insertUnit (rupUnits, assignments, b) tl;
      let_fun update_res_size := ⋯;
      insertUnit_invariant assignments0 assignments0_size update_res.fst update_res.snd.fst update_res_size
rupUnits : Array (Literal (PosFin n))
assignments : Array Assignment
assignments_size : assignments.size = n
b : Bool
h0 : insertUnit_invariant assignments0 assignments0_size rupUnits assignments assignments_size
update_res : Array (Literal (PosFin n)) × Array Assignment × Bool := insertUnit (rupUnits, assignments, b) hd
⊢ update_res.snd.fst.size = n
Tactic:
rw [insertUnit_preserves_size]
Proof state after:
n : Nat
assignments0 : Array Assignment
assignments0_size : assignments0.size = n
hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ (rupUnits : Array (Literal (PosFin n))) (assignments : Array Assignment) (assignments_size : assignments.size = n)
    (b : Bool),
    insertUnit_invariant assignments0 assignments0_size rupUnits assignments assignments_size →
      let update_res := List.foldl insertUnit (rupUnits, assignments, b) tl;
      let_fun update_res_size := ⋯;
      insertUnit_invariant assignments0 assignments0_size update_res.fst update_res.snd.fst update_res_size
rupUnits : Array (Literal (PosFin n))
assignments : Array Assignment
assignments_size : assignments.size = n
b : Bool
h0 : insertUnit_invariant assignments0 assignments0_size rupUnits assignments assignments_size
update_res : Array (Literal (PosFin n)) × Array Assignment × Bool := insertUnit (rupUnits, assignments, b) hd
⊢ assignments.size = n
Theorem: LRAT.DefaultFormula.insertUnit_fold_preserves_invariant
Proof state before:
n : Nat
assignments0 : Array Assignment
assignments0_size : assignments0.size = n
hd : Literal (PosFin n)
tl : List (Literal (PosFin n))
ih :
  ∀ (rupUnits : Array (Literal (PosFin n))) (assignments : Array Assignment) (assignments_size : assignments.size = n)
    (b : Bool),
    insertUnit_invariant assignments0 assignments0_size rupUnits assignments assignments_size →
      let update_res := List.foldl insertUnit (rupUnits, assignments, b) tl;
      let_fun update_res_size := ⋯;
      insertUnit_invariant assignments0 assignments0_size update_res.fst update_res.snd.fst update_res_size
rupUnits : Array (Literal (PosFin n))
assignments : Array Assignment
assignments_size : assignments.size = n
b : Bool
h0 : insertUnit_invariant assignments0 assignments0_size rupUnits assignments assignments_size
update_res : Array (Literal (PosFin n)) × Array Assignment × Bool := insertUnit (rupUnits, assignments, b) hd
⊢ assignments.size = n
Tactic:
exact assignments_size
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
assignments : Array Assignment := (f.insertRupUnits units).fst.assignments
⊢ assignments.size = n
Tactic:
rw [← f_readyForRupAdd.2.1]
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
assignments : Array Assignment := (f.insertRupUnits units).fst.assignments
⊢ assignments.size = f.assignments.size
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
assignments : Array Assignment := (f.insertRupUnits units).fst.assignments
⊢ assignments.size = f.assignments.size
Tactic:
exact insertRupUnits_preserves_assignments_size f units
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ let assignments := (f.insertRupUnits units).fst.assignments;
  let_fun hsize := ⋯;
  let rupUnits := (f.insertRupUnits units).fst.rupUnits;
  insertUnit_invariant f.assignments ⋯ rupUnits assignments hsize
Tactic:
simp only [insertRupUnits]
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ insertUnit_invariant f.assignments ⋯ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst
    (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).2.fst ⋯
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ insertUnit_invariant f.assignments ⋯ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst
    (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).2.fst ⋯
Tactic:
have hsize : f.assignments.size = n := by rw [f_readyForRupAdd.2.1]
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
⊢ insertUnit_invariant f.assignments ⋯ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst
    (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).2.fst ⋯
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
⊢ insertUnit_invariant f.assignments ⋯ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst
    (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).2.fst ⋯
Tactic:
have h0 : insertUnit_invariant f.assignments hsize f.rupUnits f.assignments hsize := by
  intro i
  simp only [Fin.getElem_fin, ne_eq, true_and, Bool.not_eq_true, exists_and_right]
  apply Or.inl
  intro j
  simp only [f_readyForRupAdd.1, Array.size_toArray, List.length_nil] at j
  exact Fin.elim0 j
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
h0 : insertUnit_invariant f.assignments hsize f.rupUnits f.assignments hsize
⊢ insertUnit_invariant f.assignments ⋯ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst
    (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).2.fst ⋯
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
h0 : insertUnit_invariant f.assignments hsize f.rupUnits f.assignments hsize
⊢ insertUnit_invariant f.assignments ⋯ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst
    (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).2.fst ⋯
Tactic:
exact insertUnit_fold_preserves_invariant f.assignments hsize f.rupUnits f.assignments hsize false units h0
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ f.assignments.size = n
Tactic:
rw [f_readyForRupAdd.2.1]
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
⊢ insertUnit_invariant f.assignments hsize f.rupUnits f.assignments hsize
Tactic:
intro i
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
⊢ let assignments_i := f.assignments[↑i];
  let original_assignments_i := f.assignments[↑i];
  (assignments_i = original_assignments_i ∧ ∀ (j : Fin f.rupUnits.size), f.rupUnits[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        f.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
          assignments_i = addAssignment b original_assignments_i ∧
            ¬hasAssignment b original_assignments_i = true ∧
              ∀ (k : Fin f.rupUnits.size), k ≠ j → f.rupUnits[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        f.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
          f.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
            assignments_i = both ∧
              original_assignments_i = unassigned ∧
                ∀ (k : Fin f.rupUnits.size), k ≠ j1 → k ≠ j2 → f.rupUnits[k].fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
⊢ let assignments_i := f.assignments[↑i];
  let original_assignments_i := f.assignments[↑i];
  (assignments_i = original_assignments_i ∧ ∀ (j : Fin f.rupUnits.size), f.rupUnits[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        f.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
          assignments_i = addAssignment b original_assignments_i ∧
            ¬hasAssignment b original_assignments_i = true ∧
              ∀ (k : Fin f.rupUnits.size), k ≠ j → f.rupUnits[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        f.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
          f.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
            assignments_i = both ∧
              original_assignments_i = unassigned ∧
                ∀ (k : Fin f.rupUnits.size), k ≠ j1 → k ≠ j2 → f.rupUnits[k].fst.val ≠ ↑i
Tactic:
simp only [Fin.getElem_fin, ne_eq, true_and, Bool.not_eq_true, exists_and_right]
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
⊢ (∀ (j : Fin f.rupUnits.size), ¬f.rupUnits[↑j].fst.val = ↑i) ∨
    (∃ j b,
        (∃ x, f.rupUnits[↑j] = (⟨↑i, ⋯⟩, b)) ∧
          f.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            hasAssignment b f.assignments[↑i] = false ∧
              ∀ (k : Fin f.rupUnits.size), ¬k = j → ¬f.rupUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        f.rupUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          f.rupUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            f.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin f.rupUnits.size), ¬k = j1 → ¬k = j2 → ¬f.rupUnits[↑k].fst.val = ↑i
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
⊢ (∀ (j : Fin f.rupUnits.size), ¬f.rupUnits[↑j].fst.val = ↑i) ∨
    (∃ j b,
        (∃ x, f.rupUnits[↑j] = (⟨↑i, ⋯⟩, b)) ∧
          f.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            hasAssignment b f.assignments[↑i] = false ∧
              ∀ (k : Fin f.rupUnits.size), ¬k = j → ¬f.rupUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        f.rupUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          f.rupUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            f.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin f.rupUnits.size), ¬k = j1 → ¬k = j2 → ¬f.rupUnits[↑k].fst.val = ↑i
Tactic:
apply Or.inl
Proof state after:
case h
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
⊢ ∀ (j : Fin f.rupUnits.size), ¬f.rupUnits[↑j].fst.val = ↑i
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
case h
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
⊢ ∀ (j : Fin f.rupUnits.size), ¬f.rupUnits[↑j].fst.val = ↑i
Tactic:
intro j
Proof state after:
case h
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
j : Fin f.rupUnits.size
⊢ ¬f.rupUnits[↑j].fst.val = ↑i
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
case h
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
j : Fin f.rupUnits.size
⊢ ¬f.rupUnits[↑j].fst.val = ↑i
Tactic:
simp only [f_readyForRupAdd.1, Array.size_toArray, List.length_nil] at j
Proof state after:
case h
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
j✝ : Fin f.rupUnits.size
j : Fin 0
⊢ ¬f.rupUnits[↑j✝].fst.val = ↑i
Theorem: LRAT.DefaultFormula.insertRupUnits_postcondition
Proof state before:
case h
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
hsize : f.assignments.size = n
i : Fin n
j✝ : Fin f.rupUnits.size
j : Fin 0
⊢ ¬f.rupUnits[↑j✝].fst.val = ↑i
Tactic:
exact Fin.elim0 j
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
⊢ ∀ (i j : Fin (f.insertRupUnits units).fst.rupUnits.size),
    i ≠ j → (f.insertRupUnits units).fst.rupUnits[i] ≠ (f.insertRupUnits units).fst.rupUnits[j]
Tactic:
intro i j i_ne_j
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
⊢ (f.insertRupUnits units).fst.rupUnits[i] ≠ (f.insertRupUnits units).fst.rupUnits[j]
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
⊢ (f.insertRupUnits units).fst.rupUnits[i] ≠ (f.insertRupUnits units).fst.rupUnits[j]
Tactic:
rcases hi : (insertRupUnits f units).fst.rupUnits[i] with ⟨li, bi⟩
Proof state after:
case mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
⊢ (li, bi) ≠ (f.insertRupUnits units).fst.rupUnits[j]
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
case mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
⊢ (li, bi) ≠ (f.insertRupUnits units).fst.rupUnits[j]
Tactic:
rcases hj : (insertRupUnits f units).fst.rupUnits[j] with ⟨lj, bj⟩
Proof state after:
case mk.mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
⊢ (li, bi) ≠ (lj, bj)
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
case mk.mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
⊢ (li, bi) ≠ (lj, bj)
Tactic:
intro heq
Proof state after:
case mk.mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
heq : (li, bi) = (lj, bj)
⊢ False
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
case mk.mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
heq : (li, bi) = (lj, bj)
⊢ False
Tactic:
simp only [Prod.mk.injEq] at heq
Proof state after:
case mk.mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
heq : li = lj ∧ bi = bj
⊢ False
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
case mk.mk
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
heq : li = lj ∧ bi = bj
⊢ False
Tactic:
rcases heq with ⟨li_eq_lj, bi_eq_bj⟩
Proof state after:
case mk.mk.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
li_eq_lj : li = lj
bi_eq_bj : bi = bj
⊢ False
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
case mk.mk.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
li_eq_lj : li = lj
bi_eq_bj : bi = bj
⊢ False
Tactic:
have h := insertRupUnits_postcondition f f_readyForRupAdd units ⟨li.1, li.2.2⟩
Proof state after:
case mk.mk.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
li_eq_lj : li = lj
bi_eq_bj : bi = bj
h :
  let assignments_i := (f.insertRupUnits units).fst.assignments[↑⟨li.val, ⋯⟩];
  let original_assignments_i := f.assignments[↑⟨li.val, ⋯⟩];
  (assignments_i = original_assignments_i ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨li.val, ⋯⟩) ∨
    (∃ j b i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨li.val, ⋯⟩, ⋯⟩, b) ∧
          assignments_i = addAssignment b original_assignments_i ∧
            ¬hasAssignment b original_assignments_i = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨li.val, ⋯⟩) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨li.val, ⋯⟩, ⋯⟩, true) ∧
          (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨li.val, ⋯⟩, ⋯⟩, false) ∧
            assignments_i = both ∧
              original_assignments_i = unassigned ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨li.val, ⋯⟩
⊢ False
Theorem: LRAT.DefaultFormula.insertRupUnits_nodup
Proof state before:
case mk.mk.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
li_eq_lj : li = lj
bi_eq_bj : bi = bj
h :
  let assignments_i := (f.insertRupUnits units).fst.assignments[↑⟨li.val, ⋯⟩];
  let original_assignments_i := f.assignments[↑⟨li.val, ⋯⟩];
  (assignments_i = original_assignments_i ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑⟨li.val, ⋯⟩) ∨
    (∃ j b i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑⟨li.val, ⋯⟩, ⋯⟩, b) ∧
          assignments_i = addAssignment b original_assignments_i ∧
            ¬hasAssignment b original_assignments_i = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨li.val, ⋯⟩) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑⟨li.val, ⋯⟩, ⋯⟩, true) ∧
          (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑⟨li.val, ⋯⟩, ⋯⟩, false) ∧
            assignments_i = both ∧
              original_assignments_i = unassigned ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑⟨li.val, ⋯⟩
⊢ False
Tactic:
simp only [ne_eq, Bool.not_eq_true, exists_and_right] at h
Proof state after:
case mk.mk.intro
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
i j : Fin (f.insertRupUnits units).fst.rupUnits.size
i_ne_j : i ≠ j
li : PosFin n
bi : Bool
hi : (f.insertRupUnits units).fst.rupUnits[i] = (li, bi)
lj : PosFin n
bj : Bool
hj : (f.insertRupUnits units).fst.rupUnits[j] = (lj, bj)
li_eq_lj : li = lj
bi_eq_bj : bi = bj
h :
  ((f.insertRupUnits units).fst.assignments[li.val] = f.assignments[li.val] ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        ¬(f.insertRupUnits units).fst.rupUnits[j].fst.val = li.val) ∨
    (∃ j b,
        (∃ x, (f.insertRupUnits units).fst.rupUnits[j] = (⟨li.val, ⋯⟩, b)) ∧
          (f.insertRupUnits units).fst.assignments[li.val] = addAssignment b f.assignments[li.val] ∧
            hasAssignment b f.assignments[li.val] = false ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ¬k = j → ¬(f.insertRupUnits units).fst.rupUnits[k].fst.val = li.val) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[j1] = (⟨li.val, ⋯⟩, true) ∧
          (f.insertRupUnits units).fst.rupUnits[j2] = (⟨li.val, ⋯⟩, false) ∧
            (f.insertRupUnits units).fst.assignments[li.val] = both ∧
              f.assignments[li.val] = unassigned ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ¬k = j1 → ¬k = j2 → ¬(f.insertRupUnits units).fst.rupUnits[k].fst.val = li.val
⊢ False