internlm/Lean-Github huggingface dataset:
Theorem: LRAT.DefaultFormula.clear_insertRup_base_case
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
⊢ ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := (f.insertRupUnits units).fst.assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
          ↑j ≥ 0 → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ 0 ∧
            (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                    ↑k ≥ 0 → k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ 0 ∧
            ↑j2 ≥ 0 ∧
              (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
                (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                        ↑k ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
Tactic:
intro i
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
i : Fin n
⊢ let_fun i_lt_assignments_size := ⋯;
  let_fun i_lt_f_assignments_size := ⋯;
  let assignments_i := (f.insertRupUnits units).fst.assignments[↑i];
  let fassignments_i := f.assignments[↑i];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        ↑j ≥ 0 → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ 0 ∧
          (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ↑k ≥ 0 → k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ 0 ∧
          ↑j2 ≥ 0 ∧
            (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
              (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                      ↑k ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.clear_insertRup_base_case
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
i : Fin n
⊢ let_fun i_lt_assignments_size := ⋯;
  let_fun i_lt_f_assignments_size := ⋯;
  let assignments_i := (f.insertRupUnits units).fst.assignments[↑i];
  let fassignments_i := f.assignments[↑i];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size),
        ↑j ≥ 0 → (f.insertRupUnits units).fst.rupUnits[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ 0 ∧
          (f.insertRupUnits units).fst.rupUnits[j] = (⟨↑i, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ↑k ≥ 0 → k ≠ j → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ 0 ∧
          ↑j2 ≥ 0 ∧
            (f.insertRupUnits units).fst.rupUnits[j1] = (⟨↑i, ⋯⟩, true) ∧
              (f.insertRupUnits units).fst.rupUnits[j2] = (⟨↑i, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                      ↑k ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRupUnits units).fst.rupUnits[k].fst.val ≠ ↑i
Tactic:
simp only [Nat.zero_le, Fin.getElem_fin, ne_eq, forall_const, true_and]
Proof state after:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
i : Fin n
⊢ ((f.insertRupUnits units).fst.assignments[↑i] = f.assignments[↑i] ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size), ¬(f.insertRupUnits units).fst.rupUnits[↑j].fst.val = ↑i) ∨
    (∃ j b i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[↑j] = (⟨↑i, ⋯⟩, b) ∧
          (f.insertRupUnits units).fst.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            ¬hasAssignment b f.assignments[↑i] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ¬k = j → ¬(f.insertRupUnits units).fst.rupUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          (f.insertRupUnits units).fst.rupUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            (f.insertRupUnits units).fst.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ¬k = j1 → ¬k = j2 → ¬(f.insertRupUnits units).fst.rupUnits[↑k].fst.val = ↑i
Theorem: LRAT.DefaultFormula.clear_insertRup_base_case
Proof state before:
n : Nat
f : DefaultFormula n
f_readyForRupAdd : f.readyForRupAdd
units : List (Literal (PosFin n))
insertRupUnits_assignments_size : (f.insertRupUnits units).fst.assignments.size = n
i : Fin n
⊢ ((f.insertRupUnits units).fst.assignments[↑i] = f.assignments[↑i] ∧
      ∀ (j : Fin (f.insertRupUnits units).fst.rupUnits.size), ¬(f.insertRupUnits units).fst.rupUnits[↑j].fst.val = ↑i) ∨
    (∃ j b i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[↑j] = (⟨↑i, ⋯⟩, b) ∧
          (f.insertRupUnits units).fst.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            ¬hasAssignment b f.assignments[↑i] = true ∧
              ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                ¬k = j → ¬(f.insertRupUnits units).fst.rupUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRupUnits units).fst.rupUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          (f.insertRupUnits units).fst.rupUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            (f.insertRupUnits units).fst.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin (f.insertRupUnits units).fst.rupUnits.size),
                  ¬k = j1 → ¬k = j2 → ¬(f.insertRupUnits units).fst.rupUnits[↑k].fst.val = ↑i
Tactic:
exact insertRupUnits_postcondition f f_readyForRupAdd units i
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
ih : f.clear_insert_induction_motive f_assignments_size units (↑idx) assignments
⊢ f.clear_insert_induction_motive f_assignments_size units (↑idx + 1) (clearUnit assignments units[idx])
Tactic:
rcases ih with ⟨hsize, ih⟩
Proof state after:
case intro
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
ih :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx → units[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ ↑idx ∧
            units[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j → units[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ ↑idx ∧
            ↑j2 ≥ ↑idx ∧
              units[j1] = (⟨↑i, ⋯⟩, true) ∧
                units[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
⊢ f.clear_insert_induction_motive f_assignments_size units (↑idx + 1) (clearUnit assignments units[idx])
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
case intro
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
ih :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx → units[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ ↑idx ∧
            units[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j → units[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ ↑idx ∧
            ↑j2 ≥ ↑idx ∧
              units[j1] = (⟨↑i, ⋯⟩, true) ∧
                units[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
⊢ f.clear_insert_induction_motive f_assignments_size units (↑idx + 1) (clearUnit assignments units[idx])
Tactic:
have hsize' : Array.size (clearUnit assignments units[idx]) = n := by
  rw [← clearUnit_preserves_size assignments units[idx]] at hsize
  exact hsize
Proof state after:
case intro
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
ih :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx → units[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ ↑idx ∧
            units[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j → units[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ ↑idx ∧
            ↑j2 ≥ ↑idx ∧
              units[j1] = (⟨↑i, ⋯⟩, true) ∧
                units[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
hsize' : (clearUnit assignments units[idx]).size = n
⊢ f.clear_insert_induction_motive f_assignments_size units (↑idx + 1) (clearUnit assignments units[idx])
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
ih :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx → units[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ ↑idx ∧
            units[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j → units[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ ↑idx ∧
            ↑j2 ≥ ↑idx ∧
              units[j1] = (⟨↑i, ⋯⟩, true) ∧
                units[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
⊢ (clearUnit assignments units[idx]).size = n
Tactic:
rw [← clearUnit_preserves_size assignments units[idx]] at hsize
Proof state after:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize✝ : assignments.size = n
hsize : (clearUnit assignments units[idx]).size = n
ih :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx → units[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ ↑idx ∧
            units[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j → units[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ ↑idx ∧
            ↑j2 ≥ ↑idx ∧
              units[j1] = (⟨↑i, ⋯⟩, true) ∧
                units[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
⊢ (clearUnit assignments units[idx]).size = n
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize✝ : assignments.size = n
hsize : (clearUnit assignments units[idx]).size = n
ih :
  ∀ (i : Fin n),
    let_fun i_lt_assignments_size := ⋯;
    let_fun i_lt_f_assignments_size := ⋯;
    let assignments_i := assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx → units[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ ↑idx ∧
            units[j] = (⟨↑i, ⋯⟩, b) ∧
              assignments_i = addAssignment b fassignments_i ∧
                ¬hasAssignment b fassignments_i = true ∧
                  ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j → units[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ ↑idx ∧
            ↑j2 ≥ ↑idx ∧
              units[j1] = (⟨↑i, ⋯⟩, true) ∧
                units[j2] = (⟨↑i, ⋯⟩, false) ∧
                  assignments_i = both ∧
                    fassignments_i = unassigned ∧
                      ∀ (k : Fin units.size), ↑k ≥ ↑idx → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
⊢ (clearUnit assignments units[idx]).size = n
Tactic:
exact hsize
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
case intro.inl.intro
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ let_fun i_lt_assignments_size := ⋯;
  let_fun i_lt_f_assignments_size := ⋯;
  let assignments_i := (clearUnit assignments units[idx])[↑i];
  let fassignments_i := f.assignments[↑i];
  (assignments_i = fassignments_i ∧ ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ ↑idx + 1 ∧
          units[j] = (⟨↑i, ⋯⟩, b) ∧
            assignments_i = addAssignment b fassignments_i ∧
              ¬hasAssignment b fassignments_i = true ∧
                ∀ (k : Fin units.size), ↑k ≥ ↑idx + 1 → k ≠ j → units[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ ↑idx + 1 ∧
          ↑j2 ≥ ↑idx + 1 ∧
            units[j1] = (⟨↑i, ⋯⟩, true) ∧
              units[j2] = (⟨↑i, ⋯⟩, false) ∧
                assignments_i = both ∧
                  fassignments_i = unassigned ∧
                    ∀ (k : Fin units.size), ↑k ≥ ↑idx + 1 → k ≠ j1 → k ≠ j2 → units[k].fst.val ≠ ↑i
Tactic:
apply Or.inl
Proof state after:
case intro.inl.intro.h
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ (clearUnit assignments units[idx])[↑i] = f.assignments[↑i] ∧
    ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
case intro.inl.intro.h
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ (clearUnit assignments units[idx])[↑i] = f.assignments[↑i] ∧
    ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i
Tactic:
constructor
Proof state after:
case intro.inl.intro.h.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ (clearUnit assignments units[idx])[↑i] = f.assignments[↑i]

case intro.inl.intro.h.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
case intro.inl.intro.h.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ (clearUnit assignments units[idx])[↑i] = f.assignments[↑i]

case intro.inl.intro.h.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i
Tactic:
. simp only [clearUnit, Fin.getElem_fin, Array.get_eq_getElem]
  specialize ih2 idx (Nat.le_refl idx.val)
  have idx_unit_in_bounds : units[idx].1.1 < assignments.size := by
    rw [hsize]; exact units[idx].1.2.2
  have i_in_bounds : i.1 < assignments.size := by
    rw [hsize]
    exact i.2
  have h := Array.get_modify_unchanged idx_unit_in_bounds i_in_bounds (removeAssignment units[idx.val].2) ih2
  simp only [Fin.getElem_fin] at h
  rw [h]
  exact ih1
Proof state after:
case intro.inl.intro.h.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
case intro.inl.intro.h.right
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ ∀ (j : Fin units.size), ↑j ≥ ↑idx + 1 → units[j].fst.val ≠ ↑i
Tactic:
. intro j j_ge_idx_add_one
  exact ih2 j (Nat.le_of_succ_le j_ge_idx_add_one)
Proof state after:
no goals
Theorem: LRAT.DefaultFormula.clear_insert_inductive_case
Proof state before:
case intro.inl.intro.h.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ (clearUnit assignments units[idx])[↑i] = f.assignments[↑i]
Tactic:
simp only [clearUnit, Fin.getElem_fin, Array.get_eq_getElem]
Proof state after:
case intro.inl.intro.h.left
n : Nat
f : DefaultFormula n
f_assignments_size : f.assignments.size = n
units : Array (Literal (PosFin n))
units_nodup : ∀ (i j : Fin units.size), i ≠ j → units[i] ≠ units[j]
idx : Fin units.size
assignments : Array Assignment
hsize : assignments.size = n
hsize' : (clearUnit assignments units[idx]).size = n
i : Fin n
ih1 : assignments[↑i] = f.assignments[↑i]
ih2 : ∀ (j : Fin units.size), ↑j ≥ ↑idx → ¬units[↑j].fst.val = ↑i
⊢ (assignments.modify units[↑idx].fst.val (removeAssignment units[↑idx].snd))[↑i] = f.assignments[↑i]