Zulip Chat Archive

Stream: new members

Topic: Real.logb in lean4


Rahul Saha (Aug 13 2023 at 06:34):

Hello, I am trying to convert the following lean 3 code to lean 4.

theorem aime_1984_p5
  (a b : )
  (h₀ : real.logb 8 a + real.logb 4 (b^2) = 5)
  (h₁ : real.logb 8 b + real.logb 4 (a^2) = 7) :
  a * b = 512 :=
  sorry

Using mathlib port produced

theorem aime_1984_p5 (a b : ) (h₀ : Real.logb 8 a + Real.logb 4 (b ^ 2) = 5)
    (h₁ : Real.logb 8 b + Real.logb 4 (a ^ 2) = 7) : a * b = 512 := by sorry

But upon checking the github for mathlib4, there does not appear to be a logb in Real. Instead, there is one inside Analysis.SpecialFucntions.Functions.Log. I am wondering if this is the intended place to import logb from. Thank you!

Ruben Van de Velde (Aug 13 2023 at 06:40):

docs3#real.logb shows that it was also in that file in mathlib 3

Rahul Saha (Aug 13 2023 at 06:41):

@Ruben Van de Velde yep, it's why i am slightly confused by this reorganization.

Rahul Saha (Aug 13 2023 at 06:44):

also its not a reorganization - the log in analysis is also present in mathlib 3

Rahul Saha (Aug 13 2023 at 06:47):

it appears to be in the docs for mathlib4 - https://leanprover-community.github.io/mathlib4_docs/Mathlib/Analysis/SpecialFunctions/Log/Base.html#Real.logb

Rahul Saha (Aug 13 2023 at 06:47):

but it links to the a file that is not Real.logb

Kevin Buzzard (Aug 13 2023 at 08:35):

So you need to import Mathlib.Analysis.SpecialFunctions.Log.Base

Ruben Van de Velde (Aug 13 2023 at 08:43):

logb is a definition, not a file, and it's defined in the same place in mathlib 3 and 4

Rahul Saha (Aug 13 2023 at 15:10):

Ah I see, okay, I was being dum. Thank you.


Last updated: Dec 20 2023 at 11:08 UTC