state
stringlengths 0
159k
| srcUpToTactic
stringlengths 387
167k
| nextTactic
stringlengths 3
9k
| declUpToTactic
stringlengths 22
11.5k
| declId
stringlengths 38
95
| decl
stringlengths 16
1.89k
| file_tag
stringlengths 17
73
|
---|---|---|---|---|---|---|
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
⊢ {a} = Iio (succ a) ∩ Ioi (pred a) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
| suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
| Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
⊢ {a} = Iio (succ a) ∩ Ioi (pred a) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· | rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ] | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· | Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case h_singleton_eq_inter'
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
⊢ {a} = Iic a ∩ Ici a | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
| rw [inter_comm, Ici_inter_Iic, Icc_self a] | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
| Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
| rw [h_singleton_eq_inter] | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
| Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen (Iio (succ a) ∩ Ioi (pred a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
| apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a }) | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
| Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case h₁
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen (Iio (succ a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· | exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩ | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· | Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case h₂
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
⊢ IsOpen (Ioi (pred a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· | exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩ | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· | Mathlib.Topology.Instances.Discrete.45_0.ZrbbXQYldP9CdIh | theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
⊢ DiscreteTopology α ↔ OrderTopology α | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
| refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩ | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
| Mathlib.Topology.Instances.Discrete.60_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_1
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : DiscreteTopology α
⊢ inst✝⁵ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· | rw [h.eq_bot] | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· | Mathlib.Topology.Instances.Discrete.60_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_1
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : DiscreteTopology α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
| exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
| Mathlib.Topology.Instances.Discrete.60_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_2
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : OrderTopology α
⊢ inst✝⁵ = ⊥ | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· | rw [h.topology_eq_generate_intervals] | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· | Mathlib.Topology.Instances.Discrete.60_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_2
α : Type u_1
inst✝⁵ : TopologicalSpace α
inst✝⁴ : PartialOrder α
inst✝³ : PredOrder α
inst✝² : SuccOrder α
inst✝¹ : NoMinOrder α
inst✝ : NoMaxOrder α
h : OrderTopology α
⊢ generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} = ⊥ | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
| exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
| Mathlib.Topology.Instances.Discrete.60_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
| refine' (eq_bot_of_singletons_open fun a => _).symm | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
| have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a] | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
⊢ {a} = Iic a ∩ Ici a | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by | rw [inter_comm, Ici_inter_Iic, Icc_self a] | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iic a ∩ Ici a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
| by_cases ha_top : IsTop a | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iic a ∩ Ici a
ha_top : IsTop a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· | rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Ici a
ha_top : IsTop a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
| by_cases ha_bot : IsBot a | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Ici a
ha_top : IsTop a
ha_bot : IsBot a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· | rw [ha_bot.Ici_eq] at h_singleton_eq_inter | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = univ
ha_top : IsTop a
ha_bot : IsBot a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
| rw [h_singleton_eq_inter] | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = univ
ha_top : IsTop a
ha_bot : IsBot a
⊢ IsOpen univ | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
| apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a }) | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Ici a
ha_top : IsTop a
ha_bot : ¬IsBot a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· | rw [isBot_iff_isMin] at ha_bot | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Ici a
ha_top : IsTop a
ha_bot : ¬IsMin a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
| rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Ioi (pred a)
ha_top : IsTop a
ha_bot : ¬IsMin a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
| rw [h_singleton_eq_inter] | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Ioi (pred a)
ha_top : IsTop a
ha_bot : ¬IsMin a
⊢ IsOpen (Ioi (pred a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
| exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩ | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iic a ∩ Ici a
ha_top : ¬IsTop a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· | rw [isTop_iff_isMax] at ha_top | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iic a ∩ Ici a
ha_top : ¬IsMax a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
| rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ici a
ha_top : ¬IsMax a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
| by_cases ha_bot : IsBot a | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ici a
ha_top : ¬IsMax a
ha_bot : IsBot a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· | rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a)
ha_top : ¬IsMax a
ha_bot : IsBot a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
| rw [h_singleton_eq_inter] | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a)
ha_top : ¬IsMax a
ha_bot : IsBot a
⊢ IsOpen (Iio (succ a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
| exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩ | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ici a
ha_top : ¬IsMax a
ha_bot : ¬IsBot a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· | rw [isBot_iff_isMin] at ha_bot | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ici a
ha_top : ¬IsMax a
ha_bot : ¬IsMin a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
| rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
ha_top : ¬IsMax a
ha_bot : ¬IsMin a
⊢ IsOpen {a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
| rw [h_singleton_eq_inter] | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
ha_top : ¬IsMax a
ha_bot : ¬IsMin a
⊢ IsOpen (Iio (succ a) ∩ Ioi (pred a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
| apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a }) | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
| Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg.h₁
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
ha_top : ¬IsMax a
ha_bot : ¬IsMin a
⊢ IsOpen (Iio (succ a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· | exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩ | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
case neg.h₂
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
a : α
h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a)
ha_top : ¬IsMax a
ha_bot : ¬IsMin a
⊢ IsOpen (Ioi (pred a)) | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· | exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩ | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· | Mathlib.Topology.Instances.Discrete.74_0.ZrbbXQYldP9CdIh | theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
⊢ DiscreteTopology α ↔ OrderTopology α | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
| refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩ | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
| Mathlib.Topology.Instances.Discrete.104_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : DiscreteTopology α
⊢ inst✝³ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· | rw [h.eq_bot] | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· | Mathlib.Topology.Instances.Discrete.104_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : DiscreteTopology α
⊢ ⊥ = generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
| exact LinearOrder.bot_topologicalSpace_eq_generateFrom | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
| Mathlib.Topology.Instances.Discrete.104_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : OrderTopology α
⊢ inst✝³ = ⊥ | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· | rw [h.topology_eq_generate_intervals] | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· | Mathlib.Topology.Instances.Discrete.104_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
case refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : LinearOrder α
inst✝¹ : PredOrder α
inst✝ : SuccOrder α
h : OrderTopology α
⊢ generateFrom {s | ∃ a, s = Ioi a ∨ s = Iio a} = ⊥ | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· rw [h.topology_eq_generate_intervals]
| exact LinearOrder.bot_topologicalSpace_eq_generateFrom.symm | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· rw [h.topology_eq_generate_intervals]
| Mathlib.Topology.Instances.Discrete.104_0.ZrbbXQYldP9CdIh | theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝¹ : TopologicalSpace α
inst✝ : DiscreteTopology α
⊢ MetrizableSpace α | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· rw [h.topology_eq_generate_intervals]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom.symm
#align discrete_topology_iff_order_topology_of_pred_succ discreteTopology_iff_orderTopology_of_pred_succ
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ [h : DiscreteTopology α]
[LinearOrder α] [PredOrder α] [SuccOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ.mp h
#align discrete_topology.order_topology_of_pred_succ DiscreteTopology.orderTopology_of_pred_succ
instance (priority := 100) DiscreteTopology.metrizableSpace [DiscreteTopology α] :
MetrizableSpace α := by
| obtain rfl := DiscreteTopology.eq_bot (α := α) | instance (priority := 100) DiscreteTopology.metrizableSpace [DiscreteTopology α] :
MetrizableSpace α := by
| Mathlib.Topology.Instances.Discrete.118_0.ZrbbXQYldP9CdIh | instance (priority | Mathlib_Topology_Instances_Discrete |
α : Type u_1
inst✝ : DiscreteTopology α
⊢ MetrizableSpace α | /-
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Order.SuccPred.Basic
import Mathlib.Topology.Order.Basic
import Mathlib.Topology.Metrizable.Uniformity
#align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4"
/-!
# Instances related to the discrete topology
We prove that the discrete topology is
* first-countable,
* second-countable for an encodable type,
* equal to the order topology in linear orders which are also `PredOrder` and `SuccOrder`,
* metrizable.
When importing this file and `Data.Nat.SuccPred`, the instances `SecondCountableTopology ℕ`
and `OrderTopology ℕ` become available.
-/
open Order Set TopologicalSpace Filter
variable {α : Type*} [TopologicalSpace α]
instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] :
FirstCountableTopology α where
nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure
#align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology
instance (priority := 100) DiscreteTopology.secondCountableTopology_of_encodable
[hd : DiscreteTopology α] [Encodable α] : SecondCountableTopology α :=
haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i =>
{ is_open_generated_countable :=
⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ }
secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd)
(iUnion_of_singleton α)
#align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_encodable
theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] :
(⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by
suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a
· rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ]
rw [inter_comm, Ici_inter_Iic, Icc_self a]
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
[SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder
· rw [h.topology_eq_generate_intervals]
exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm
#align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ'
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α]
[PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ'.1 h
#align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ'
theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
[SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by
refine' (eq_bot_of_singletons_open fun a => _).symm
have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a]
by_cases ha_top : IsTop a
· rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error.
apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
· rw [isTop_iff_isMax] at ha_top
rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter
by_cases ha_bot : IsBot a
· rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· rw [isBot_iff_isMin] at ha_bot
rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter
rw [h_singleton_eq_inter]
-- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error.
apply @IsOpen.inter _ _ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a })
· exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩
· exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩
#align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
[SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine' ⟨fun h => ⟨_⟩, fun h => ⟨_⟩⟩
· rw [h.eq_bot]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom
· rw [h.topology_eq_generate_intervals]
exact LinearOrder.bot_topologicalSpace_eq_generateFrom.symm
#align discrete_topology_iff_order_topology_of_pred_succ discreteTopology_iff_orderTopology_of_pred_succ
instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ [h : DiscreteTopology α]
[LinearOrder α] [PredOrder α] [SuccOrder α] : OrderTopology α :=
discreteTopology_iff_orderTopology_of_pred_succ.mp h
#align discrete_topology.order_topology_of_pred_succ DiscreteTopology.orderTopology_of_pred_succ
instance (priority := 100) DiscreteTopology.metrizableSpace [DiscreteTopology α] :
MetrizableSpace α := by
obtain rfl := DiscreteTopology.eq_bot (α := α)
| exact @UniformSpace.metrizableSpace α ⊥ (isCountablyGenerated_principal _) _ | instance (priority := 100) DiscreteTopology.metrizableSpace [DiscreteTopology α] :
MetrizableSpace α := by
obtain rfl := DiscreteTopology.eq_bot (α := α)
| Mathlib.Topology.Instances.Discrete.118_0.ZrbbXQYldP9CdIh | instance (priority | Mathlib_Topology_Instances_Discrete |
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n : ℕ
⊢ (coeff R n) (derivativeFun f) = (coeff R (n + 1)) f * (↑n + 1) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
| rw [derivativeFun, coeff_mk] | theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
| Mathlib.RingTheory.PowerSeries.Derivative.40_0.PcMDeT7Qkkrj2IE | theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f : R[X]
⊢ derivativeFun ↑f = ↑(derivative f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
| ext | theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
| Mathlib.RingTheory.PowerSeries.Derivative.44_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
f : R[X]
n✝ : ℕ
⊢ (coeff R n✝) (derivativeFun ↑f) = (coeff R n✝) ↑(derivative f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
| rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative] | theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
| Mathlib.RingTheory.PowerSeries.Derivative.44_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f g : R⟦X⟧
⊢ derivativeFun (f + g) = derivativeFun f + derivativeFun g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
| ext | theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
| Mathlib.RingTheory.PowerSeries.Derivative.48_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
f g : R⟦X⟧
n✝ : ℕ
⊢ (coeff R n✝) (derivativeFun (f + g)) = (coeff R n✝) (derivativeFun f + derivativeFun g) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
| rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul] | theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
| Mathlib.RingTheory.PowerSeries.Derivative.48_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
r : R
⊢ derivativeFun ((C R) r) = 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
| ext n | theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
| Mathlib.RingTheory.PowerSeries.Derivative.54_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
r : R
n : ℕ
⊢ (coeff R n) (derivativeFun ((C R) r)) = (coeff R n) 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
| rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero] | theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
| Mathlib.RingTheory.PowerSeries.Derivative.54_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n : ℕ
⊢ trunc n (derivativeFun f) = derivative (trunc (n + 1) f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
| ext d | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
| Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
case a
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
⊢ Polynomial.coeff (trunc n (derivativeFun f)) d = Polynomial.coeff (derivative (trunc (n + 1) f)) d | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
| rw [coeff_trunc] | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
| Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
case a
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
⊢ (if d < n then (coeff R d) (derivativeFun f) else 0) = Polynomial.coeff (derivative (trunc (n + 1) f)) d | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
| split_ifs with h | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
| Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
case pos
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
h : d < n
⊢ (coeff R d) (derivativeFun f) = Polynomial.coeff (derivative (trunc (n + 1) f)) d | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· | have : d + 1 < n + 1 := succ_lt_succ_iff.2 h | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· | Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
case pos
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
h : d < n
this : d + 1 < n + 1
⊢ (coeff R d) (derivativeFun f) = Polynomial.coeff (derivative (trunc (n + 1) f)) d | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
| rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this] | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
| Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
case neg
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
h : ¬d < n
⊢ 0 = Polynomial.coeff (derivative (trunc (n + 1) f)) d | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· | have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff] | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· | Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
h : ¬d < n
⊢ ¬d + 1 < n + 1 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by | rwa [succ_lt_succ_iff] | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by | Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
case neg
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n d : ℕ
h : ¬d < n
this : ¬d + 1 < n + 1
⊢ 0 = Polynomial.coeff (derivative (trunc (n + 1) f)) d | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
| rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul] | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
| Mathlib.RingTheory.PowerSeries.Derivative.58_0.PcMDeT7Qkkrj2IE | theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f g : R[X]
⊢ derivativeFun (↑f * ↑g) = ↑f * ↑(derivative g) + ↑g * ↑(derivative f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
| rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add] | private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
| Mathlib.RingTheory.PowerSeries.Derivative.69_0.PcMDeT7Qkkrj2IE | private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f g : R⟦X⟧
⊢ derivativeFun (f * g) = f • derivativeFun g + g • derivativeFun f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
| ext n | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
| Mathlib.RingTheory.PowerSeries.Derivative.74_0.PcMDeT7Qkkrj2IE | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
f g : R⟦X⟧
n : ℕ
⊢ (coeff R n) (derivativeFun (f * g)) = (coeff R n) (f • derivativeFun g + g • derivativeFun f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
| have h₁ : n < n + 1 := lt_succ_self n | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
| Mathlib.RingTheory.PowerSeries.Derivative.74_0.PcMDeT7Qkkrj2IE | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
f g : R⟦X⟧
n : ℕ
h₁ : n < n + 1
⊢ (coeff R n) (derivativeFun (f * g)) = (coeff R n) (f • derivativeFun g + g • derivativeFun f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
| have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁ | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
| Mathlib.RingTheory.PowerSeries.Derivative.74_0.PcMDeT7Qkkrj2IE | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
f g : R⟦X⟧
n : ℕ
h₁ : n < n + 1
h₂ : n < n + 1 + 1
⊢ (coeff R n) (derivativeFun (f * g)) = (coeff R n) (f • derivativeFun g + g • derivativeFun f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
| rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun] | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
| Mathlib.RingTheory.PowerSeries.Derivative.74_0.PcMDeT7Qkkrj2IE | /-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
⊢ derivativeFun 1 = 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
| rw [← map_one (C R), derivativeFun_C (1 : R)] | theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
| Mathlib.RingTheory.PowerSeries.Derivative.85_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
r : R
f : R⟦X⟧
⊢ derivativeFun (r • f) = r • derivativeFun f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
| rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul] | theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
| Mathlib.RingTheory.PowerSeries.Derivative.88_0.PcMDeT7Qkkrj2IE | theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
⊢ (d⁄dX R) X = 1 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
| ext | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
| Mathlib.RingTheory.PowerSeries.Derivative.112_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
n✝ : ℕ
⊢ (coeff R n✝) ((d⁄dX R) X) = (coeff R n✝) 1 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
| rw [coeff_derivative, coeff_one, coeff_X, boole_mul] | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
| Mathlib.RingTheory.PowerSeries.Derivative.112_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
n✝ : ℕ
⊢ (if n✝ + 1 = 1 then ↑n✝ + 1 else 0) = if n✝ = 0 then 1 else 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
| simp_rw [add_left_eq_self] | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
| Mathlib.RingTheory.PowerSeries.Derivative.112_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommSemiring R
n✝ : ℕ
⊢ (if n✝ = 0 then ↑n✝ + 1 else 0) = if n✝ = 0 then 1 else 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
| split_ifs with h | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
| Mathlib.RingTheory.PowerSeries.Derivative.112_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 | Mathlib_RingTheory_PowerSeries_Derivative |
case pos
R : Type u_1
inst✝ : CommSemiring R
n✝ : ℕ
h : n✝ = 0
⊢ ↑n✝ + 1 = 1 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· | rw [h, cast_zero, zero_add] | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· | Mathlib.RingTheory.PowerSeries.Derivative.112_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 | Mathlib_RingTheory_PowerSeries_Derivative |
case neg
R : Type u_1
inst✝ : CommSemiring R
n✝ : ℕ
h : ¬n✝ = 0
⊢ 0 = 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· | rfl | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· | Mathlib.RingTheory.PowerSeries.Derivative.112_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n : ℕ
⊢ trunc (n - 1) ((d⁄dX R) f) = Polynomial.derivative (trunc n f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
| cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative] | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
| Mathlib.RingTheory.PowerSeries.Derivative.124_0.PcMDeT7Qkkrj2IE | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n : ℕ
⊢ trunc (n - 1) ((d⁄dX R) f) = Polynomial.derivative (trunc n f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
| cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative] | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
| Mathlib.RingTheory.PowerSeries.Derivative.124_0.PcMDeT7Qkkrj2IE | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) | Mathlib_RingTheory_PowerSeries_Derivative |
case zero
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
⊢ trunc (Nat.zero - 1) ((d⁄dX R) f) = Polynomial.derivative (trunc Nat.zero f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| | zero =>
simp | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| Mathlib.RingTheory.PowerSeries.Derivative.124_0.PcMDeT7Qkkrj2IE | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) | Mathlib_RingTheory_PowerSeries_Derivative |
case zero
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
⊢ trunc (Nat.zero - 1) ((d⁄dX R) f) = Polynomial.derivative (trunc Nat.zero f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
| simp | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
| Mathlib.RingTheory.PowerSeries.Derivative.124_0.PcMDeT7Qkkrj2IE | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) | Mathlib_RingTheory_PowerSeries_Derivative |
case succ
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n : ℕ
⊢ trunc (succ n - 1) ((d⁄dX R) f) = Polynomial.derivative (trunc (succ n) f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| | succ n =>
rw [succ_sub_one, trunc_derivative] | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| Mathlib.RingTheory.PowerSeries.Derivative.124_0.PcMDeT7Qkkrj2IE | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) | Mathlib_RingTheory_PowerSeries_Derivative |
case succ
R : Type u_1
inst✝ : CommSemiring R
f : R⟦X⟧
n : ℕ
⊢ trunc (succ n - 1) ((d⁄dX R) f) = Polynomial.derivative (trunc (succ n) f) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
| rw [succ_sub_one, trunc_derivative] | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
| Mathlib.RingTheory.PowerSeries.Derivative.124_0.PcMDeT7Qkkrj2IE | theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
⊢ f = g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
| ext n | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
n : ℕ
⊢ (coeff R n) f = (coeff R n) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
| cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
n : ℕ
⊢ (coeff R n) f = (coeff R n) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
| cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h.zero
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
⊢ (coeff R Nat.zero) f = (coeff R Nat.zero) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| | zero =>
rw [coeff_zero_eq_constantCoeff, hc] | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h.zero
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
⊢ (coeff R Nat.zero) f = (coeff R Nat.zero) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
| rw [coeff_zero_eq_constantCoeff, hc] | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h.succ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
n : ℕ
⊢ (coeff R (succ n)) f = (coeff R (succ n)) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| | succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h.succ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
n : ℕ
⊢ (coeff R (succ n)) f = (coeff R (succ n)) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
| have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD] | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
n : ℕ
⊢ (coeff R n) ((d⁄dX R) f) = (coeff R n) ((d⁄dX R) g) | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by | rw [hD] | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by | Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
case h.succ
R : Type u_1
inst✝¹ : CommRing R
inst✝ : NoZeroSMulDivisors ℕ R
f g : R⟦X⟧
hD : (d⁄dX R) f = (d⁄dX R) g
hc : (constantCoeff R) f = (constantCoeff R) g
n : ℕ
equ : (coeff R n) ((d⁄dX R) f) = (coeff R n) ((d⁄dX R) g)
⊢ (coeff R (succ n)) f = (coeff R (succ n)) g | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
| rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
| Mathlib.RingTheory.PowerSeries.Derivative.138_0.PcMDeT7Qkkrj2IE | /-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : CommRing R
f : R⟦X⟧ˣ
⊢ (d⁄dX R) ↑f⁻¹ = -↑f⁻¹ ^ 2 * (d⁄dX R) ↑f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
| apply Derivation.leibniz_of_mul_eq_one | @[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
| Mathlib.RingTheory.PowerSeries.Derivative.150_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
case h
R : Type u_1
inst✝ : CommRing R
f : R⟦X⟧ˣ
⊢ ↑f⁻¹ * ↑f = 1 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
| simp | @[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
| Mathlib.RingTheory.PowerSeries.Derivative.150_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝¹ : CommRing R
f : R⟦X⟧
inst✝ : Invertible f
⊢ (d⁄dX R) ⅟f = -⅟f ^ 2 * (d⁄dX R) f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
| rw [Derivation.leibniz_invOf, smul_eq_mul] | @[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
| Mathlib.RingTheory.PowerSeries.Derivative.155_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : Field R
f : R⟦X⟧
⊢ (d⁄dX R) f⁻¹ = -f⁻¹ ^ 2 * (d⁄dX R) f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
rw [Derivation.leibniz_invOf, smul_eq_mul]
/-
The following theorem is stated only in the case that `R` is a field. This is because
there is currently no instance of `Inv R⟦X⟧` for more general base rings `R`.
-/
@[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
| by_cases h : constantCoeff R f = 0 | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
| Mathlib.RingTheory.PowerSeries.Derivative.163_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
case pos
R : Type u_1
inst✝ : Field R
f : R⟦X⟧
h : (constantCoeff R) f = 0
⊢ (d⁄dX R) f⁻¹ = -f⁻¹ ^ 2 * (d⁄dX R) f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
rw [Derivation.leibniz_invOf, smul_eq_mul]
/-
The following theorem is stated only in the case that `R` is a field. This is because
there is currently no instance of `Inv R⟦X⟧` for more general base rings `R`.
-/
@[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· | suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero] | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· | Mathlib.RingTheory.PowerSeries.Derivative.163_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝ : Field R
f : R⟦X⟧
h : (constantCoeff R) f = 0
this : f⁻¹ = 0
⊢ (d⁄dX R) f⁻¹ = -f⁻¹ ^ 2 * (d⁄dX R) f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
rw [Derivation.leibniz_invOf, smul_eq_mul]
/-
The following theorem is stated only in the case that `R` is a field. This is because
there is currently no instance of `Inv R⟦X⟧` for more general base rings `R`.
-/
@[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
| rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero] | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
| Mathlib.RingTheory.PowerSeries.Derivative.163_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
case pos
R : Type u_1
inst✝ : Field R
f : R⟦X⟧
h : (constantCoeff R) f = 0
⊢ f⁻¹ = 0 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
rw [Derivation.leibniz_invOf, smul_eq_mul]
/-
The following theorem is stated only in the case that `R` is a field. This is because
there is currently no instance of `Inv R⟦X⟧` for more general base rings `R`.
-/
@[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero]
| rwa [MvPowerSeries.inv_eq_zero] | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero]
| Mathlib.RingTheory.PowerSeries.Derivative.163_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
case neg
R : Type u_1
inst✝ : Field R
f : R⟦X⟧
h : ¬(constantCoeff R) f = 0
⊢ (d⁄dX R) f⁻¹ = -f⁻¹ ^ 2 * (d⁄dX R) f | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
rw [Derivation.leibniz_invOf, smul_eq_mul]
/-
The following theorem is stated only in the case that `R` is a field. This is because
there is currently no instance of `Inv R⟦X⟧` for more general base rings `R`.
-/
@[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero]
rwa [MvPowerSeries.inv_eq_zero]
| apply Derivation.leibniz_of_mul_eq_one | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero]
rwa [MvPowerSeries.inv_eq_zero]
| Mathlib.RingTheory.PowerSeries.Derivative.163_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
case neg.h
R : Type u_1
inst✝ : Field R
f : R⟦X⟧
h : ¬(constantCoeff R) f = 0
⊢ f⁻¹ * f = 1 | /-
Copyright (c) 2023 Richard M. Hill. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Richard M. Hill
-/
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Derivation.Basic
/-!
# Definitions
In this file we define an operation `derivative` (formal differentiation)
on the ring of formal power series in one variable (over an arbitrary commutative semiring).
Under suitable assumptions, we prove that two power series are equal if their derivatives
are equal and their constant terms are equal. This will give us a simple tool for proving
power series identities. For example, one can easily prove the power series identity
$\exp ( \log (1+X)) = 1+X$ by differentiating twice.
## Main Definition
- `PowerSeries.derivative R : Derivation R R⟦X⟧ R⟦X⟧` the formal derivative operation.
This is abbreviated `d⁄dX R`.
-/
namespace PowerSeries
open Polynomial Derivation Nat
section CommutativeSemiring
variable {R} [CommSemiring R]
/--
The formal derivative of a power series in one variable.
This is defined here as a function, but will be packaged as a
derivation `derivative` on `R⟦X⟧`.
-/
noncomputable def derivativeFun (f : R⟦X⟧) : R⟦X⟧ := mk λ n ↦ coeff R (n + 1) f * (n + 1)
theorem coeff_derivativeFun (f : R⟦X⟧) (n : ℕ) :
coeff R n f.derivativeFun = coeff R (n + 1) f * (n + 1) := by
rw [derivativeFun, coeff_mk]
theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f := by
ext
rw [coeff_derivativeFun, coeff_coe, coeff_coe, coeff_derivative]
theorem derivativeFun_add (f g : R⟦X⟧) :
derivativeFun (f + g) = derivativeFun f + derivativeFun g := by
ext
rw [coeff_derivativeFun, map_add, map_add, coeff_derivativeFun,
coeff_derivativeFun, add_mul]
theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0 := by
ext n
rw [coeff_derivativeFun, coeff_succ_C, zero_mul, map_zero]
theorem trunc_derivativeFun (f : R⟦X⟧) (n : ℕ) :
trunc n f.derivativeFun = derivative (trunc (n + 1) f) := by
ext d
rw [coeff_trunc]
split_ifs with h
· have : d + 1 < n + 1 := succ_lt_succ_iff.2 h
rw [coeff_derivativeFun, coeff_derivative, coeff_trunc, if_pos this]
· have : ¬d + 1 < n + 1 := by rwa [succ_lt_succ_iff]
rw [coeff_derivative, coeff_trunc, if_neg this, zero_mul]
--A special case of `derivativeFun_mul`, used in its proof.
private theorem derivativeFun_coe_mul_coe (f g : R[X]) : derivativeFun (f * g : R⟦X⟧) =
f * derivative g + g * derivative f := by
rw [← coe_mul, derivativeFun_coe, derivative_mul,
add_comm, mul_comm _ g, ← coe_mul, ← coe_mul, Polynomial.coe_add]
/-- **Leibniz rule for formal power series**.-/
theorem derivativeFun_mul (f g : R⟦X⟧) :
derivativeFun (f * g) = f • g.derivativeFun + g • f.derivativeFun := by
ext n
have h₁ : n < n + 1 := lt_succ_self n
have h₂ : n < n + 1 + 1 := Nat.lt_add_right _ h₁
rw [coeff_derivativeFun, map_add, coeff_mul_eq_coeff_trunc_mul_trunc _ _ (lt_succ_self _),
smul_eq_mul, smul_eq_mul, coeff_mul_eq_coeff_trunc_mul_trunc₂ g f.derivativeFun h₂ h₁,
coeff_mul_eq_coeff_trunc_mul_trunc₂ f g.derivativeFun h₂ h₁, trunc_derivativeFun,
trunc_derivativeFun, ← map_add, ← derivativeFun_coe_mul_coe, coeff_derivativeFun]
theorem derivativeFun_one : derivativeFun (1 : R⟦X⟧) = 0 := by
rw [← map_one (C R), derivativeFun_C (1 : R)]
theorem derivativeFun_smul (r : R) (f : R⟦X⟧) : derivativeFun (r • f) = r • derivativeFun f := by
rw [smul_eq_C_mul, smul_eq_C_mul, derivativeFun_mul, derivativeFun_C, smul_zero, add_zero,
smul_eq_mul]
variable (R)
/--The formal derivative of a formal power series.-/
noncomputable def derivative : Derivation R R⟦X⟧ R⟦X⟧ where
toFun := derivativeFun
map_add' := derivativeFun_add
map_smul' := derivativeFun_smul
map_one_eq_zero' := derivativeFun_one
leibniz' := derivativeFun_mul
/--Abbreviation of `PowerSeries.derivative`, the formal derivative on `R⟦X⟧`.-/
scoped notation "d⁄dX" => derivative
variable {R}
@[simp] theorem derivative_C (r : R) : d⁄dX R (C R r) = 0 := derivativeFun_C r
theorem coeff_derivative (f : R⟦X⟧) (n : ℕ) :
coeff R n (d⁄dX R f) = coeff R (n + 1) f * (n + 1) := coeff_derivativeFun f n
theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f := derivativeFun_coe f
@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1 := by
ext
rw [coeff_derivative, coeff_one, coeff_X, boole_mul]
simp_rw [add_left_eq_self]
split_ifs with h
· rw [h, cast_zero, zero_add]
· rfl
theorem trunc_derivative (f : R⟦X⟧) (n : ℕ) :
trunc n (d⁄dX R f) = Polynomial.derivative (trunc (n + 1) f) :=
trunc_derivativeFun ..
theorem trunc_derivative' (f : R⟦X⟧) (n : ℕ) :
trunc (n-1) (d⁄dX R f) = Polynomial.derivative (trunc n f) := by
cases n with
| zero =>
simp
| succ n =>
rw [succ_sub_one, trunc_derivative]
end CommutativeSemiring
/-In the next lemma, we use `smul_right_inj`, which requires not only `NoZeroSMulDivisors ℕ R`, but
also cancellation of addition in `R`. For this reason, the next lemma is stated in the case that `R`
is a `CommRing`.-/
/-- If `f` and `g` have the same constant term and derivative, then they are equal.-/
theorem derivative.ext {R} [CommRing R] [NoZeroSMulDivisors ℕ R] {f g} (hD : d⁄dX R f = d⁄dX R g)
(hc : constantCoeff R f = constantCoeff R g) : f = g := by
ext n
cases n with
| zero =>
rw [coeff_zero_eq_constantCoeff, hc]
| succ n =>
have equ : coeff R n (d⁄dX R f) = coeff R n (d⁄dX R g) := by rw [hD]
rwa [coeff_derivative, coeff_derivative, ← cast_succ, mul_comm, ← nsmul_eq_mul,
mul_comm, ← nsmul_eq_mul, smul_right_inj n.succ_ne_zero] at equ
@[simp] theorem derivative_inv {R} [CommRing R] (f : R⟦X⟧ˣ) :
d⁄dX R ↑f⁻¹ = -(↑f⁻¹ : R⟦X⟧) ^ 2 * d⁄dX R f := by
apply Derivation.leibniz_of_mul_eq_one
simp
@[simp] theorem derivative_invOf {R} [CommRing R] (f : R⟦X⟧) [Invertible f] :
d⁄dX R ⅟f = - ⅟f ^ 2 * d⁄dX R f := by
rw [Derivation.leibniz_invOf, smul_eq_mul]
/-
The following theorem is stated only in the case that `R` is a field. This is because
there is currently no instance of `Inv R⟦X⟧` for more general base rings `R`.
-/
@[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero]
rwa [MvPowerSeries.inv_eq_zero]
apply Derivation.leibniz_of_mul_eq_one
| exact PowerSeries.inv_mul_cancel (h := h) | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f := by
by_cases h : constantCoeff R f = 0
· suffices f⁻¹ = 0 by
rw [this, pow_two, zero_mul, neg_zero, zero_mul, map_zero]
rwa [MvPowerSeries.inv_eq_zero]
apply Derivation.leibniz_of_mul_eq_one
| Mathlib.RingTheory.PowerSeries.Derivative.163_0.PcMDeT7Qkkrj2IE | @[simp] theorem derivative_inv' {R} [Field R] (f : R⟦X⟧) : d⁄dX R f⁻¹ = -f⁻¹ ^ 2 * d⁄dX R f | Mathlib_RingTheory_PowerSeries_Derivative |
R : Type u_1
inst✝² : CommRing R
A : Type u_2
inst✝¹ : CommRing A
inst✝ : Algebra R A
D D1✝ D2✝ : Derivation R A A
a✝ : A
D1 D2 : Derivation R A A
a b : A
⊢ ⁅↑D1, ↑D2⁆ (a * b) = a • ⁅↑D1, ↑D2⁆ b + b • ⁅↑D1, ↑D2⁆ a | /-
Copyright © 2020 Nicolò Cavalleri. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nicolò Cavalleri, Andrew Yang
-/
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.RingTheory.Derivation.Basic
#align_import ring_theory.derivation.lie from "leanprover-community/mathlib"@"b608348ffaeb7f557f2fd46876037abafd326ff3"
/-!
# Results
- `Derivation.instLieAlgebra`: The `R`-derivations from `A` to `A` form a Lie algebra over `R`.
-/
namespace Derivation
variable {R : Type*} [CommRing R]
variable {A : Type*} [CommRing A] [Algebra R A]
variable (D : Derivation R A A) {D1 D2 : Derivation R A A} (a : A)
section LieStructures
/-! # Lie structures -/
/-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) :=
⟨fun D1 D2 =>
mk' ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ fun a b => by
| simp only [Ring.lie_def, map_add, Algebra.id.smul_eq_mul, LinearMap.mul_apply, leibniz,
coeFn_coe, LinearMap.sub_apply] | /-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) :=
⟨fun D1 D2 =>
mk' ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ fun a b => by
| Mathlib.RingTheory.Derivation.Lie.32_0.lftH2oDc0WOWKWo | /-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) | Mathlib_RingTheory_Derivation_Lie |
R : Type u_1
inst✝² : CommRing R
A : Type u_2
inst✝¹ : CommRing A
inst✝ : Algebra R A
D D1✝ D2✝ : Derivation R A A
a✝ : A
D1 D2 : Derivation R A A
a b : A
⊢ a * D1 (D2 b) + D2 b * D1 a + (b * D1 (D2 a) + D2 a * D1 b) -
(a * D2 (D1 b) + D1 b * D2 a + (b * D2 (D1 a) + D1 a * D2 b)) =
a * (D1 (D2 b) - D2 (D1 b)) + b * (D1 (D2 a) - D2 (D1 a)) | /-
Copyright © 2020 Nicolò Cavalleri. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nicolò Cavalleri, Andrew Yang
-/
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.RingTheory.Derivation.Basic
#align_import ring_theory.derivation.lie from "leanprover-community/mathlib"@"b608348ffaeb7f557f2fd46876037abafd326ff3"
/-!
# Results
- `Derivation.instLieAlgebra`: The `R`-derivations from `A` to `A` form a Lie algebra over `R`.
-/
namespace Derivation
variable {R : Type*} [CommRing R]
variable {A : Type*} [CommRing A] [Algebra R A]
variable (D : Derivation R A A) {D1 D2 : Derivation R A A} (a : A)
section LieStructures
/-! # Lie structures -/
/-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) :=
⟨fun D1 D2 =>
mk' ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ fun a b => by
simp only [Ring.lie_def, map_add, Algebra.id.smul_eq_mul, LinearMap.mul_apply, leibniz,
coeFn_coe, LinearMap.sub_apply]
| ring | /-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) :=
⟨fun D1 D2 =>
mk' ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ fun a b => by
simp only [Ring.lie_def, map_add, Algebra.id.smul_eq_mul, LinearMap.mul_apply, leibniz,
coeFn_coe, LinearMap.sub_apply]
| Mathlib.RingTheory.Derivation.Lie.32_0.lftH2oDc0WOWKWo | /-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) | Mathlib_RingTheory_Derivation_Lie |
R : Type u_1
inst✝² : CommRing R
A : Type u_2
inst✝¹ : CommRing A
inst✝ : Algebra R A
D D1 D2 : Derivation R A A
a : A
d e f : Derivation R A A
⊢ ⁅d + e, f⁆ = ⁅d, f⁆ + ⁅e, f⁆ | /-
Copyright © 2020 Nicolò Cavalleri. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nicolò Cavalleri, Andrew Yang
-/
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.RingTheory.Derivation.Basic
#align_import ring_theory.derivation.lie from "leanprover-community/mathlib"@"b608348ffaeb7f557f2fd46876037abafd326ff3"
/-!
# Results
- `Derivation.instLieAlgebra`: The `R`-derivations from `A` to `A` form a Lie algebra over `R`.
-/
namespace Derivation
variable {R : Type*} [CommRing R]
variable {A : Type*} [CommRing A] [Algebra R A]
variable (D : Derivation R A A) {D1 D2 : Derivation R A A} (a : A)
section LieStructures
/-! # Lie structures -/
/-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) :=
⟨fun D1 D2 =>
mk' ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ fun a b => by
simp only [Ring.lie_def, map_add, Algebra.id.smul_eq_mul, LinearMap.mul_apply, leibniz,
coeFn_coe, LinearMap.sub_apply]
ring⟩
@[simp]
theorem commutator_coe_linear_map : ↑⁅D1, D2⁆ = ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ :=
rfl
#align derivation.commutator_coe_linear_map Derivation.commutator_coe_linear_map
theorem commutator_apply : ⁅D1, D2⁆ a = D1 (D2 a) - D2 (D1 a) :=
rfl
#align derivation.commutator_apply Derivation.commutator_apply
instance : LieRing (Derivation R A A) where
add_lie d e f := by | ext a | instance : LieRing (Derivation R A A) where
add_lie d e f := by | Mathlib.RingTheory.Derivation.Lie.49_0.lftH2oDc0WOWKWo | instance : LieRing (Derivation R A A) where
add_lie d e f | Mathlib_RingTheory_Derivation_Lie |
case H
R : Type u_1
inst✝² : CommRing R
A : Type u_2
inst✝¹ : CommRing A
inst✝ : Algebra R A
D D1 D2 : Derivation R A A
a✝ : A
d e f : Derivation R A A
a : A
⊢ ⁅d + e, f⁆ a = (⁅d, f⁆ + ⁅e, f⁆) a | /-
Copyright © 2020 Nicolò Cavalleri. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nicolò Cavalleri, Andrew Yang
-/
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.RingTheory.Derivation.Basic
#align_import ring_theory.derivation.lie from "leanprover-community/mathlib"@"b608348ffaeb7f557f2fd46876037abafd326ff3"
/-!
# Results
- `Derivation.instLieAlgebra`: The `R`-derivations from `A` to `A` form a Lie algebra over `R`.
-/
namespace Derivation
variable {R : Type*} [CommRing R]
variable {A : Type*} [CommRing A] [Algebra R A]
variable (D : Derivation R A A) {D1 D2 : Derivation R A A} (a : A)
section LieStructures
/-! # Lie structures -/
/-- The commutator of derivations is again a derivation. -/
instance : Bracket (Derivation R A A) (Derivation R A A) :=
⟨fun D1 D2 =>
mk' ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ fun a b => by
simp only [Ring.lie_def, map_add, Algebra.id.smul_eq_mul, LinearMap.mul_apply, leibniz,
coeFn_coe, LinearMap.sub_apply]
ring⟩
@[simp]
theorem commutator_coe_linear_map : ↑⁅D1, D2⁆ = ⁅(D1 : Module.End R A), (D2 : Module.End R A)⁆ :=
rfl
#align derivation.commutator_coe_linear_map Derivation.commutator_coe_linear_map
theorem commutator_apply : ⁅D1, D2⁆ a = D1 (D2 a) - D2 (D1 a) :=
rfl
#align derivation.commutator_apply Derivation.commutator_apply
instance : LieRing (Derivation R A A) where
add_lie d e f := by ext a; | simp only [commutator_apply, add_apply, map_add] | instance : LieRing (Derivation R A A) where
add_lie d e f := by ext a; | Mathlib.RingTheory.Derivation.Lie.49_0.lftH2oDc0WOWKWo | instance : LieRing (Derivation R A A) where
add_lie d e f | Mathlib_RingTheory_Derivation_Lie |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.