internlm/Lean-Github huggingface dataset:
Theorem: s₃'
Proof state before:
n a b : ℕ
npos : 0 < n
hfb : trunc n b = b
h : ulp n b ≤ 2 * a
ulp_le : ulp n b ≤ a
⊢ trunc n (b - a) + ulp n (trunc n (b - a)) = trunc n (b - a) + ulp n (b - a)
Tactic:
rw [ulp_trunc npos _]
Proof state after:
no goals
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Tactic:
have hfc : round (a - round (a - b)) = a - round (a - b) := by
  apply round_eq_of_trunc_eq npos hfaithful₀
  exact s₂ npos hfaithful₀ hfaithful₁ hfa hfb hba
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Tactic:
have helo : round (a - b) = trunc n (a - b) := by
  apply round_eq_trunc_of_le npos hfaithful₁
  apply Nat.le_of_lt
  rewrite [lt_tsub_comm, ← hfc]
  exact hbc
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Tactic:
have hcd : round (a - round (a - b)) ≤ 2 * d := by
  trans 2 * b
  . rewrite [hfc, helo]
    exact s₃' npos hfa hab
  . exact Nat.mul_le_mul_left 2 hbd
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
hcd : round (a - round (a - b)) ≤ 2 * d
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
hcd : round (a - round (a - b)) ≤ 2 * d
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Tactic:
have hfe : trunc n (round (a - round (a - b))) = round (a - round (a - b)) :=
  trunc_round npos hfaithful₁ (a - round (a - b))
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
hcd : round (a - round (a - b)) ≤ 2 * d
hfe : trunc n (round (a - round (a - b))) = round (a - round (a - b))
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
hcd : round (a - round (a - b)) ≤ 2 * d
hfe : trunc n (round (a - round (a - b))) = round (a - round (a - b))
⊢ trunc n (round (a - round (a - b)) - d) = round (a - round (a - b)) - d
Tactic:
exact sterbenz hfe hfd hdc hcd
Proof state after:
no goals
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
⊢ round (a - round (a - b)) = a - round (a - b)
Tactic:
apply round_eq_of_trunc_eq npos hfaithful₀
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
⊢ trunc n (a - round (a - b)) = a - round (a - b)
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
⊢ trunc n (a - round (a - b)) = a - round (a - b)
Tactic:
exact s₂ npos hfaithful₀ hfaithful₁ hfa hfb hba
Proof state after:
no goals
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ round (a - b) = trunc n (a - b)
Tactic:
apply round_eq_trunc_of_le npos hfaithful₁
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ round (a - b) ≤ a - b
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ round (a - b) ≤ a - b
Tactic:
apply Nat.le_of_lt
Proof state after:
case h
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ round (a - b) < a - b
Theorem: s₃
Proof state before:
case h
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ round (a - b) < a - b
Tactic:
rewrite [lt_tsub_comm, ← hfc]
Proof state after:
case h
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ b < round (a - round (a - b))
Theorem: s₃
Proof state before:
case h
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
⊢ b < round (a - round (a - b))
Tactic:
exact hbc
Proof state after:
no goals
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ round (a - round (a - b)) ≤ 2 * d
Tactic:
trans 2 * b
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ round (a - round (a - b)) ≤ 2 * b

d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ 2 * b ≤ 2 * d
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ round (a - round (a - b)) ≤ 2 * b

d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ 2 * b ≤ 2 * d
Tactic:
. rewrite [hfc, helo]
  exact s₃' npos hfa hab
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ 2 * b ≤ 2 * d
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ 2 * b ≤ 2 * d
Tactic:
. exact Nat.mul_le_mul_left 2 hbd
Proof state after:
no goals
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ round (a - round (a - b)) ≤ 2 * b
Tactic:
rewrite [hfc, helo]
Proof state after:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ a - trunc n (a - b) ≤ 2 * b
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ a - trunc n (a - b) ≤ 2 * b
Tactic:
exact s₃' npos hfa hab
Proof state after:
no goals
Theorem: s₃
Proof state before:
d : ℕ
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
hfd : trunc n d = d
hba : b ≤ a
hbd : b ≤ d
hab : ulp n a ≤ 2 * b
hbc : b < round (a - round (a - b))
hdc : d ≤ round (a - round (a - b))
hfc : round (a - round (a - b)) = a - round (a - b)
helo : round (a - b) = trunc n (a - b)
⊢ 2 * b ≤ 2 * d
Tactic:
exact Nat.mul_le_mul_left 2 hbd
Proof state after:
no goals
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have hxy : x ≤ y := Nat.le_trans hxw hwy
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have ht' : t = y - round (y - z) := by
  rewrite [ht]
  apply round_eq_of_trunc_eq npos hfaithful₀
  exact s₂ npos hfaithful₀ hfaithful₁ hfy hfz hzy
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have htx' : t ≤ y - round (y - x) := calc
  t = y - round (y - z) := ht'
  _ ≤ y - round (y - x) := tsub_le_tsub_left (hml hfz hfx hfy hzx) _
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have hzy' : round (y - z) ≤ y := by
  trans round (y - 0)
  . exact hml (trunc_zero n) hfz hfy (Nat.zero_le _)
  . rw [tsub_zero, round_eq_of_trunc_eq npos hfaithful₀ hfy]
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have hft : trunc n t = t := ht ▸ trunc_round npos hfaithful₁ _
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
hft : trunc n t = t
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
hft : trunc n t = t
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have hfx' : round (y - round (y - x)) = y - round (y - x) := by
  apply round_eq_of_trunc_eq npos hfaithful₀
  exact s₂ npos hfaithful₀ hfaithful₁ hfy hfx hxy
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
hft : trunc n t = t
hfx' : round (y - round (y - x)) = y - round (y - x)
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Theorem: interval_shift₁
Proof state before:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
hft : trunc n t = t
hfx' : round (y - round (y - x)) = y - round (y - x)
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w
Tactic:
have hfut {u : ℕ} (hxu : x ≤ u) (hut : u < t) (hfu : trunc n u = u)
  (hux' : u ≤ round (y - round (y - x)))
: trunc n (t - u) = t - u := by
  have hfuxy : trunc n (y - round (y - x) - u) = y - round (y - x) - u := by
    have hxyx : x < round (y - round (y - x)) := calc
      x ≤ u                         := hxu
      _ < t                         := hut
      _ ≤ y - round (y - x)         := htx'
      _ = round (y - round (y - x)) := hfx'.symm
    rewrite [← hfx']
    exact s₃ npos hfaithful₀ hfaithful₁ hfy hfx hfu hxy hxu hyxulp hxyx hux'
  rewrite [ht] at hut htx' ⊢
  replace hfx' := trunc_eq_of_round_eq npos hfaithful₁ hfx'
  exact s₁ npos hut.le htx' hfu hfx' (trunc_round npos hfaithful₁ _) hfuxy
Proof state after:
round : ℕ → ℕ
x y z w s t n : ℕ
npos : 0 < n
hfaithful₀ : faithful₀ n round
hfaithful₁ : faithful₁ n round
hml : sub_left_monotonic n round
hfx : trunc n x = x
hfy : trunc n y = y
hfz : trunc n z = z
hfw : trunc n w = w
hzx : z ≤ x
hzy : z ≤ y
hyxulp : ulp n y ≤ 2 * x
ht : t = round (y - round (y - z))
hs₁ : x < t → s = round (x + round (t - x))
hs₂ : t ≤ x → s = round (x - round (x - t))
hxw : x ≤ w
hwy : w ≤ y
hxy : x ≤ y
ht' : t = y - round (y - z)
htx' : t ≤ y - round (y - x)
hzy' : round (y - z) ≤ y
hft : trunc n t = t
hfx' : round (y - round (y - x)) = y - round (y - x)
hfut : ∀ {u : ℕ}, x ≤ u → u < t → trunc n u = u → u ≤ round (y - round (y - x)) → trunc n (t - u) = t - u
⊢ trunc n (w - s) = w - s ∧ trunc n (s - w) = s - w