Theorem: LRAT.DefaultFormula.clear_insertRat_base_case (LeanSAT/LRAT/Formula/RatAddResult.lean)

State before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
⊢ let insertRat_res := f.insertRatUnits units;
  f.clear_insert_induction_motive ⋯ insertRat_res.fst.ratUnits 0 insertRat_res.fst.assignments
Tactic:
have insertRatUnits_assignments_size := insertRatUnits_preserves_assignments_size f units
State after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits units).fst.assignments.size = f.assignments.size
⊢ let insertRat_res := f.insertRatUnits units;
  f.clear_insert_induction_motive ⋯ insertRat_res.fst.ratUnits 0 insertRat_res.fst.assignments

State before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits units).fst.assignments.size = f.assignments.size
⊢ let insertRat_res := f.insertRatUnits units;
  f.clear_insert_induction_motive ⋯ insertRat_res.fst.ratUnits 0 insertRat_res.fst.assignments
Tactic:
rw [hf.2] at insertRatUnits_assignments_size
State after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits units).fst.assignments.size = n
⊢ let insertRat_res := f.insertRatUnits units;
  f.clear_insert_induction_motive ⋯ insertRat_res.fst.ratUnits 0 insertRat_res.fst.assignments

State before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits units).fst.assignments.size = n
⊢ let insertRat_res := f.insertRatUnits units;
  f.clear_insert_induction_motive ⋯ insertRat_res.fst.ratUnits 0 insertRat_res.fst.assignments
Tactic:
apply Exists.intro insertRatUnits_assignments_size
State after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits 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.insertRatUnits units).fst.assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
          ↑j ≥ 0 → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ 0 ∧
            (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 ≥ 0 → k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ 0 ∧
            ↑j2 ≥ 0 ∧
              (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 ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i

State before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits 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.insertRatUnits units).fst.assignments[↑i];
    let fassignments_i := f.assignments[↑i];
    (assignments_i = fassignments_i ∧
        ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
          ↑j ≥ 0 → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑i) ∨
      (∃ j b i_gt_zero,
          ↑j ≥ 0 ∧
            (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 ≥ 0 → k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i) ∨
        ∃ j1 j2 i_gt_zero,
          ↑j1 ≥ 0 ∧
            ↑j2 ≥ 0 ∧
              (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 ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i
Tactic:
intro i
State after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits 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.insertRatUnits units).fst.assignments[↑i];
  let fassignments_i := f.assignments[↑i];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
        ↑j ≥ 0 → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ 0 ∧
          (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 ≥ 0 → k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ 0 ∧
          ↑j2 ≥ 0 ∧
            (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 ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i

State before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits 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.insertRatUnits units).fst.assignments[↑i];
  let fassignments_i := f.assignments[↑i];
  (assignments_i = fassignments_i ∧
      ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size),
        ↑j ≥ 0 → (f.insertRatUnits units).fst.ratUnits[j].fst.val ≠ ↑i) ∨
    (∃ j b i_gt_zero,
        ↑j ≥ 0 ∧
          (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 ≥ 0 → k ≠ j → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        ↑j1 ≥ 0 ∧
          ↑j2 ≥ 0 ∧
            (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 ≥ 0 → k ≠ j1 → k ≠ j2 → (f.insertRatUnits units).fst.ratUnits[k].fst.val ≠ ↑i
Tactic:
simp only [Nat.zero_le, Fin.getElem_fin, ne_eq, forall_const, true_and]
State after:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits units).fst.assignments.size = n
i : Fin n
⊢ ((f.insertRatUnits units).fst.assignments[↑i] = f.assignments[↑i] ∧
      ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size), ¬(f.insertRatUnits units).fst.ratUnits[↑j].fst.val = ↑i) ∨
    (∃ j b i_gt_zero,
        (f.insertRatUnits units).fst.ratUnits[↑j] = (⟨↑i, ⋯⟩, b) ∧
          (f.insertRatUnits units).fst.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            ¬hasAssignment b f.assignments[↑i] = true ∧
              ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                ¬k = j → ¬(f.insertRatUnits units).fst.ratUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRatUnits units).fst.ratUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          (f.insertRatUnits units).fst.ratUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            (f.insertRatUnits units).fst.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                  ¬k = j1 → ¬k = j2 → ¬(f.insertRatUnits units).fst.ratUnits[↑k].fst.val = ↑i

State before:
n : Nat
f : DefaultFormula n
hf : f.ratUnits = #[] ∧ f.assignments.size = n
units : List (Literal (PosFin n))
insertRatUnits_assignments_size : (f.insertRatUnits units).fst.assignments.size = n
i : Fin n
⊢ ((f.insertRatUnits units).fst.assignments[↑i] = f.assignments[↑i] ∧
      ∀ (j : Fin (f.insertRatUnits units).fst.ratUnits.size), ¬(f.insertRatUnits units).fst.ratUnits[↑j].fst.val = ↑i) ∨
    (∃ j b i_gt_zero,
        (f.insertRatUnits units).fst.ratUnits[↑j] = (⟨↑i, ⋯⟩, b) ∧
          (f.insertRatUnits units).fst.assignments[↑i] = addAssignment b f.assignments[↑i] ∧
            ¬hasAssignment b f.assignments[↑i] = true ∧
              ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                ¬k = j → ¬(f.insertRatUnits units).fst.ratUnits[↑k].fst.val = ↑i) ∨
      ∃ j1 j2 i_gt_zero,
        (f.insertRatUnits units).fst.ratUnits[↑j1] = (⟨↑i, ⋯⟩, true) ∧
          (f.insertRatUnits units).fst.ratUnits[↑j2] = (⟨↑i, ⋯⟩, false) ∧
            (f.insertRatUnits units).fst.assignments[↑i] = both ∧
              f.assignments[↑i] = unassigned ∧
                ∀ (k : Fin (f.insertRatUnits units).fst.ratUnits.size),
                  ¬k = j1 → ¬k = j2 → ¬(f.insertRatUnits units).fst.ratUnits[↑k].fst.val = ↑i
Tactic:
exact insertRatUnits_postcondition f hf units i
State after:
no goals