internlm/Lean-Github huggingface dataset:
Theorem: a₁'
Proof state before:
case inr.inl.right
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
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
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inl.right.inl
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
no_carry : a + b < 2 ^ Nat.size a
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
exact a₁_hi_of_no_uflow_of_no_carry_of_lt_round
  npos hfaithful₁ hcorrect₁ hfa hfb hba no_uflow no_carry lt_round
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inl.right.inr
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
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
Proof state after:
case inr.inl.right.inr
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
ulp_le : ulp n (a + b) ≤ b
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Theorem: a₁'
Proof state before:
case inr.inl.right.inr
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
ulp_le : ulp n (a + b) ≤ b
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
exact a₁_hi_of_ulp_le_of_lt_round npos hfaithful₁ hfa hfb hba ulp_le lt_round
Proof state after:
no goals
Theorem: a₁'
Proof state before:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
⊢ ulp n (a + b) ≤ b
Tactic:
rewrite [← Nat.not_lt]
Proof state after:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
⊢ ¬b < ulp n (a + b)
Theorem: a₁'
Proof state before:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
⊢ ¬b < ulp n (a + b)
Tactic:
intro lt_ulp
Proof state after:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
lt_ulp : b < ulp n (a + b)
⊢ False
Theorem: a₁'
Proof state before:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
lt_ulp : b < ulp n (a + b)
⊢ False
Tactic:
apply Nat.lt_le_asymm lt_round
Proof state after:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
lt_ulp : b < ulp n (a + b)
⊢ round (a + b) ≤ a + b
Theorem: a₁'
Proof state before:
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
no_uflow : a + b ≥ 2 ^ n
lt_round : a + b < round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
lt_ulp : b < ulp n (a + b)
⊢ round (a + b) ≤ a + b
Tactic:
exact round_le_of_no_uflow_of_carry_of_lt_ulp
  npos hfaithful₀ hfaithful₁ hcorrect₁ hfa hba no_uflow carry lt_ulp
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inr
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b) ∧ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
constructor
Proof state after:
case inr.inr.left
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b)

case inr.inr.right
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Theorem: a₁'
Proof state before:
case inr.inr.left
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b)

case inr.inr.right
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
. 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
Proof state after:
case inr.inr.right
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Theorem: a₁'
Proof state before:
case inr.inr.right
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
. exact a₁_hi_of_round_le npos hfaithful₁ round_le
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inr.left
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b)
Tactic:
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
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inr.left.inl
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
no_carry : a + b < 2 ^ Nat.size a
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b)
Tactic:
exact a₁_lo_of_no_carry_of_round_le
  npos hfaithful₁ hfa hfb hba no_carry round_le
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inr.left.inr
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
carry : a + b ≥ 2 ^ Nat.size a
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b)
Tactic:
exact a₁_lo_of_no_uflow_of_carry_of_round_le
  npos hfaithful₁ hfa hfb hba no_uflow carry round_le
Proof state after:
no goals
Theorem: a₁'
Proof state before:
case inr.inr.right
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
no_uflow : a + b ≥ 2 ^ n
round_le : a + b ≥ round (a + b)
⊢ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
exact a₁_hi_of_round_le npos hfaithful₁ round_le
Proof state after:
no goals
Theorem: a₁
Proof state before:
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
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b) ∧ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
cases Nat.le_total a b with
| inl hab =>
  rewrite [Nat.add_comm]
  exact a₁' npos hfaithful₀ hfaithful₁ hcorrect₁ hfb hfa hab
| inr hba => exact a₁' npos hfaithful₀ hfaithful₁ hcorrect₁ hfa hfb hba
Proof state after:
no goals
Theorem: a₁
Proof state before:
case inl
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
hab : a ≤ b
⊢ trunc n (a + b - round (a + b)) = a + b - round (a + b) ∧ trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
Tactic:
rewrite [Nat.add_comm]
Proof state after:
case inl
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
hab : a ≤ b
⊢ trunc n (b + a - round (b + a)) = b + a - round (b + a) ∧ trunc n (round (b + a) - (b + a)) = round (b + a) - (b + a)
Theorem: a₁
Proof state before:
case inl
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
hab : a ≤ b
⊢ trunc n (b + a - round (b + a)) = b + a - round (b + a) ∧ trunc n (round (b + a) - (b + a)) = round (b + a) - (b + a)
Tactic:
exact a₁' npos hfaithful₀ hfaithful₁ hcorrect₁ hfb hfa hab
Proof state after:
no goals
Theorem: a₁
Proof state before:
case inr
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)
Tactic:
exact a₁' npos hfaithful₀ hfaithful₁ hcorrect₁ hfa hfb hba
Proof state after:
no goals
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Tactic:
have hac : a ≤ round (a + b) := calc
  a = trunc n a       := hfa.symm
  _ ≤ trunc n (a + b) := trunc_le_trunc npos (Nat.le_add_right _ _)
  _ ≤ round (a + b)   := trunc_le_round _ _ hfaithful₁
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Tactic:
have hca : round (a + b) ≤ 2 * a := round_add_le npos hfaithful₀ hfaithful₁ hfa hba
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Tactic:
have hfc : trunc n (round (a + b)) = round (a + b) := trunc_round npos hfaithful₁ _
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Tactic:
have hfe : round (round (a + b) - a) = round (a + b) - a := by
  apply round_eq_of_trunc_eq npos hfaithful₀
  exact sterbenz hfc hfa hac hca
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Tactic:
have ⟨hfr₁, _⟩ := a₁ npos hfaithful₀ hfaithful₁ hcorrect₁ hfa hfb
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (b - round (round (a + b) - a)) = a + b
Tactic:
rewrite [hfe]
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (b - (round (a + b) - a)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (b - (round (a + b) - a)) = a + b
Tactic:
rewrite [← add_tsub_assoc' lo hac]
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (b + a - round (a + b)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (b + a - round (a + b)) = a + b
Tactic:
rewrite [Nat.add_comm b a]
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (a + b - round (a + b)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + round (a + b - round (a + b)) = a + b
Tactic:
rewrite [round_eq_of_trunc_eq npos hfaithful₀ hfr₁]
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + (a + b - round (a + b)) = a + b
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
hfe : round (round (a + b) - a) = round (a + b) - a
hfr₁ : trunc n (a + b - round (a + b)) = a + b - round (a + b)
right✝ : trunc n (round (a + b) - (a + b)) = round (a + b) - (a + b)
⊢ round (a + b) + (a + b - round (a + b)) = a + b
Tactic:
exact add_tsub_cancel_of_le lo
Proof state after:
no goals
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
⊢ round (round (a + b) - a) = round (a + b) - a
Tactic:
apply round_eq_of_trunc_eq npos hfaithful₀
Proof state after:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
⊢ trunc n (round (a + b) - a) = round (a + b) - a
Theorem: sum_and_error₁_lo
Proof state before:
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
lo : round (a + b) ≤ a + b
hac : a ≤ round (a + b)
hca : round (a + b) ≤ 2 * a
hfc : trunc n (round (a + b)) = round (a + b)
⊢ trunc n (round (a + b) - a) = round (a + b) - a
Tactic:
exact sterbenz hfc hfa hac hca
Proof state after:
no goals