cases Nat.lt_or_ge (a + b) (2 ^ n) with
| inl uflow => exact a₁_of_uflow npos hfaithful₀ uflow
| inr no_uflow =>
  cases Nat.lt_or_ge (a + b) (round (a + b)) with
  | inl lt_round =>
    constructor
    . exact a₁_lo_of_lt_round npos hfaithful₁ lt_round
    . cases Nat.lt_or_ge (a + b) (2 ^ Nat.size a) with
      | inl no_carry =>
        exact a₁_hi_of_no_uflow_of_no_carry_of_lt_round
          npos hfaithful₁ hcorrect₁ hfa hfb hba no_uflow no_carry lt_round
      | inr carry =>
        have ulp_le : ulp n (a + b) ≤ b := by
          rewrite [← Nat.not_lt]
          intro lt_ulp
          apply Nat.lt_le_asymm lt_round
          exact round_le_of_no_uflow_of_carry_of_lt_ulp
            npos hfaithful₀ hfaithful₁ hcorrect₁ hfa hba no_uflow carry lt_ulp
        exact a₁_hi_of_ulp_le_of_lt_round npos hfaithful₁ hfa hfb hba ulp_le lt_round
  | inr round_le =>
    constructor
    . cases Nat.lt_or_ge (a + b) (2 ^ Nat.size a) with
      | inl no_carry =>
        exact a₁_lo_of_no_carry_of_round_le
          npos hfaithful₁ hfa hfb hba no_carry round_le
      | inr carry =>
        exact a₁_lo_of_no_uflow_of_carry_of_round_le
          npos hfaithful₁ hfa hfb hba no_uflow carry round_le
    . exact a₁_hi_of_round_le npos hfaithful₁ round_le
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hcorrect₁ : correct₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b) ∧ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
no goals