Skip to content

Commit

Permalink
feat(data/int/order): delete int.order and prove all commented out le…
Browse files Browse the repository at this point in the history
…mmas (#348)
  • Loading branch information
ChrisHughes24 authored and digama0 committed Sep 13, 2018
1 parent 1206356 commit bebe170
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 205 deletions.
6 changes: 3 additions & 3 deletions algebra/archimedean.lean
Expand Up @@ -5,7 +5,7 @@ Authors: Mario Carneiro
Archimedean groups and fields.
-/
import algebra.group_power data.rat data.int.order
import algebra.group_power data.rat

local infix ` • ` := add_monoid.smul

Expand Down Expand Up @@ -99,14 +99,14 @@ theorem ceil_lt_add_one (x : α) : (⌈x⌉ : α) < x + 1 :=
by rw [← lt_ceil, ← int.cast_one, ceil_add_int]; apply lt_add_one

lemma ceil_pos {a : α} : 0 < ⌈a⌉ ↔ 0 < a :=
⟨ λ h, have ⌊-a⌋ < 0, from neg_of_neg_pos h,
⟨ λ h, have ⌊-a⌋ < 0, from neg_of_neg_pos h,
pos_of_neg_neg $ lt_of_not_ge $ (not_iff_not_of_iff floor_nonneg).1 $ not_le_of_gt this,
λ h, have -a < 0, from neg_neg_of_pos h,
neg_pos_of_neg $ lt_of_not_ge $ (not_iff_not_of_iff floor_nonneg).2 $ not_le_of_gt this

lemma ceil_nonneg {q : ℚ} (hq : q ≥ 0) : ⌈q⌉ ≥ 0 :=
if h : q > 0 then le_of_lt $ ceil_pos.2 h
else
else
have h' : q = 0, from le_antisymm (le_of_not_lt h) hq,
by simp [h']

Expand Down
5 changes: 5 additions & 0 deletions data/int/basic.lean
Expand Up @@ -38,6 +38,8 @@ lemma coe_nat_ne_zero_iff_pos {n : ℕ} : (n : ℤ) ≠ 0 ↔ 0 < n :=
⟨λ h, nat.pos_of_ne_zero (coe_nat_ne_zero.1 h),
λ h, (ne_of_lt (coe_nat_lt.2 h)).symm⟩

lemma coe_nat_succ_pos (n : ℕ) : 0 < (n.succ : ℤ) := int.coe_nat_pos.2 (succ_pos n)

/- succ and pred -/

/-- Immediate successor of an integer: `succ n = n + 1` -/
Expand Down Expand Up @@ -718,6 +720,9 @@ units.ext_iff.1 $ nat.units_eq_one ⟨nat_abs u, nat_abs ↑u⁻¹,
theorem units_eq_one_or (u : units ℤ) : u = 1 ∨ u = -1 :=
by simpa [units.ext_iff, units_nat_abs] using nat_abs_eq u

lemma units_inv_eq_self (u : units ℤ) : u⁻¹ = u :=
(units_eq_one_or u).elim (λ h, h.symm ▸ rfl) (λ h, h.symm ▸ rfl)

/- bitwise ops -/

@[simp] lemma bodd_zero : bodd 0 = ff := rfl
Expand Down
202 changes: 0 additions & 202 deletions data/int/order.lean

This file was deleted.

0 comments on commit bebe170

Please sign in to comment.