File: Mathlib/Data/Int/Log.lean

full_name: Int.log
code: /-- The greatest power of `b` such that `b ^ log b r ≤ r`. -/
def log (b : ℕ) (r : R) : ℤ 
goal: ℤ

full_name: Int.log_of_one_le_right
code: theorem log_of_one_le_right (b : ℕ) {r : R} (hr : 1 ≤ r) : log b r = Nat.log b ⌊r⌋₊ 
goal: Int.log b r = ↑(Nat.log b ⌊r⌋₊)

full_name: Int.log_of_right_le_one
code: theorem log_of_right_le_one (b : ℕ) {r : R} (hr : r ≤ 1) : log b r = -Nat.clog b ⌈r⁻¹⌉₊ 
goal: Int.log b r = -↑(Nat.clog b ⌈r⁻¹⌉₊)

full_name: Int.log_natCast
code: @[simp, norm_cast]
theorem log_natCast (b : ℕ) (n : ℕ) : log b (n : R) = Nat.log b n 
goal: Int.log b ↑n = ↑(Nat.log b n)

full_name: Int.log_ofNat
code: @[simp]
theorem log_ofNat (b : ℕ) (n : ℕ) [n.AtLeastTwo] :
    log b (no_index (OfNat.ofNat n : R)) = Nat.log b (OfNat.ofNat n) 
goal: Int.log b (OfNat.ofNat n) = ↑(Nat.log b (OfNat.ofNat n))

full_name: Int.log_of_left_le_one
code: theorem log_of_left_le_one {b : ℕ} (hb : b ≤ 1) (r : R) : log b r = 0 
goal: Int.log b r = 0

full_name: Int.log_of_right_le_zero
code: theorem log_of_right_le_zero (b : ℕ) {r : R} (hr : r ≤ 0) : log b r = 0 
goal: Int.log b r = 0

full_name: Int.zpow_log_le_self
code: theorem zpow_log_le_self {b : ℕ} {r : R} (hb : 1 < b) (hr : 0 < r) : (b : R) ^ log b r ≤ r 
goal: ↑b ^ Int.log b r ≤ r

full_name: Int.lt_zpow_succ_log_self
code: theorem lt_zpow_succ_log_self {b : ℕ} (hb : 1 < b) (r : R) : r < (b : R) ^ (log b r + 1) 
goal: r < ↑b ^ (Int.log b r + 1)

full_name: Int.log_zero_right
code: @[simp]
theorem log_zero_right (b : ℕ) : log b (0 : R) = 0 
goal: Int.log b 0 = 0

full_name: Int.log_one_right
code: @[simp]
theorem log_one_right (b : ℕ) : log b (1 : R) = 0 
goal: Int.log b 1 = 0

full_name: Int.log_zpow
code: theorem log_zpow {b : ℕ} (hb : 1 < b) (z : ℤ) : log b ((b : R) ^ z : R) = z 
goal: Int.log b (↑b ^ z) = z

full_name: Int.log_mono_right
code: @[mono]
theorem log_mono_right {b : ℕ} {r₁ r₂ : R} (h₀ : 0 < r₁) (h : r₁ ≤ r₂) : log b r₁ ≤ log b r₂ 
goal: Int.log b r₁ ≤ Int.log b r₂

full_name: Int.zpowLogGi
code: /-- Over suitable subtypes, `zpow` and `Int.log` form a galois coinsertion -/
def zpowLogGi {b : ℕ} (hb : 1 < b) :
    GaloisCoinsertion
      (fun z : ℤ =>
        Subtype.mk ((b : R) ^ z) <| zpow_pos_of_pos (mod_cast zero_lt_one.trans hb) z)
      fun r : Set.Ioi (0 : R) => Int.log b (r : R) 
goal: GaloisCoinsertion (fun z => ⟨↑b ^ z, ⋯⟩) fun r => Int.log b ↑r

full_name: Int.lt_zpow_iff_log_lt
code: /-- `zpow b` and `Int.log b` (almost) form a Galois connection. -/
theorem lt_zpow_iff_log_lt {b : ℕ} (hb : 1 < b) {x : ℤ} {r : R} (hr : 0 < r) :
    r < (b : R) ^ x ↔ log b r < x 
goal: r < ↑b ^ x ↔ Int.log b r < x

full_name: Int.zpow_le_iff_le_log
code: /-- `zpow b` and `Int.log b` (almost) form a Galois connection. -/
theorem zpow_le_iff_le_log {b : ℕ} (hb : 1 < b) {x : ℤ} {r : R} (hr : 0 < r) :
    (b : R) ^ x ≤ r ↔ x ≤ log b r 
goal: ↑b ^ x ≤ r ↔ x ≤ Int.log b r

full_name: Int.clog
code: /-- The least power of `b` such that `r ≤ b ^ log b r`. -/
def clog (b : ℕ) (r : R) : ℤ 
goal: ℤ

full_name: Int.clog_of_one_le_right
code: theorem clog_of_one_le_right (b : ℕ) {r : R} (hr : 1 ≤ r) : clog b r = Nat.clog b ⌈r⌉₊ 
goal: Int.clog b r = ↑(Nat.clog b ⌈r⌉₊)

full_name: Int.clog_of_right_le_one
code: theorem clog_of_right_le_one (b : ℕ) {r : R} (hr : r ≤ 1) : clog b r = -Nat.log b ⌊r⁻¹⌋₊ 
goal: Int.clog b r = -↑(Nat.log b ⌊r⁻¹⌋₊)

full_name: Int.clog_of_right_le_zero
code: theorem clog_of_right_le_zero (b : ℕ) {r : R} (hr : r ≤ 0) : clog b r = 0 
goal: Int.clog b r = 0

full_name: Int.clog_inv
code: @[simp]
theorem clog_inv (b : ℕ) (r : R) : clog b r⁻¹ = -log b r 
goal: Int.clog b r⁻¹ = -Int.log b r

full_name: Int.log_inv
code: @[simp]
theorem log_inv (b : ℕ) (r : R) : log b r⁻¹ = -clog b r 
goal: Int.log b r⁻¹ = -Int.clog b r

full_name: Int.neg_log_inv_eq_clog
code: theorem neg_log_inv_eq_clog (b : ℕ) (r : R) : -log b r⁻¹ = clog b r 
goal: -Int.log b r⁻¹ = Int.clog b r

full_name: Int.neg_clog_inv_eq_log
code: theorem neg_clog_inv_eq_log (b : ℕ) (r : R) : -clog b r⁻¹ = log b r 
goal: -Int.clog b r⁻¹ = Int.log b r

full_name: Int.clog_natCast
code: @[simp, norm_cast]
theorem clog_natCast (b : ℕ) (n : ℕ) : clog b (n : R) = Nat.clog b n 
goal: Int.clog b ↑n = ↑(Nat.clog b n)

full_name: Int.clog_ofNat
code: @[simp]
theorem clog_ofNat (b : ℕ) (n : ℕ) [n.AtLeastTwo] :
    clog b (no_index (OfNat.ofNat n : R)) = Nat.clog b (OfNat.ofNat n) 
goal: Int.clog b (OfNat.ofNat n) = ↑(Nat.clog b (OfNat.ofNat n))

full_name: Int.clog_of_left_le_one
code: theorem clog_of_left_le_one {b : ℕ} (hb : b ≤ 1) (r : R) : clog b r = 0 
goal: Int.clog b r = 0

full_name: Int.self_le_zpow_clog
code: theorem self_le_zpow_clog {b : ℕ} (hb : 1 < b) (r : R) : r ≤ (b : R) ^ clog b r 
goal: r ≤ ↑b ^ Int.clog b r

full_name: Int.zpow_pred_clog_lt_self
code: theorem zpow_pred_clog_lt_self {b : ℕ} {r : R} (hb : 1 < b) (hr : 0 < r) :
    (b : R) ^ (clog b r - 1) < r 
goal: ↑b ^ (Int.clog b r - 1) < r

full_name: Int.clog_zero_right
code: @[simp]
theorem clog_zero_right (b : ℕ) : clog b (0 : R) = 0 
goal: Int.clog b 0 = 0

full_name: Int.clog_one_right
code: @[simp]
theorem clog_one_right (b : ℕ) : clog b (1 : R) = 0 
goal: Int.clog b 1 = 0

full_name: Int.clog_zpow
code: theorem clog_zpow {b : ℕ} (hb : 1 < b) (z : ℤ) : clog b ((b : R) ^ z : R) = z 
goal: Int.clog b (↑b ^ z) = z

full_name: Int.clog_mono_right
code: @[mono]
theorem clog_mono_right {b : ℕ} {r₁ r₂ : R} (h₀ : 0 < r₁) (h : r₁ ≤ r₂) :
    clog b r₁ ≤ clog b r₂ 
goal: Int.clog b r₁ ≤ Int.clog b r₂

full_name: Int.clogZPowGi
code: /-- Over suitable subtypes, `Int.clog` and `zpow` form a galois insertion -/
def clogZPowGi {b : ℕ} (hb : 1 < b) :
    GaloisInsertion (fun r : Set.Ioi (0 : R) => Int.clog b (r : R)) fun z : ℤ =>
      ⟨(b : R) ^ z, zpow_pos_of_pos (mod_cast zero_lt_one.trans hb) z⟩ 
goal: GaloisInsertion (fun r => Int.clog b ↑r) fun z => ⟨↑b ^ z, ⋯⟩

full_name: Int.zpow_lt_iff_lt_clog
code: /-- `Int.clog b` and `zpow b` (almost) form a Galois connection. -/
theorem zpow_lt_iff_lt_clog {b : ℕ} (hb : 1 < b) {x : ℤ} {r : R} (hr : 0 < r) :
    (b : R) ^ x < r ↔ x < clog b r 
goal: ↑b ^ x < r ↔ x < Int.clog b r

full_name: Int.le_zpow_iff_clog_le
code: /-- `Int.clog b` and `zpow b` (almost) form a Galois connection. -/
theorem le_zpow_iff_clog_le {b : ℕ} (hb : 1 < b) {x : ℤ} {r : R} (hr : 0 < r) :
    r ≤ (b : R) ^ x ↔ clog b r ≤ x 
goal: r ≤ ↑b ^ x ↔ Int.clog b r ≤ x