internlm/Lean-Github huggingface dataset:
Theorem: b₁_hi_of_two_mul_le_of_lt_round
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : 2 * b ≤ a
lt_round : a - b < round (a - b)
ulp_dvd : ulp n b ∣ ulp n (a - b)
hba' : b ≤ a
ulp_sub_le : ulp n (a - b) - (a - b) % ulp n (a - b) ≤ b
⊢ ulp n b ∣ ulp n a
Tactic:
exact ulp_dvd_ulp n hba'
Proof state after:
no goals
Theorem: b₁_hi_of_two_mul_le_of_lt_round
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : 2 * b ≤ a
lt_round : a - b < round (a - b)
ulp_dvd : ulp n b ∣ ulp n (a - b)
hba' : b ≤ a
ulp_sub_le : ulp n (a - b) - (a - b) % ulp n (a - b) ≤ b
⊢ ulp n a ∣ a
Tactic:
exact ulp_dvd_of_trunc_eq hfa
Proof state after:
no goals
Theorem: b₁_hi_of_two_mul_le_of_lt_round
Proof state before:
case hdvd.h₂.h₂
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : 2 * b ≤ a
lt_round : a - b < round (a - b)
ulp_dvd : ulp n b ∣ ulp n (a - b)
hba' : b ≤ a
ulp_sub_le : ulp n (a - b) - (a - b) % ulp n (a - b) ≤ b
⊢ ulp n b ∣ b
Tactic:
exact ulp_dvd_of_trunc_eq hfb
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
have hba : b ≤ a := by
  trans 2 * b
  . exact Nat.le_mul_of_pos_left two_pos
  . exact two_mul_le
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
have hab : b ≤ a - b := by
  rewrite [le_tsub_iff_right hba]
  rewrite [← Nat.two_mul]
  exact two_mul_le
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
rewrite [round_eq_trunc_of_le npos hfaithful₁ round_le]
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n (a - b - trunc n (a - b)) = a - b - trunc n (a - b)
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n (a - b - trunc n (a - b)) = a - b - trunc n (a - b)
Tactic:
rewrite [trunc_eq_sub_mod n (a - b)]
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n (a - b - (a - b - (a - b) % ulp n (a - b))) = a - b - (a - b - (a - b) % ulp n (a - b))
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n (a - b - (a - b - (a - b) % ulp n (a - b))) = a - b - (a - b - (a - b) % ulp n (a - b))
Tactic:
rewrite [tsub_tsub_cancel_of_le (Nat.mod_le _ _)]
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n ((a - b) % ulp n (a - b)) = (a - b) % ulp n (a - b)
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ trunc n ((a - b) % ulp n (a - b)) = (a - b) % ulp n (a - b)
Tactic:
apply trunc_eq_of_le_of_ulp_dvd b
Proof state after:
case hle
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ (a - b) % ulp n (a - b) ≤ b

case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ (a - b) % ulp n (a - b)
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hle
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ (a - b) % ulp n (a - b) ≤ b

case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ (a - b) % ulp n (a - b)
Tactic:
. trans ulp n (a - b)
  . exact Nat.le_of_lt $ Nat.mod_lt _ (ulp_pos _ _)
  . exact ulp_le
Proof state after:
case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ (a - b) % ulp n (a - b)
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ (a - b) % ulp n (a - b)
Tactic:
. rewrite [Nat.dvd_mod_iff (ulp_dvd_ulp n hab)]
  apply Nat.dvd_sub hba
  . trans ulp n a
    . exact ulp_dvd_ulp n hba
    . exact ulp_dvd_of_trunc_eq hfa
  . exact ulp_dvd_of_trunc_eq hfb
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ b ≤ a
Tactic:
trans 2 * b
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ b ≤ 2 * b

round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ 2 * b ≤ a
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ b ≤ 2 * b

round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ 2 * b ≤ a
Tactic:
. exact Nat.le_mul_of_pos_left two_pos
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ 2 * b ≤ a
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ 2 * b ≤ a
Tactic:
. exact two_mul_le
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ b ≤ 2 * b
Tactic:
exact Nat.le_mul_of_pos_left two_pos
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
⊢ 2 * b ≤ a
Tactic:
exact two_mul_le
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ b ≤ a - b
Tactic:
rewrite [le_tsub_iff_right hba]
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ b + b ≤ a
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ b + b ≤ a
Tactic:
rewrite [← Nat.two_mul]
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ 2 * b ≤ a
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
⊢ 2 * b ≤ a
Tactic:
exact two_mul_le
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hle
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ (a - b) % ulp n (a - b) ≤ b
Tactic:
trans ulp n (a - b)
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ (a - b) % ulp n (a - b) ≤ ulp n (a - b)

round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n (a - b) ≤ b
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ (a - b) % ulp n (a - b) ≤ ulp n (a - b)

round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n (a - b) ≤ b
Tactic:
. exact Nat.le_of_lt $ Nat.mod_lt _ (ulp_pos _ _)
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n (a - b) ≤ b
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n (a - b) ≤ b
Tactic:
. exact ulp_le
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ (a - b) % ulp n (a - b) ≤ ulp n (a - b)
Tactic:
exact Nat.le_of_lt $ Nat.mod_lt _ (ulp_pos _ _)
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n (a - b) ≤ b
Tactic:
exact ulp_le
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ (a - b) % ulp n (a - b)
Tactic:
rewrite [Nat.dvd_mod_iff (ulp_dvd_ulp n hab)]
Proof state after:
case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ a - b
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ a - b
Tactic:
apply Nat.dvd_sub hba
Proof state after:
case hdvd.h₁
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ a

case hdvd.h₂
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ b
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd.h₁
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ a

case hdvd.h₂
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ b
Tactic:
. trans ulp n a
  . exact ulp_dvd_ulp n hba
  . exact ulp_dvd_of_trunc_eq hfa
Proof state after:
case hdvd.h₂
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ b
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd.h₂
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ b
Tactic:
. exact ulp_dvd_of_trunc_eq hfb
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd.h₁
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ a
Tactic:
trans ulp n a
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ ulp n a

round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n a ∣ a
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ ulp n a

round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n a ∣ a
Tactic:
. exact ulp_dvd_ulp n hba
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n a ∣ a
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n a ∣ a
Tactic:
. exact ulp_dvd_of_trunc_eq hfa
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ ulp n a
Tactic:
exact ulp_dvd_ulp n hba
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n a ∣ a
Tactic:
exact ulp_dvd_of_trunc_eq hfa
Proof state after:
no goals
Theorem: b₁_lo_of_round_le_of_two_mul_le_of_ulp_le
Proof state before:
case hdvd.h₂
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
round_le : round (a - b) ≤ a - b
two_mul_le : 2 * b ≤ a
ulp_le : ulp n (a - b) ≤ b
hba : b ≤ a
hab : b ≤ a - b
⊢ ulp n b ∣ b
Tactic:
exact ulp_dvd_of_trunc_eq hfb
Proof state after:
no goals
Theorem: b₁_lo_of_round_lt_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
have hfe : round (a - round (a - b)) = a - round (a - b) := by
  apply round_eq_of_trunc_eq npos hfaithful₀
  apply s₂ npos hfaithful₀ hfaithful₁ hfa hfb hba
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Theorem: b₁_lo_of_round_lt_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
have h₀ : b < round (a - round (a - b)) := by
  rewrite [hfe]
  rewrite [lt_tsub_comm]
  exact round_lt
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Theorem: b₁_lo_of_round_lt_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ trunc n (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
apply trunc_eq_of_round_eq npos hfaithful₁
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ round (a - b - round (a - b)) = a - b - round (a - b)
Theorem: b₁_lo_of_round_lt_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ round (a - b - round (a - b)) = a - b - round (a - b)
Tactic:
rewrite [tsub_right_comm, ← hfe]
Proof state after:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ round (round (a - round (a - b)) - b) = round (a - round (a - b)) - b
Theorem: b₁_lo_of_round_lt_of_ulp_le
Proof state before:
round : ℕ → ℕ
n a b : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ round (round (a - round (a - b)) - b) = round (a - round (a - b)) - b
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
hfa : trunc n a = a
hfb : trunc n b = b
hba : b ≤ a
round_lt : round (a - b) < a - b
ulp_le : ulp n a ≤ 2 * b
hfe : round (a - round (a - b)) = a - round (a - b)
h₀ : b < round (a - round (a - b))
⊢ trunc n (round (a - round (a - b)) - b) = round (a - round (a - b)) - b