Zulip Chat Archive
Stream: mathlib4
Topic: 10 million heartbeats (!4#3242)
Jeremy Tan (Apr 05 2023 at 16:14):
In fixing !4#3242 I think I've found a new record for most heartbeats needed to show definitional equality: 10 MILLION. 1 million doesn't work.
set_option maxHeartbeats 10000000 in -- XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX TODO
theorem tendsto_pow_atTop_nhds_0_of_lt_1 {π : Type _} [LinearOrderedField π] [Archimedean π]
[TopologicalSpace π] [OrderTopology π] {r : π} (hβ : 0 β€ r) (hβ : r < 1) :
Tendsto (fun n : β => r ^ n) atTop (π 0) := by
cases' hβ.eq_or_lt with h h
Β· exact (tendsto_add_atTop_iff_nat 1).mp <| by simp only [_root_.pow_succ, β h, zero_mul,
tendsto_const_nhds_iff]
Β· have : Tendsto (fun n => (rβ»ΒΉ ^ n)β»ΒΉ) atTop (π 0) :=
tendsto_inv_atTop_zero.comp (tendsto_pow_atTop_atTop_of_one_lt <| one_lt_inv h hβ)
exact this.congr fun n => by simp
Jeremy Tan (Apr 05 2023 at 16:16):
Surely @Matthew Ballard can help with this (and perhaps the rest of the file)?
Matthew Ballard (Apr 05 2023 at 16:21):
/me is currently depreciating an hvac system for taxes
Jeremy Tan (Apr 05 2023 at 16:33):
/me is testing that feature from PokΓ©mon Showdown
MonadMaverick (Apr 06 2023 at 03:10):
theorem tendsto_pow_atTop_nhds_0_of_lt_1 {π : Type _} [LinearOrderedField π] [Archimedean π]
[TopologicalSpace π] [OrderTopology π] {r : π} (hβ : 0 β€ r) (hβ : r < 1) :
Tendsto (fun n : β => r ^ n) atTop (π 0) :=
hβ.eq_or_lt.elim
(fun hr => (tendsto_add_atTop_iff_nat 1).mp <| by simp [_root_.pow_succ, β hr, tendsto_const_nhds])
(fun hr =>
have := one_lt_inv hr hβ |> tendsto_pow_atTop_atTop_of_one_lt
(tendsto_inv_atTop_zero.comp this).congr fun n => by simp)
#align tendsto_pow_at_top_nhds_0_of_lt_1 tendsto_pow_atTop_nhds_0_of_lt_1
This seems to be fine.
MonadMaverick (Apr 06 2023 at 04:47):
All fixed. Basic.lean
I'll push my commits tonight
Jeremy Tan (Apr 06 2023 at 10:49):
You have not solved the very last error
Jeremy Tan (Apr 06 2023 at 10:50):
theorem exists_pos_tsum_mul_lt_of_countable {Ξ΅ : ββ₯0β} (hΞ΅ : Ξ΅ β 0) {ΞΉ} [Countable ΞΉ] (w : ΞΉ β ββ₯0β)
(hw : β i, w i β β) : β Ξ΄ : ΞΉ β ββ₯0, (β i, 0 < Ξ΄ i) β§ (β' i, (w i * Ξ΄ i : ββ₯0β)) < Ξ΅ := by
lift w to ΞΉ β ββ₯0 using hw
rcases exists_pos_sum_of_countable hΞ΅ ΞΉ with β¨Ξ΄', Hpos, Hsumβ©
have : β i, 0 < max 1 (w i) := fun i => zero_lt_one.trans_le (le_max_left _ _)
refine' β¨fun i => Ξ΄' i / max 1 (w i), fun i => div_pos (Hpos _) (this i), _β©
refine' lt_of_le_of_lt (ENNReal.tsum_le_tsum fun i => _) Hsum
rw [coe_div (this i).ne']
refine' mul_le_of_le_div' (mul_le_mul_left' (ENNReal.inv_le_inv.2 _) _)
exact coe_le_coe.2 (le_max_right _ _
MonadMaverick (Apr 06 2023 at 10:55):
really? somebody else also pushed. I'll have a look.
Jeremy Tan (Apr 06 2023 at 10:56):
Though to give you credit, I've incorporated some of your fixes in there
MonadMaverick (Apr 06 2023 at 11:11):
I think Komyyy <pol_tta@outlook.jp> pushed another fix independently.
MonadMaverick (Apr 06 2023 at 11:12):
I've pushed my version as tmp.lean.
It's strange that compiler doesn't complain about exists_pos_tsum_mul_lt_of_countable in my version.
MonadMaverick (Apr 06 2023 at 11:13):
@Pol'tta / KΓ΄ Miyahara
MonadMaverick (Apr 06 2023 at 11:43):
I've fixed the last error. @Jeremy Tan
Jeremy Tan (Apr 06 2023 at 11:43):
I've traced the problem to the inclusion of algebraMap
; adding open algebraMap
causes the error, and without it that last error disappears
Jeremy Tan (Apr 06 2023 at 11:43):
@YaΓ«l Dillies why?
MonadMaverick (Apr 06 2023 at 11:44):
looks like the ugly fix works
ugly one:
theorem tendsto_coe_nat_div_add_atTop {π : Type _} [DivisionRing π] [TopologicalSpace π]
[CharZero π] [Algebra β π] [ContinuousSMul β π] [TopologicalDivisionRing π] (x : π) :
Tendsto (fun n : β => (n : π) / (n + x)) atTop (π 1) := by
refine' Tendsto.congr' ((eventually_ne_atTop 0).mp (eventually_of_forall fun n hn => _)) _
Β· exact fun n : β => 1 / (1 + x / n)
Β· field_simp [Nat.cast_ne_zero.mpr hn]
Β· have : π (1 : π) = π (1 / (1 + x * (0 : π))) := by
rw [MulZeroClass.mul_zero, add_zero, div_one]
rw [this]
refine' tendsto_const_nhds.div (tendsto_const_nhds.add _) (by simp)
simp_rw [div_eq_mul_inv]
refine' tendsto_const_nhds.mul _
have : (fun n : β => (n : π)β»ΒΉ) = fun n : β => (n : π)β»ΒΉ := by
ext1 n
rw [β map_natCast (algebraMap β π) n, β map_invβ (algebraMap β π)]
rw [this]
have := ((continuous_algebraMap β π).tendsto _).comp tendsto_inverse_atTop_nhds_0_nat
simp at this
refine' Iff.mpr tendsto_atTop' _
rw [tendsto_atTop'] at this
intro s hs
specialize this s hs
choose a ha using this
exists a
intro b hb
specialize ha b hb
simp [Set.mem_def] at ha
exact ha
#align tendsto_coe_nat_div_add_at_top tendsto_coe_nat_div_add_atTop
theorem tendsto_coe_nat_div_add_atTop {π : Type _} [DivisionRing π] [TopologicalSpace π]
[CharZero π] [Algebra β π] [ContinuousSMul β π] [TopologicalDivisionRing π] (x : π) :
Tendsto (fun n : β => (n : π) / (n + x)) atTop (π 1) := by
refine' Tendsto.congr' ((eventually_ne_atTop 0).mp (eventually_of_forall fun n hn => _)) _
Β· exact fun n : β => 1 / (1 + x / n)
Β· field_simp [Nat.cast_ne_zero.mpr hn]
Β· have : π (1 : π) = π (1 / (1 + x * β(0 : β))) := by
rw [algebraMap.coe_zero, MulZeroClass.mul_zero, add_zero, div_one]
rw [this]
refine' tendsto_const_nhds.div (tendsto_const_nhds.add _) (by simp)
simp_rw [div_eq_mul_inv]
refine' tendsto_const_nhds.mul _
have : (fun n : β => (n : π)β»ΒΉ) = fun n : β => β(nβ»ΒΉ : β) := by
ext1 n
rw [β map_natCast (algebraMap β π) n, β map_invβ (algebraMap β π)]
rfl
rw [this]
exact ((continuous_algebraMap β π).tendsto _).comp tendsto_inverse_atTop_nhds_0_nat
#align tendsto_coe_nat_div_add_at_top tendsto_coe_nat_div_add_atTop
MonadMaverick (Apr 06 2023 at 11:45):
must be some function name collision shenanigans
Jeremy Tan (Apr 06 2023 at 11:50):
There, all done!
Last updated: Dec 20 2023 at 11:08 UTC