Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
rank
int64
0
2.4k
import Mathlib.Algebra.CharP.Invertible import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Analysis.Normed.Group.AddTorsor import Mathlib.Analysis.NormedSpace.Basic import Mathlib.LinearAlgebra.AffineSpace.Restrict import Mathlib.Tactic.FailIfNoProgress #align_import analysis.normed_space.affine_isometry from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open Function Set variable (π•œ : Type*) {V V₁ V₁' Vβ‚‚ V₃ Vβ‚„ : Type*} {P₁ P₁' : Type*} (P Pβ‚‚ : Type*) {P₃ Pβ‚„ : Type*} [NormedField π•œ] [SeminormedAddCommGroup V] [NormedSpace π•œ V] [PseudoMetricSpace P] [NormedAddTorsor V P] [SeminormedAddCommGroup V₁] [NormedSpace π•œ V₁] [PseudoMetricSpace P₁] [NormedAddTorsor V₁ P₁] [SeminormedAddCommGroup V₁'] [NormedSpace π•œ V₁'] [MetricSpace P₁'] [NormedAddTorsor V₁' P₁'] [SeminormedAddCommGroup Vβ‚‚] [NormedSpace π•œ Vβ‚‚] [PseudoMetricSpace Pβ‚‚] [NormedAddTorsor Vβ‚‚ Pβ‚‚] [SeminormedAddCommGroup V₃] [NormedSpace π•œ V₃] [PseudoMetricSpace P₃] [NormedAddTorsor V₃ P₃] [SeminormedAddCommGroup Vβ‚„] [NormedSpace π•œ Vβ‚„] [PseudoMetricSpace Pβ‚„] [NormedAddTorsor Vβ‚„ Pβ‚„] structure AffineIsometry extends P →ᡃ[π•œ] Pβ‚‚ where norm_map : βˆ€ x : V, β€–linear xβ€– = β€–xβ€– #align affine_isometry AffineIsometry variable {π•œ P Pβ‚‚} @[inherit_doc] notation:25 -- `→ᡃᡒ` would be more consistent with the linear isometry notation, but it is uglier P " →ᡃⁱ[" π•œ:25 "] " Pβ‚‚:0 => AffineIsometry π•œ P Pβ‚‚ variable (π•œ P Pβ‚‚) structure AffineIsometryEquiv extends P ≃ᡃ[π•œ] Pβ‚‚ where norm_map : βˆ€ x, β€–linear xβ€– = β€–xβ€– #align affine_isometry_equiv AffineIsometryEquiv variable {π•œ P Pβ‚‚} -- `≃ᡃᡒ` would be more consistent with the linear isometry equiv notation, but it is uglier notation:25 P " ≃ᡃⁱ[" π•œ:25 "] " Pβ‚‚:0 => AffineIsometryEquiv π•œ P Pβ‚‚ namespace AffineIsometryEquiv variable (e : P ≃ᡃⁱ[π•œ] Pβ‚‚) protected def linearIsometryEquiv : V ≃ₗᡒ[π•œ] Vβ‚‚ := { e.linear with norm_map' := e.norm_map } #align affine_isometry_equiv.linear_isometry_equiv AffineIsometryEquiv.linearIsometryEquiv @[simp]
Mathlib/Analysis/NormedSpace/AffineIsometry.lean
329
331
theorem linear_eq_linear_isometry : e.linear = e.linearIsometryEquiv.toLinearEquiv := by
ext rfl
1,634
import Mathlib.Topology.Instances.RealVectorSpace import Mathlib.Analysis.NormedSpace.AffineIsometry #align_import analysis.normed_space.mazur_ulam from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733" variable {E PE F PF : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MetricSpace PE] [NormedAddTorsor E PE] [NormedAddCommGroup F] [NormedSpace ℝ F] [MetricSpace PF] [NormedAddTorsor F PF] open Set AffineMap AffineIsometryEquiv noncomputable section namespace IsometryEquiv
Mathlib/Analysis/NormedSpace/MazurUlam.lean
45
83
theorem midpoint_fixed {x y : PE} : βˆ€ e : PE ≃ᡒ PE, e x = x β†’ e y = y β†’ e (midpoint ℝ x y) = midpoint ℝ x y := by
set z := midpoint ℝ x y -- Consider the set of `e : E ≃ᡒ E` such that `e x = x` and `e y = y` set s := { e : PE ≃ᡒ PE | e x = x ∧ e y = y } haveI : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩ -- On the one hand, `e` cannot send the midpoint `z` of `[x, y]` too far have h_bdd : BddAbove (range fun e : s => dist ((e : PE ≃ᡒ PE) z) z) := by refine ⟨dist x z + dist x z, forall_mem_range.2 <| Subtype.forall.2 ?_⟩ rintro e ⟨hx, _⟩ calc dist (e z) z ≀ dist (e z) x + dist x z := dist_triangle (e z) x z _ = dist (e x) (e z) + dist x z := by rw [hx, dist_comm] _ = dist x z + dist x z := by erw [e.dist_eq x z] -- On the other hand, consider the map `f : (E ≃ᡒ E) β†’ (E ≃ᡒ E)` -- sending each `e` to `R ∘ e⁻¹ ∘ R ∘ e`, where `R` is the point reflection in the -- midpoint `z` of `[x, y]`. set R : PE ≃ᡒ PE := (pointReflection ℝ z).toIsometryEquiv set f : PE ≃ᡒ PE β†’ PE ≃ᡒ PE := fun e => ((e.trans R).trans e.symm).trans R -- Note that `f` doubles the value of `dist (e z) z` have hf_dist : βˆ€ e, dist (f e z) z = 2 * dist (e z) z := by intro e dsimp [f, R] rw [dist_pointReflection_fixed, ← e.dist_eq, e.apply_symm_apply, dist_pointReflection_self_real, dist_comm] -- Also note that `f` maps `s` to itself have hf_maps_to : MapsTo f s s := by rintro e ⟨hx, hy⟩ constructor <;> simp [f, R, z, hx, hy, e.symm_apply_eq.2 hx.symm, e.symm_apply_eq.2 hy.symm] -- Therefore, `dist (e z) z = 0` for all `e ∈ s`. set c := ⨆ e : s, dist ((e : PE ≃ᡒ PE) z) z have : c ≀ c / 2 := by apply ciSup_le rintro ⟨e, he⟩ simp only [Subtype.coe_mk, le_div_iff' (zero_lt_two' ℝ), ← hf_dist] exact le_ciSup h_bdd ⟨f e, hf_maps_to he⟩ replace : c ≀ 0 := by linarith refine fun e hx hy => dist_le_zero.1 (le_trans ?_ this) exact le_ciSup h_bdd ⟨e, hx, hy⟩
1,635
import Mathlib.Topology.Instances.RealVectorSpace import Mathlib.Analysis.NormedSpace.AffineIsometry #align_import analysis.normed_space.mazur_ulam from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733" variable {E PE F PF : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MetricSpace PE] [NormedAddTorsor E PE] [NormedAddCommGroup F] [NormedSpace ℝ F] [MetricSpace PF] [NormedAddTorsor F PF] open Set AffineMap AffineIsometryEquiv noncomputable section namespace IsometryEquiv theorem midpoint_fixed {x y : PE} : βˆ€ e : PE ≃ᡒ PE, e x = x β†’ e y = y β†’ e (midpoint ℝ x y) = midpoint ℝ x y := by set z := midpoint ℝ x y -- Consider the set of `e : E ≃ᡒ E` such that `e x = x` and `e y = y` set s := { e : PE ≃ᡒ PE | e x = x ∧ e y = y } haveI : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩ -- On the one hand, `e` cannot send the midpoint `z` of `[x, y]` too far have h_bdd : BddAbove (range fun e : s => dist ((e : PE ≃ᡒ PE) z) z) := by refine ⟨dist x z + dist x z, forall_mem_range.2 <| Subtype.forall.2 ?_⟩ rintro e ⟨hx, _⟩ calc dist (e z) z ≀ dist (e z) x + dist x z := dist_triangle (e z) x z _ = dist (e x) (e z) + dist x z := by rw [hx, dist_comm] _ = dist x z + dist x z := by erw [e.dist_eq x z] -- On the other hand, consider the map `f : (E ≃ᡒ E) β†’ (E ≃ᡒ E)` -- sending each `e` to `R ∘ e⁻¹ ∘ R ∘ e`, where `R` is the point reflection in the -- midpoint `z` of `[x, y]`. set R : PE ≃ᡒ PE := (pointReflection ℝ z).toIsometryEquiv set f : PE ≃ᡒ PE β†’ PE ≃ᡒ PE := fun e => ((e.trans R).trans e.symm).trans R -- Note that `f` doubles the value of `dist (e z) z` have hf_dist : βˆ€ e, dist (f e z) z = 2 * dist (e z) z := by intro e dsimp [f, R] rw [dist_pointReflection_fixed, ← e.dist_eq, e.apply_symm_apply, dist_pointReflection_self_real, dist_comm] -- Also note that `f` maps `s` to itself have hf_maps_to : MapsTo f s s := by rintro e ⟨hx, hy⟩ constructor <;> simp [f, R, z, hx, hy, e.symm_apply_eq.2 hx.symm, e.symm_apply_eq.2 hy.symm] -- Therefore, `dist (e z) z = 0` for all `e ∈ s`. set c := ⨆ e : s, dist ((e : PE ≃ᡒ PE) z) z have : c ≀ c / 2 := by apply ciSup_le rintro ⟨e, he⟩ simp only [Subtype.coe_mk, le_div_iff' (zero_lt_two' ℝ), ← hf_dist] exact le_ciSup h_bdd ⟨f e, hf_maps_to he⟩ replace : c ≀ 0 := by linarith refine fun e hx hy => dist_le_zero.1 (le_trans ?_ this) exact le_ciSup h_bdd ⟨e, hx, hy⟩ #align isometry_equiv.midpoint_fixed IsometryEquiv.midpoint_fixed
Mathlib/Analysis/NormedSpace/MazurUlam.lean
87
96
theorem map_midpoint (f : PE ≃ᡒ PF) (x y : PE) : f (midpoint ℝ x y) = midpoint ℝ (f x) (f y) := by
set e : PE ≃ᡒ PE := ((f.trans <| (pointReflection ℝ <| midpoint ℝ (f x) (f y)).toIsometryEquiv).trans f.symm).trans (pointReflection ℝ <| midpoint ℝ x y).toIsometryEquiv have hx : e x = x := by simp [e] have hy : e y = y := by simp [e] have hm := e.midpoint_fixed hx hy simp only [e, trans_apply] at hm rwa [← eq_symm_apply, toIsometryEquiv_symm, pointReflection_symm, coe_toIsometryEquiv, coe_toIsometryEquiv, pointReflection_self, symm_apply_eq, @pointReflection_fixed_iff] at hm
1,635
import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Topology.Algebra.ContinuousAffineMap import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace #align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" namespace ContinuousAffineMap variable {π•œ R V W Wβ‚‚ P Q Qβ‚‚ : Type*} variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P] variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q] variable [NormedAddCommGroup Wβ‚‚] [MetricSpace Qβ‚‚] [NormedAddTorsor Wβ‚‚ Qβ‚‚] variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ‚‚] variable [NontriviallyNormedField π•œ] [NormedSpace π•œ V] [NormedSpace π•œ W] [NormedSpace π•œ Wβ‚‚] def contLinear (f : P →ᴬ[R] Q) : V β†’L[R] W := { f.linear with toFun := f.linear cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont } #align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear @[simp] theorem coe_contLinear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear @[simp]
Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean
66
67
theorem coe_contLinear_eq_linear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’β‚—[R] W) = (f : P →ᡃ[R] Q).linear := by
ext; rfl
1,636
import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Topology.Algebra.ContinuousAffineMap import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace #align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" namespace ContinuousAffineMap variable {π•œ R V W Wβ‚‚ P Q Qβ‚‚ : Type*} variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P] variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q] variable [NormedAddCommGroup Wβ‚‚] [MetricSpace Qβ‚‚] [NormedAddTorsor Wβ‚‚ Qβ‚‚] variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ‚‚] variable [NontriviallyNormedField π•œ] [NormedSpace π•œ V] [NormedSpace π•œ W] [NormedSpace π•œ Wβ‚‚] def contLinear (f : P →ᴬ[R] Q) : V β†’L[R] W := { f.linear with toFun := f.linear cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont } #align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear @[simp] theorem coe_contLinear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear @[simp] theorem coe_contLinear_eq_linear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’β‚—[R] W) = (f : P →ᡃ[R] Q).linear := by ext; rfl #align continuous_affine_map.coe_cont_linear_eq_linear ContinuousAffineMap.coe_contLinear_eq_linear @[simp] theorem coe_mk_const_linear_eq_linear (f : P →ᡃ[R] Q) (h) : ((⟨f, h⟩ : P →ᴬ[R] Q).contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_mk_const_linear_eq_linear ContinuousAffineMap.coe_mk_const_linear_eq_linear theorem coe_linear_eq_coe_contLinear (f : P →ᴬ[R] Q) : ((f : P →ᡃ[R] Q).linear : V β†’ W) = (⇑f.contLinear : V β†’ W) := rfl #align continuous_affine_map.coe_linear_eq_coe_cont_linear ContinuousAffineMap.coe_linear_eq_coe_contLinear @[simp] theorem comp_contLinear (f : P →ᴬ[R] Q) (g : Q →ᴬ[R] Qβ‚‚) : (g.comp f).contLinear = g.contLinear.comp f.contLinear := rfl #align continuous_affine_map.comp_cont_linear ContinuousAffineMap.comp_contLinear @[simp] theorem map_vadd (f : P →ᴬ[R] Q) (p : P) (v : V) : f (v +α΅₯ p) = f.contLinear v +α΅₯ f p := f.map_vadd' p v #align continuous_affine_map.map_vadd ContinuousAffineMap.map_vadd @[simp] theorem contLinear_map_vsub (f : P →ᴬ[R] Q) (p₁ pβ‚‚ : P) : f.contLinear (p₁ -α΅₯ pβ‚‚) = f p₁ -α΅₯ f pβ‚‚ := f.toAffineMap.linearMap_vsub p₁ pβ‚‚ #align continuous_affine_map.cont_linear_map_vsub ContinuousAffineMap.contLinear_map_vsub @[simp] theorem const_contLinear (q : Q) : (const R P q).contLinear = 0 := rfl #align continuous_affine_map.const_cont_linear ContinuousAffineMap.const_contLinear
Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean
102
114
theorem contLinear_eq_zero_iff_exists_const (f : P →ᴬ[R] Q) : f.contLinear = 0 ↔ βˆƒ q, f = const R P q := by
have h₁ : f.contLinear = 0 ↔ (f : P →ᡃ[R] Q).linear = 0 := by refine ⟨fun h => ?_, fun h => ?_⟩ <;> ext Β· rw [← coe_contLinear_eq_linear, h]; rfl Β· rw [← coe_linear_eq_coe_contLinear, h]; rfl have hβ‚‚ : βˆ€ q : Q, f = const R P q ↔ (f : P →ᡃ[R] Q) = AffineMap.const R P q := by intro q refine ⟨fun h => ?_, fun h => ?_⟩ <;> ext Β· rw [h]; rfl Β· rw [← coe_to_affineMap, h]; rfl simp_rw [h₁, hβ‚‚] exact (f : P →ᡃ[R] Q).linear_eq_zero_iff_exists_const
1,636
import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Topology.Algebra.ContinuousAffineMap import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace #align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" namespace ContinuousAffineMap variable {π•œ R V W Wβ‚‚ P Q Qβ‚‚ : Type*} variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P] variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q] variable [NormedAddCommGroup Wβ‚‚] [MetricSpace Qβ‚‚] [NormedAddTorsor Wβ‚‚ Qβ‚‚] variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ‚‚] variable [NontriviallyNormedField π•œ] [NormedSpace π•œ V] [NormedSpace π•œ W] [NormedSpace π•œ Wβ‚‚] def contLinear (f : P →ᴬ[R] Q) : V β†’L[R] W := { f.linear with toFun := f.linear cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont } #align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear @[simp] theorem coe_contLinear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear @[simp] theorem coe_contLinear_eq_linear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’β‚—[R] W) = (f : P →ᡃ[R] Q).linear := by ext; rfl #align continuous_affine_map.coe_cont_linear_eq_linear ContinuousAffineMap.coe_contLinear_eq_linear @[simp] theorem coe_mk_const_linear_eq_linear (f : P →ᡃ[R] Q) (h) : ((⟨f, h⟩ : P →ᴬ[R] Q).contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_mk_const_linear_eq_linear ContinuousAffineMap.coe_mk_const_linear_eq_linear theorem coe_linear_eq_coe_contLinear (f : P →ᴬ[R] Q) : ((f : P →ᡃ[R] Q).linear : V β†’ W) = (⇑f.contLinear : V β†’ W) := rfl #align continuous_affine_map.coe_linear_eq_coe_cont_linear ContinuousAffineMap.coe_linear_eq_coe_contLinear @[simp] theorem comp_contLinear (f : P →ᴬ[R] Q) (g : Q →ᴬ[R] Qβ‚‚) : (g.comp f).contLinear = g.contLinear.comp f.contLinear := rfl #align continuous_affine_map.comp_cont_linear ContinuousAffineMap.comp_contLinear @[simp] theorem map_vadd (f : P →ᴬ[R] Q) (p : P) (v : V) : f (v +α΅₯ p) = f.contLinear v +α΅₯ f p := f.map_vadd' p v #align continuous_affine_map.map_vadd ContinuousAffineMap.map_vadd @[simp] theorem contLinear_map_vsub (f : P →ᴬ[R] Q) (p₁ pβ‚‚ : P) : f.contLinear (p₁ -α΅₯ pβ‚‚) = f p₁ -α΅₯ f pβ‚‚ := f.toAffineMap.linearMap_vsub p₁ pβ‚‚ #align continuous_affine_map.cont_linear_map_vsub ContinuousAffineMap.contLinear_map_vsub @[simp] theorem const_contLinear (q : Q) : (const R P q).contLinear = 0 := rfl #align continuous_affine_map.const_cont_linear ContinuousAffineMap.const_contLinear theorem contLinear_eq_zero_iff_exists_const (f : P →ᴬ[R] Q) : f.contLinear = 0 ↔ βˆƒ q, f = const R P q := by have h₁ : f.contLinear = 0 ↔ (f : P →ᡃ[R] Q).linear = 0 := by refine ⟨fun h => ?_, fun h => ?_⟩ <;> ext Β· rw [← coe_contLinear_eq_linear, h]; rfl Β· rw [← coe_linear_eq_coe_contLinear, h]; rfl have hβ‚‚ : βˆ€ q : Q, f = const R P q ↔ (f : P →ᡃ[R] Q) = AffineMap.const R P q := by intro q refine ⟨fun h => ?_, fun h => ?_⟩ <;> ext Β· rw [h]; rfl Β· rw [← coe_to_affineMap, h]; rfl simp_rw [h₁, hβ‚‚] exact (f : P →ᡃ[R] Q).linear_eq_zero_iff_exists_const #align continuous_affine_map.cont_linear_eq_zero_iff_exists_const ContinuousAffineMap.contLinear_eq_zero_iff_exists_const @[simp]
Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean
118
120
theorem to_affine_map_contLinear (f : V β†’L[R] W) : f.toContinuousAffineMap.contLinear = f := by
ext rfl
1,636
import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Topology.Algebra.ContinuousAffineMap import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace #align_import analysis.normed_space.continuous_affine_map from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" namespace ContinuousAffineMap variable {π•œ R V W Wβ‚‚ P Q Qβ‚‚ : Type*} variable [NormedAddCommGroup V] [MetricSpace P] [NormedAddTorsor V P] variable [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q] variable [NormedAddCommGroup Wβ‚‚] [MetricSpace Qβ‚‚] [NormedAddTorsor Wβ‚‚ Qβ‚‚] variable [NormedField R] [NormedSpace R V] [NormedSpace R W] [NormedSpace R Wβ‚‚] variable [NontriviallyNormedField π•œ] [NormedSpace π•œ V] [NormedSpace π•œ W] [NormedSpace π•œ Wβ‚‚] def contLinear (f : P →ᴬ[R] Q) : V β†’L[R] W := { f.linear with toFun := f.linear cont := by rw [AffineMap.continuous_linear_iff]; exact f.cont } #align continuous_affine_map.cont_linear ContinuousAffineMap.contLinear @[simp] theorem coe_contLinear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_cont_linear ContinuousAffineMap.coe_contLinear @[simp] theorem coe_contLinear_eq_linear (f : P →ᴬ[R] Q) : (f.contLinear : V β†’β‚—[R] W) = (f : P →ᡃ[R] Q).linear := by ext; rfl #align continuous_affine_map.coe_cont_linear_eq_linear ContinuousAffineMap.coe_contLinear_eq_linear @[simp] theorem coe_mk_const_linear_eq_linear (f : P →ᡃ[R] Q) (h) : ((⟨f, h⟩ : P →ᴬ[R] Q).contLinear : V β†’ W) = f.linear := rfl #align continuous_affine_map.coe_mk_const_linear_eq_linear ContinuousAffineMap.coe_mk_const_linear_eq_linear theorem coe_linear_eq_coe_contLinear (f : P →ᴬ[R] Q) : ((f : P →ᡃ[R] Q).linear : V β†’ W) = (⇑f.contLinear : V β†’ W) := rfl #align continuous_affine_map.coe_linear_eq_coe_cont_linear ContinuousAffineMap.coe_linear_eq_coe_contLinear @[simp] theorem comp_contLinear (f : P →ᴬ[R] Q) (g : Q →ᴬ[R] Qβ‚‚) : (g.comp f).contLinear = g.contLinear.comp f.contLinear := rfl #align continuous_affine_map.comp_cont_linear ContinuousAffineMap.comp_contLinear @[simp] theorem map_vadd (f : P →ᴬ[R] Q) (p : P) (v : V) : f (v +α΅₯ p) = f.contLinear v +α΅₯ f p := f.map_vadd' p v #align continuous_affine_map.map_vadd ContinuousAffineMap.map_vadd @[simp] theorem contLinear_map_vsub (f : P →ᴬ[R] Q) (p₁ pβ‚‚ : P) : f.contLinear (p₁ -α΅₯ pβ‚‚) = f p₁ -α΅₯ f pβ‚‚ := f.toAffineMap.linearMap_vsub p₁ pβ‚‚ #align continuous_affine_map.cont_linear_map_vsub ContinuousAffineMap.contLinear_map_vsub @[simp] theorem const_contLinear (q : Q) : (const R P q).contLinear = 0 := rfl #align continuous_affine_map.const_cont_linear ContinuousAffineMap.const_contLinear theorem contLinear_eq_zero_iff_exists_const (f : P →ᴬ[R] Q) : f.contLinear = 0 ↔ βˆƒ q, f = const R P q := by have h₁ : f.contLinear = 0 ↔ (f : P →ᡃ[R] Q).linear = 0 := by refine ⟨fun h => ?_, fun h => ?_⟩ <;> ext Β· rw [← coe_contLinear_eq_linear, h]; rfl Β· rw [← coe_linear_eq_coe_contLinear, h]; rfl have hβ‚‚ : βˆ€ q : Q, f = const R P q ↔ (f : P →ᡃ[R] Q) = AffineMap.const R P q := by intro q refine ⟨fun h => ?_, fun h => ?_⟩ <;> ext Β· rw [h]; rfl Β· rw [← coe_to_affineMap, h]; rfl simp_rw [h₁, hβ‚‚] exact (f : P →ᡃ[R] Q).linear_eq_zero_iff_exists_const #align continuous_affine_map.cont_linear_eq_zero_iff_exists_const ContinuousAffineMap.contLinear_eq_zero_iff_exists_const @[simp] theorem to_affine_map_contLinear (f : V β†’L[R] W) : f.toContinuousAffineMap.contLinear = f := by ext rfl #align continuous_affine_map.to_affine_map_cont_linear ContinuousAffineMap.to_affine_map_contLinear @[simp] theorem zero_contLinear : (0 : P →ᴬ[R] W).contLinear = 0 := rfl #align continuous_affine_map.zero_cont_linear ContinuousAffineMap.zero_contLinear @[simp] theorem add_contLinear (f g : P →ᴬ[R] W) : (f + g).contLinear = f.contLinear + g.contLinear := rfl #align continuous_affine_map.add_cont_linear ContinuousAffineMap.add_contLinear @[simp] theorem sub_contLinear (f g : P →ᴬ[R] W) : (f - g).contLinear = f.contLinear - g.contLinear := rfl #align continuous_affine_map.sub_cont_linear ContinuousAffineMap.sub_contLinear @[simp] theorem neg_contLinear (f : P →ᴬ[R] W) : (-f).contLinear = -f.contLinear := rfl #align continuous_affine_map.neg_cont_linear ContinuousAffineMap.neg_contLinear @[simp] theorem smul_contLinear (t : R) (f : P →ᴬ[R] W) : (t β€’ f).contLinear = t β€’ f.contLinear := rfl #align continuous_affine_map.smul_cont_linear ContinuousAffineMap.smul_contLinear
Mathlib/Analysis/NormedSpace/ContinuousAffineMap.lean
148
151
theorem decomp (f : V →ᴬ[R] W) : (f : V β†’ W) = f.contLinear + Function.const V (f 0) := by
rcases f with ⟨f, h⟩ rw [coe_mk_const_linear_eq_linear, coe_mk, f.decomp, Pi.add_apply, LinearMap.map_zero, zero_add, ← Function.const_def]
1,636
import Mathlib.Analysis.NormedSpace.ContinuousAffineMap import Mathlib.Analysis.Calculus.ContDiff.Basic #align_import analysis.calculus.affine_map from "leanprover-community/mathlib"@"839b92fedff9981cf3fe1c1f623e04b0d127f57c" namespace ContinuousAffineMap variable {π•œ V W : Type*} [NontriviallyNormedField π•œ] variable [NormedAddCommGroup V] [NormedSpace π•œ V] variable [NormedAddCommGroup W] [NormedSpace π•œ W]
Mathlib/Analysis/Calculus/AffineMap.lean
30
33
theorem contDiff {n : β„•βˆž} (f : V →ᴬ[π•œ] W) : ContDiff π•œ n f := by
rw [f.decomp] apply f.contLinear.contDiff.add exact contDiff_const
1,637
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup
Mathlib/Analysis/NormedSpace/Star/Basic.lean
118
120
theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by
nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star]
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star] #align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star
Mathlib/Analysis/NormedSpace/Star/Basic.lean
123
123
theorem norm_star_mul_self' {x : E} : β€–x⋆ * xβ€– = β€–x⋆‖ * β€–xβ€– := by
rw [norm_star_mul_self, norm_star]
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star] #align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star theorem norm_star_mul_self' {x : E} : β€–x⋆ * xβ€– = β€–x⋆‖ * β€–xβ€– := by rw [norm_star_mul_self, norm_star] #align cstar_ring.norm_star_mul_self' CstarRing.norm_star_mul_self' theorem nnnorm_self_mul_star {x : E} : β€–x * xβ‹†β€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_self_mul_star #align cstar_ring.nnnorm_self_mul_star CstarRing.nnnorm_self_mul_star theorem nnnorm_star_mul_self {x : E} : β€–x⋆ * xβ€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_star_mul_self #align cstar_ring.nnnorm_star_mul_self CstarRing.nnnorm_star_mul_self @[simp]
Mathlib/Analysis/NormedSpace/Star/Basic.lean
135
137
theorem star_mul_self_eq_zero_iff (x : E) : x⋆ * x = 0 ↔ x = 0 := by
rw [← norm_eq_zero, norm_star_mul_self] exact mul_self_eq_zero.trans norm_eq_zero
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star] #align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star theorem norm_star_mul_self' {x : E} : β€–x⋆ * xβ€– = β€–x⋆‖ * β€–xβ€– := by rw [norm_star_mul_self, norm_star] #align cstar_ring.norm_star_mul_self' CstarRing.norm_star_mul_self' theorem nnnorm_self_mul_star {x : E} : β€–x * xβ‹†β€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_self_mul_star #align cstar_ring.nnnorm_self_mul_star CstarRing.nnnorm_self_mul_star theorem nnnorm_star_mul_self {x : E} : β€–x⋆ * xβ€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_star_mul_self #align cstar_ring.nnnorm_star_mul_self CstarRing.nnnorm_star_mul_self @[simp] theorem star_mul_self_eq_zero_iff (x : E) : x⋆ * x = 0 ↔ x = 0 := by rw [← norm_eq_zero, norm_star_mul_self] exact mul_self_eq_zero.trans norm_eq_zero #align cstar_ring.star_mul_self_eq_zero_iff CstarRing.star_mul_self_eq_zero_iff
Mathlib/Analysis/NormedSpace/Star/Basic.lean
140
141
theorem star_mul_self_ne_zero_iff (x : E) : x⋆ * x β‰  0 ↔ x β‰  0 := by
simp only [Ne, star_mul_self_eq_zero_iff]
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star] #align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star theorem norm_star_mul_self' {x : E} : β€–x⋆ * xβ€– = β€–x⋆‖ * β€–xβ€– := by rw [norm_star_mul_self, norm_star] #align cstar_ring.norm_star_mul_self' CstarRing.norm_star_mul_self' theorem nnnorm_self_mul_star {x : E} : β€–x * xβ‹†β€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_self_mul_star #align cstar_ring.nnnorm_self_mul_star CstarRing.nnnorm_self_mul_star theorem nnnorm_star_mul_self {x : E} : β€–x⋆ * xβ€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_star_mul_self #align cstar_ring.nnnorm_star_mul_self CstarRing.nnnorm_star_mul_self @[simp] theorem star_mul_self_eq_zero_iff (x : E) : x⋆ * x = 0 ↔ x = 0 := by rw [← norm_eq_zero, norm_star_mul_self] exact mul_self_eq_zero.trans norm_eq_zero #align cstar_ring.star_mul_self_eq_zero_iff CstarRing.star_mul_self_eq_zero_iff theorem star_mul_self_ne_zero_iff (x : E) : x⋆ * x β‰  0 ↔ x β‰  0 := by simp only [Ne, star_mul_self_eq_zero_iff] #align cstar_ring.star_mul_self_ne_zero_iff CstarRing.star_mul_self_ne_zero_iff @[simp]
Mathlib/Analysis/NormedSpace/Star/Basic.lean
145
146
theorem mul_star_self_eq_zero_iff (x : E) : x * x⋆ = 0 ↔ x = 0 := by
simpa only [star_eq_zero, star_star] using @star_mul_self_eq_zero_iff _ _ _ _ (star x)
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star] #align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star theorem norm_star_mul_self' {x : E} : β€–x⋆ * xβ€– = β€–x⋆‖ * β€–xβ€– := by rw [norm_star_mul_self, norm_star] #align cstar_ring.norm_star_mul_self' CstarRing.norm_star_mul_self' theorem nnnorm_self_mul_star {x : E} : β€–x * xβ‹†β€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_self_mul_star #align cstar_ring.nnnorm_self_mul_star CstarRing.nnnorm_self_mul_star theorem nnnorm_star_mul_self {x : E} : β€–x⋆ * xβ€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_star_mul_self #align cstar_ring.nnnorm_star_mul_self CstarRing.nnnorm_star_mul_self @[simp] theorem star_mul_self_eq_zero_iff (x : E) : x⋆ * x = 0 ↔ x = 0 := by rw [← norm_eq_zero, norm_star_mul_self] exact mul_self_eq_zero.trans norm_eq_zero #align cstar_ring.star_mul_self_eq_zero_iff CstarRing.star_mul_self_eq_zero_iff theorem star_mul_self_ne_zero_iff (x : E) : x⋆ * x β‰  0 ↔ x β‰  0 := by simp only [Ne, star_mul_self_eq_zero_iff] #align cstar_ring.star_mul_self_ne_zero_iff CstarRing.star_mul_self_ne_zero_iff @[simp] theorem mul_star_self_eq_zero_iff (x : E) : x * x⋆ = 0 ↔ x = 0 := by simpa only [star_eq_zero, star_star] using @star_mul_self_eq_zero_iff _ _ _ _ (star x) #align cstar_ring.mul_star_self_eq_zero_iff CstarRing.mul_star_self_eq_zero_iff
Mathlib/Analysis/NormedSpace/Star/Basic.lean
149
150
theorem mul_star_self_ne_zero_iff (x : E) : x * x⋆ β‰  0 ↔ x β‰  0 := by
simp only [Ne, mul_star_self_eq_zero_iff]
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section Unital variable [NormedRing E] [StarRing E] [CstarRing E] @[simp, nolint simpNF] -- Porting note (#10959): simp cannot prove this
Mathlib/Analysis/NormedSpace/Star/Basic.lean
203
205
theorem norm_one [Nontrivial E] : β€–(1 : E)β€– = 1 := by
have : 0 < β€–(1 : E)β€– := norm_pos_iff.mpr one_ne_zero rw [← mul_left_inj' this.ne', ← norm_star_mul_self, mul_one, star_one, one_mul]
1,638
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section Unital variable [NormedRing E] [StarRing E] [CstarRing E] @[simp, nolint simpNF] -- Porting note (#10959): simp cannot prove this theorem norm_one [Nontrivial E] : β€–(1 : E)β€– = 1 := by have : 0 < β€–(1 : E)β€– := norm_pos_iff.mpr one_ne_zero rw [← mul_left_inj' this.ne', ← norm_star_mul_self, mul_one, star_one, one_mul] #align cstar_ring.norm_one CstarRing.norm_one -- see Note [lower instance priority] instance (priority := 100) [Nontrivial E] : NormOneClass E := ⟨norm_one⟩
Mathlib/Analysis/NormedSpace/Star/Basic.lean
212
214
theorem norm_coe_unitary [Nontrivial E] (U : unitary E) : β€–(U : E)β€– = 1 := by
rw [← sq_eq_sq (norm_nonneg _) zero_le_one, one_pow 2, sq, ← CstarRing.norm_star_mul_self, unitary.coe_star_mul_self, CstarRing.norm_one]
1,638
import Mathlib.Analysis.NormedSpace.Star.Basic import Mathlib.Analysis.NormedSpace.Unitization #align_import analysis.normed_space.star.mul from "leanprover-community/mathlib"@"b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f" open ContinuousLinearMap local postfix:max "⋆" => star variable (π•œ : Type*) {E : Type*} variable [DenselyNormedField π•œ] [NonUnitalNormedRing E] [StarRing E] [CstarRing E] variable [NormedSpace π•œ E] [IsScalarTower π•œ E E] [SMulCommClass π•œ E E] variable (E) instance CstarRing.instRegularNormedAlgebra : RegularNormedAlgebra π•œ E where isometry_mul' := AddMonoidHomClass.isometry_of_norm (mul π•œ E) fun a => NNReal.eq_iff.mpr <| show β€–mul π•œ E aβ€–β‚Š = β€–aβ€–β‚Š by rw [← sSup_closed_unit_ball_eq_nnnorm] refine csSup_eq_of_forall_le_of_forall_lt_exists_gt ?_ ?_ fun r hr => ?_ Β· exact (Metric.nonempty_closedBall.mpr zero_le_one).image _ Β· rintro - ⟨x, hx, rfl⟩ exact ((mul π•œ E a).unit_le_opNorm x <| mem_closedBall_zero_iff.mp hx).trans (opNorm_mul_apply_le π•œ E a) Β· have ha : 0 < β€–aβ€–β‚Š := zero_le'.trans_lt hr rw [← inv_inv β€–aβ€–β‚Š, NNReal.lt_inv_iff_mul_lt (inv_ne_zero ha.ne')] at hr obtain ⟨k, hk₁, hkβ‚‚βŸ© := NormedField.exists_lt_nnnorm_lt π•œ (mul_lt_mul_of_pos_right hr <| inv_pos.2 ha) refine ⟨_, ⟨k β€’ star a, ?_, rfl⟩, ?_⟩ Β· simpa only [mem_closedBall_zero_iff, norm_smul, one_mul, norm_star] using (NNReal.le_inv_iff_mul_le ha.ne').1 (one_mul β€–aβ€–β‚Šβ»ΒΉ β–Έ hkβ‚‚.le : β€–kβ€–β‚Š ≀ β€–aβ€–β‚Šβ»ΒΉ) Β· simp only [map_smul, nnnorm_smul, mul_apply', mul_smul_comm, CstarRing.nnnorm_self_mul_star] rwa [← NNReal.div_lt_iff (mul_pos ha ha).ne', div_eq_mul_inv, mul_inv, ← mul_assoc] section CStarProperty variable [StarRing π•œ] [CstarRing π•œ] [StarModule π•œ E] variable {E}
Mathlib/Analysis/NormedSpace/Star/Unitization.lean
87
124
theorem Unitization.norm_splitMul_snd_sq (x : Unitization π•œ E) : β€–(Unitization.splitMul π•œ E x).sndβ€– ^ 2 ≀ β€–(Unitization.splitMul π•œ E (star x * x)).sndβ€– := by
/- The key idea is that we can use `sSup_closed_unit_ball_eq_norm` to make this about applying this linear map to elements of norm at most one. There is a bit of `sqrt` and `sq` shuffling that needs to occur, which is primarily just an annoyance. -/ refine (Real.le_sqrt (norm_nonneg _) (norm_nonneg _)).mp ?_ simp only [Unitization.splitMul_apply] rw [← sSup_closed_unit_ball_eq_norm] refine csSup_le ((Metric.nonempty_closedBall.2 zero_le_one).image _) ?_ rintro - ⟨b, hb, rfl⟩ simp only -- rewrite to a more convenient form; this is where we use the C⋆-property rw [← Real.sqrt_sq (norm_nonneg _), Real.sqrt_le_sqrt_iff (norm_nonneg _), sq, ← CstarRing.norm_star_mul_self, ContinuousLinearMap.add_apply, star_add, mul_apply', Algebra.algebraMap_eq_smul_one, ContinuousLinearMap.smul_apply, ContinuousLinearMap.one_apply, star_mul, star_smul, add_mul, smul_mul_assoc, ← mul_smul_comm, mul_assoc, ← mul_add, ← sSup_closed_unit_ball_eq_norm] refine (norm_mul_le _ _).trans ?_ calc _ ≀ β€–star x.fst β€’ (x.fst β€’ b + x.snd * b) + star x.snd * (x.fst β€’ b + x.snd * b)β€– := by nth_rewrite 2 [← one_mul β€–_ + _β€–] gcongr exact (norm_star b).symm β–Έ mem_closedBall_zero_iff.1 hb _ ≀ sSup (_ '' Metric.closedBall 0 1) := le_csSup ?_ ⟨b, hb, ?_⟩ -- now we just check the side conditions for `le_csSup`. There is nothing of interest here. Β· refine βŸ¨β€–(star x * x).fstβ€– + β€–(star x * x).sndβ€–, ?_⟩ rintro _ ⟨y, hy, rfl⟩ refine (norm_add_le _ _).trans ?_ gcongr Β· rw [Algebra.algebraMap_eq_smul_one] refine (norm_smul _ _).trans_le ?_ simpa only [mul_one] using mul_le_mul_of_nonneg_left (mem_closedBall_zero_iff.1 hy) (norm_nonneg (star x * x).fst) Β· exact (unit_le_opNorm _ y <| mem_closedBall_zero_iff.1 hy).trans (opNorm_mul_apply_le _ _ _) Β· simp only [ContinuousLinearMap.add_apply, mul_apply', Unitization.snd_star, Unitization.snd_mul, Unitization.fst_mul, Unitization.fst_star, Algebra.algebraMap_eq_smul_one, smul_apply, one_apply, smul_add, mul_add, add_mul] simp only [smul_smul, smul_mul_assoc, ← add_assoc, ← mul_assoc, mul_smul_comm]
1,639
import Mathlib.Algebra.Module.MinimalAxioms import Mathlib.Topology.ContinuousFunction.Algebra import Mathlib.Analysis.Normed.Order.Lattice import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Star.Basic import Mathlib.Analysis.NormedSpace.ContinuousLinearMap import Mathlib.Topology.Bornology.BoundedOperation #align_import topology.continuous_function.bounded from "leanprover-community/mathlib"@"5dc275ec639221ca4d5f56938eb966f6ad9bc89f" noncomputable section open scoped Classical open Topology Bornology NNReal uniformity UniformConvergence open Set Filter Metric Function universe u v w variable {F : Type*} {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} structure BoundedContinuousFunction (Ξ± : Type u) (Ξ² : Type v) [TopologicalSpace Ξ±] [PseudoMetricSpace Ξ²] extends ContinuousMap Ξ± Ξ² : Type max u v where map_bounded' : βˆƒ C, βˆ€ x y, dist (toFun x) (toFun y) ≀ C #align bounded_continuous_function BoundedContinuousFunction scoped[BoundedContinuousFunction] infixr:25 " →ᡇ " => BoundedContinuousFunction section -- Porting note: Changed type of `Ξ± Ξ²` from `Type*` to `outParam Type*`. class BoundedContinuousMapClass (F : Type*) (Ξ± Ξ² : outParam Type*) [TopologicalSpace Ξ±] [PseudoMetricSpace Ξ²] [FunLike F Ξ± Ξ²] extends ContinuousMapClass F Ξ± Ξ² : Prop where map_bounded (f : F) : βˆƒ C, βˆ€ x y, dist (f x) (f y) ≀ C #align bounded_continuous_map_class BoundedContinuousMapClass end export BoundedContinuousMapClass (map_bounded) namespace BoundedContinuousFunction section Basics variable [TopologicalSpace Ξ±] [PseudoMetricSpace Ξ²] [PseudoMetricSpace Ξ³] variable {f g : Ξ± →ᡇ Ξ²} {x : Ξ±} {C : ℝ} instance instFunLike : FunLike (Ξ± →ᡇ Ξ²) Ξ± Ξ² where coe f := f.toFun coe_injective' f g h := by obtain ⟨⟨_, _⟩, _⟩ := f obtain ⟨⟨_, _⟩, _⟩ := g congr instance instBoundedContinuousMapClass : BoundedContinuousMapClass (Ξ± →ᡇ Ξ²) Ξ± Ξ² where map_continuous f := f.continuous_toFun map_bounded f := f.map_bounded' instance instCoeTC [FunLike F Ξ± Ξ²] [BoundedContinuousMapClass F Ξ± Ξ²] : CoeTC F (Ξ± →ᡇ Ξ²) := ⟨fun f => { toFun := f continuous_toFun := map_continuous f map_bounded' := map_bounded f }⟩ @[simp] theorem coe_to_continuous_fun (f : Ξ± →ᡇ Ξ²) : (f.toContinuousMap : Ξ± β†’ Ξ²) = f := rfl #align bounded_continuous_function.coe_to_continuous_fun BoundedContinuousFunction.coe_to_continuous_fun def Simps.apply (h : Ξ± →ᡇ Ξ²) : Ξ± β†’ Ξ² := h #align bounded_continuous_function.simps.apply BoundedContinuousFunction.Simps.apply initialize_simps_projections BoundedContinuousFunction (toContinuousMap_toFun β†’ apply) protected theorem bounded (f : Ξ± →ᡇ Ξ²) : βˆƒ C, βˆ€ x y : Ξ±, dist (f x) (f y) ≀ C := f.map_bounded' #align bounded_continuous_function.bounded BoundedContinuousFunction.bounded protected theorem continuous (f : Ξ± →ᡇ Ξ²) : Continuous f := f.toContinuousMap.continuous #align bounded_continuous_function.continuous BoundedContinuousFunction.continuous @[ext] theorem ext (h : βˆ€ x, f x = g x) : f = g := DFunLike.ext _ _ h #align bounded_continuous_function.ext BoundedContinuousFunction.ext theorem isBounded_range (f : Ξ± →ᡇ Ξ²) : IsBounded (range f) := isBounded_range_iff.2 f.bounded #align bounded_continuous_function.bounded_range BoundedContinuousFunction.isBounded_range theorem isBounded_image (f : Ξ± →ᡇ Ξ²) (s : Set Ξ±) : IsBounded (f '' s) := f.isBounded_range.subset <| image_subset_range _ _ #align bounded_continuous_function.bounded_image BoundedContinuousFunction.isBounded_image theorem eq_of_empty [h : IsEmpty Ξ±] (f g : Ξ± →ᡇ Ξ²) : f = g := ext <| h.elim #align bounded_continuous_function.eq_of_empty BoundedContinuousFunction.eq_of_empty def mkOfBound (f : C(Ξ±, Ξ²)) (C : ℝ) (h : βˆ€ x y : Ξ±, dist (f x) (f y) ≀ C) : Ξ± →ᡇ Ξ² := ⟨f, ⟨C, h⟩⟩ #align bounded_continuous_function.mk_of_bound BoundedContinuousFunction.mkOfBound @[simp] theorem mkOfBound_coe {f} {C} {h} : (mkOfBound f C h : Ξ± β†’ Ξ²) = (f : Ξ± β†’ Ξ²) := rfl #align bounded_continuous_function.mk_of_bound_coe BoundedContinuousFunction.mkOfBound_coe def mkOfCompact [CompactSpace Ξ±] (f : C(Ξ±, Ξ²)) : Ξ± →ᡇ Ξ² := ⟨f, isBounded_range_iff.1 (isCompact_range f.continuous).isBounded⟩ #align bounded_continuous_function.mk_of_compact BoundedContinuousFunction.mkOfCompact @[simp] theorem mkOfCompact_apply [CompactSpace Ξ±] (f : C(Ξ±, Ξ²)) (a : Ξ±) : mkOfCompact f a = f a := rfl #align bounded_continuous_function.mk_of_compact_apply BoundedContinuousFunction.mkOfCompact_apply @[simps] def mkOfDiscrete [DiscreteTopology Ξ±] (f : Ξ± β†’ Ξ²) (C : ℝ) (h : βˆ€ x y : Ξ±, dist (f x) (f y) ≀ C) : Ξ± →ᡇ Ξ² := ⟨⟨f, continuous_of_discreteTopology⟩, ⟨C, h⟩⟩ #align bounded_continuous_function.mk_of_discrete BoundedContinuousFunction.mkOfDiscrete instance instDist : Dist (Ξ± →ᡇ Ξ²) := ⟨fun f g => sInf { C | 0 ≀ C ∧ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C }⟩ theorem dist_eq : dist f g = sInf { C | 0 ≀ C ∧ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C } := rfl #align bounded_continuous_function.dist_eq BoundedContinuousFunction.dist_eq
Mathlib/Topology/ContinuousFunction/Bounded.lean
158
162
theorem dist_set_exists : βˆƒ C, 0 ≀ C ∧ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C := by
rcases isBounded_iff.1 (f.isBounded_range.union g.isBounded_range) with ⟨C, hC⟩ refine ⟨max 0 C, le_max_left _ _, fun x => (hC ?_ ?_).trans (le_max_right _ _)⟩ <;> [left; right] <;> apply mem_range_self
1,640
import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.Sets.Compacts #align_import measure_theory.integral.riesz_markov_kakutani from "leanprover-community/mathlib"@"b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f" noncomputable section open BoundedContinuousFunction NNReal ENNReal open Set Function TopologicalSpace variable {X : Type*} [TopologicalSpace X] variable (Ξ› : (X →ᡇ ℝβ‰₯0) β†’β‚—[ℝβ‰₯0] ℝβ‰₯0) def rieszContentAux : Compacts X β†’ ℝβ‰₯0 := fun K => sInf (Ξ› '' { f : X →ᡇ ℝβ‰₯0 | βˆ€ x ∈ K, (1 : ℝβ‰₯0) ≀ f x }) #align riesz_content_aux rieszContentAux section RieszMonotone
Mathlib/MeasureTheory/Integral/RieszMarkovKakutani.lean
51
56
theorem rieszContentAux_image_nonempty (K : Compacts X) : (Ξ› '' { f : X →ᡇ ℝβ‰₯0 | βˆ€ x ∈ K, (1 : ℝβ‰₯0) ≀ f x }).Nonempty := by
rw [image_nonempty] use (1 : X →ᡇ ℝβ‰₯0) intro x _ simp only [BoundedContinuousFunction.coe_one, Pi.one_apply]; rfl
1,641
import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.UniformSpace.Compact import Mathlib.Topology.CompactOpen import Mathlib.Topology.Sets.Compacts import Mathlib.Analysis.Normed.Group.InfiniteSum #align_import topology.continuous_function.compact from "leanprover-community/mathlib"@"d3af0609f6db8691dffdc3e1fb7feb7da72698f2" noncomputable section open scoped Classical open Topology NNReal BoundedContinuousFunction open Set Filter Metric open BoundedContinuousFunction namespace ContinuousMap variable {Ξ± Ξ² E : Type*} [TopologicalSpace Ξ±] [CompactSpace Ξ±] [MetricSpace Ξ²] [NormedAddCommGroup E] section variable (Ξ± Ξ²) @[simps (config := .asFn)] def equivBoundedOfCompact : C(Ξ±, Ξ²) ≃ (Ξ± →ᡇ Ξ²) := ⟨mkOfCompact, BoundedContinuousFunction.toContinuousMap, fun f => by ext rfl, fun f => by ext rfl⟩ #align continuous_map.equiv_bounded_of_compact ContinuousMap.equivBoundedOfCompact theorem uniformInducing_equivBoundedOfCompact : UniformInducing (equivBoundedOfCompact Ξ± Ξ²) := UniformInducing.mk' (by simp only [hasBasis_compactConvergenceUniformity.mem_iff, uniformity_basis_dist_le.mem_iff] exact fun s => ⟨fun ⟨⟨a, b⟩, ⟨_, ⟨Ρ, hΞ΅, hb⟩⟩, hs⟩ => ⟨{ p | βˆ€ x, (p.1 x, p.2 x) ∈ b }, ⟨Ρ, hΞ΅, fun _ h x => hb ((dist_le hΞ΅.le).mp h x)⟩, fun f g h => hs fun x _ => h x⟩, fun ⟨_, ⟨Ρ, hΞ΅, ht⟩, hs⟩ => ⟨⟨Set.univ, { p | dist p.1 p.2 ≀ Ξ΅ }⟩, ⟨isCompact_univ, ⟨Ρ, hΞ΅, fun _ h => h⟩⟩, fun ⟨f, g⟩ h => hs _ _ (ht ((dist_le hΞ΅.le).mpr fun x => h x (mem_univ x)))⟩⟩) #align continuous_map.uniform_inducing_equiv_bounded_of_compact ContinuousMap.uniformInducing_equivBoundedOfCompact theorem uniformEmbedding_equivBoundedOfCompact : UniformEmbedding (equivBoundedOfCompact Ξ± Ξ²) := { uniformInducing_equivBoundedOfCompact Ξ± Ξ² with inj := (equivBoundedOfCompact Ξ± Ξ²).injective } #align continuous_map.uniform_embedding_equiv_bounded_of_compact ContinuousMap.uniformEmbedding_equivBoundedOfCompact -- Porting note: the following `simps` received a "maximum recursion depth" error -- @[simps! (config := .asFn) apply symm_apply] def addEquivBoundedOfCompact [AddMonoid Ξ²] [LipschitzAdd Ξ²] : C(Ξ±, Ξ²) ≃+ (Ξ± →ᡇ Ξ²) := ({ toContinuousMapAddHom Ξ± Ξ², (equivBoundedOfCompact Ξ± Ξ²).symm with } : (Ξ± →ᡇ Ξ²) ≃+ C(Ξ±, Ξ²)).symm #align continuous_map.add_equiv_bounded_of_compact ContinuousMap.addEquivBoundedOfCompact -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_symm_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑((addEquivBoundedOfCompact Ξ± Ξ²).symm) = toContinuousMapAddHom Ξ± Ξ² := rfl -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑(addEquivBoundedOfCompact Ξ± Ξ²) = mkOfCompact := rfl instance metricSpace : MetricSpace C(Ξ±, Ξ²) := (uniformEmbedding_equivBoundedOfCompact Ξ± Ξ²).comapMetricSpace _ #align continuous_map.metric_space ContinuousMap.metricSpace @[simps! (config := .asFn) toEquiv apply symm_apply] def isometryEquivBoundedOfCompact : C(Ξ±, Ξ²) ≃ᡒ (Ξ± →ᡇ Ξ²) where isometry_toFun _ _ := rfl toEquiv := equivBoundedOfCompact Ξ± Ξ² #align continuous_map.isometry_equiv_bounded_of_compact ContinuousMap.isometryEquivBoundedOfCompact end @[simp] theorem _root_.BoundedContinuousFunction.dist_mkOfCompact (f g : C(Ξ±, Ξ²)) : dist (mkOfCompact f) (mkOfCompact g) = dist f g := rfl #align bounded_continuous_function.dist_mk_of_compact BoundedContinuousFunction.dist_mkOfCompact @[simp] theorem _root_.BoundedContinuousFunction.dist_toContinuousMap (f g : Ξ± →ᡇ Ξ²) : dist f.toContinuousMap g.toContinuousMap = dist f g := rfl #align bounded_continuous_function.dist_to_continuous_map BoundedContinuousFunction.dist_toContinuousMap open BoundedContinuousFunction section variable {f g : C(Ξ±, Ξ²)} {C : ℝ}
Mathlib/Topology/ContinuousFunction/Compact.lean
132
133
theorem dist_apply_le_dist (x : Ξ±) : dist (f x) (g x) ≀ dist f g := by
simp only [← dist_mkOfCompact, dist_coe_le_dist, ← mkOfCompact_apply]
1,642
import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.UniformSpace.Compact import Mathlib.Topology.CompactOpen import Mathlib.Topology.Sets.Compacts import Mathlib.Analysis.Normed.Group.InfiniteSum #align_import topology.continuous_function.compact from "leanprover-community/mathlib"@"d3af0609f6db8691dffdc3e1fb7feb7da72698f2" noncomputable section open scoped Classical open Topology NNReal BoundedContinuousFunction open Set Filter Metric open BoundedContinuousFunction namespace ContinuousMap variable {Ξ± Ξ² E : Type*} [TopologicalSpace Ξ±] [CompactSpace Ξ±] [MetricSpace Ξ²] [NormedAddCommGroup E] section variable (Ξ± Ξ²) @[simps (config := .asFn)] def equivBoundedOfCompact : C(Ξ±, Ξ²) ≃ (Ξ± →ᡇ Ξ²) := ⟨mkOfCompact, BoundedContinuousFunction.toContinuousMap, fun f => by ext rfl, fun f => by ext rfl⟩ #align continuous_map.equiv_bounded_of_compact ContinuousMap.equivBoundedOfCompact theorem uniformInducing_equivBoundedOfCompact : UniformInducing (equivBoundedOfCompact Ξ± Ξ²) := UniformInducing.mk' (by simp only [hasBasis_compactConvergenceUniformity.mem_iff, uniformity_basis_dist_le.mem_iff] exact fun s => ⟨fun ⟨⟨a, b⟩, ⟨_, ⟨Ρ, hΞ΅, hb⟩⟩, hs⟩ => ⟨{ p | βˆ€ x, (p.1 x, p.2 x) ∈ b }, ⟨Ρ, hΞ΅, fun _ h x => hb ((dist_le hΞ΅.le).mp h x)⟩, fun f g h => hs fun x _ => h x⟩, fun ⟨_, ⟨Ρ, hΞ΅, ht⟩, hs⟩ => ⟨⟨Set.univ, { p | dist p.1 p.2 ≀ Ξ΅ }⟩, ⟨isCompact_univ, ⟨Ρ, hΞ΅, fun _ h => h⟩⟩, fun ⟨f, g⟩ h => hs _ _ (ht ((dist_le hΞ΅.le).mpr fun x => h x (mem_univ x)))⟩⟩) #align continuous_map.uniform_inducing_equiv_bounded_of_compact ContinuousMap.uniformInducing_equivBoundedOfCompact theorem uniformEmbedding_equivBoundedOfCompact : UniformEmbedding (equivBoundedOfCompact Ξ± Ξ²) := { uniformInducing_equivBoundedOfCompact Ξ± Ξ² with inj := (equivBoundedOfCompact Ξ± Ξ²).injective } #align continuous_map.uniform_embedding_equiv_bounded_of_compact ContinuousMap.uniformEmbedding_equivBoundedOfCompact -- Porting note: the following `simps` received a "maximum recursion depth" error -- @[simps! (config := .asFn) apply symm_apply] def addEquivBoundedOfCompact [AddMonoid Ξ²] [LipschitzAdd Ξ²] : C(Ξ±, Ξ²) ≃+ (Ξ± →ᡇ Ξ²) := ({ toContinuousMapAddHom Ξ± Ξ², (equivBoundedOfCompact Ξ± Ξ²).symm with } : (Ξ± →ᡇ Ξ²) ≃+ C(Ξ±, Ξ²)).symm #align continuous_map.add_equiv_bounded_of_compact ContinuousMap.addEquivBoundedOfCompact -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_symm_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑((addEquivBoundedOfCompact Ξ± Ξ²).symm) = toContinuousMapAddHom Ξ± Ξ² := rfl -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑(addEquivBoundedOfCompact Ξ± Ξ²) = mkOfCompact := rfl instance metricSpace : MetricSpace C(Ξ±, Ξ²) := (uniformEmbedding_equivBoundedOfCompact Ξ± Ξ²).comapMetricSpace _ #align continuous_map.metric_space ContinuousMap.metricSpace @[simps! (config := .asFn) toEquiv apply symm_apply] def isometryEquivBoundedOfCompact : C(Ξ±, Ξ²) ≃ᡒ (Ξ± →ᡇ Ξ²) where isometry_toFun _ _ := rfl toEquiv := equivBoundedOfCompact Ξ± Ξ² #align continuous_map.isometry_equiv_bounded_of_compact ContinuousMap.isometryEquivBoundedOfCompact end @[simp] theorem _root_.BoundedContinuousFunction.dist_mkOfCompact (f g : C(Ξ±, Ξ²)) : dist (mkOfCompact f) (mkOfCompact g) = dist f g := rfl #align bounded_continuous_function.dist_mk_of_compact BoundedContinuousFunction.dist_mkOfCompact @[simp] theorem _root_.BoundedContinuousFunction.dist_toContinuousMap (f g : Ξ± →ᡇ Ξ²) : dist f.toContinuousMap g.toContinuousMap = dist f g := rfl #align bounded_continuous_function.dist_to_continuous_map BoundedContinuousFunction.dist_toContinuousMap open BoundedContinuousFunction section variable {f g : C(Ξ±, Ξ²)} {C : ℝ} theorem dist_apply_le_dist (x : Ξ±) : dist (f x) (g x) ≀ dist f g := by simp only [← dist_mkOfCompact, dist_coe_le_dist, ← mkOfCompact_apply] #align continuous_map.dist_apply_le_dist ContinuousMap.dist_apply_le_dist
Mathlib/Topology/ContinuousFunction/Compact.lean
137
138
theorem dist_le (C0 : (0 : ℝ) ≀ C) : dist f g ≀ C ↔ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C := by
simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le C0, mkOfCompact_apply]
1,642
import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.UniformSpace.Compact import Mathlib.Topology.CompactOpen import Mathlib.Topology.Sets.Compacts import Mathlib.Analysis.Normed.Group.InfiniteSum #align_import topology.continuous_function.compact from "leanprover-community/mathlib"@"d3af0609f6db8691dffdc3e1fb7feb7da72698f2" noncomputable section open scoped Classical open Topology NNReal BoundedContinuousFunction open Set Filter Metric open BoundedContinuousFunction namespace ContinuousMap variable {Ξ± Ξ² E : Type*} [TopologicalSpace Ξ±] [CompactSpace Ξ±] [MetricSpace Ξ²] [NormedAddCommGroup E] section variable (Ξ± Ξ²) @[simps (config := .asFn)] def equivBoundedOfCompact : C(Ξ±, Ξ²) ≃ (Ξ± →ᡇ Ξ²) := ⟨mkOfCompact, BoundedContinuousFunction.toContinuousMap, fun f => by ext rfl, fun f => by ext rfl⟩ #align continuous_map.equiv_bounded_of_compact ContinuousMap.equivBoundedOfCompact theorem uniformInducing_equivBoundedOfCompact : UniformInducing (equivBoundedOfCompact Ξ± Ξ²) := UniformInducing.mk' (by simp only [hasBasis_compactConvergenceUniformity.mem_iff, uniformity_basis_dist_le.mem_iff] exact fun s => ⟨fun ⟨⟨a, b⟩, ⟨_, ⟨Ρ, hΞ΅, hb⟩⟩, hs⟩ => ⟨{ p | βˆ€ x, (p.1 x, p.2 x) ∈ b }, ⟨Ρ, hΞ΅, fun _ h x => hb ((dist_le hΞ΅.le).mp h x)⟩, fun f g h => hs fun x _ => h x⟩, fun ⟨_, ⟨Ρ, hΞ΅, ht⟩, hs⟩ => ⟨⟨Set.univ, { p | dist p.1 p.2 ≀ Ξ΅ }⟩, ⟨isCompact_univ, ⟨Ρ, hΞ΅, fun _ h => h⟩⟩, fun ⟨f, g⟩ h => hs _ _ (ht ((dist_le hΞ΅.le).mpr fun x => h x (mem_univ x)))⟩⟩) #align continuous_map.uniform_inducing_equiv_bounded_of_compact ContinuousMap.uniformInducing_equivBoundedOfCompact theorem uniformEmbedding_equivBoundedOfCompact : UniformEmbedding (equivBoundedOfCompact Ξ± Ξ²) := { uniformInducing_equivBoundedOfCompact Ξ± Ξ² with inj := (equivBoundedOfCompact Ξ± Ξ²).injective } #align continuous_map.uniform_embedding_equiv_bounded_of_compact ContinuousMap.uniformEmbedding_equivBoundedOfCompact -- Porting note: the following `simps` received a "maximum recursion depth" error -- @[simps! (config := .asFn) apply symm_apply] def addEquivBoundedOfCompact [AddMonoid Ξ²] [LipschitzAdd Ξ²] : C(Ξ±, Ξ²) ≃+ (Ξ± →ᡇ Ξ²) := ({ toContinuousMapAddHom Ξ± Ξ², (equivBoundedOfCompact Ξ± Ξ²).symm with } : (Ξ± →ᡇ Ξ²) ≃+ C(Ξ±, Ξ²)).symm #align continuous_map.add_equiv_bounded_of_compact ContinuousMap.addEquivBoundedOfCompact -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_symm_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑((addEquivBoundedOfCompact Ξ± Ξ²).symm) = toContinuousMapAddHom Ξ± Ξ² := rfl -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑(addEquivBoundedOfCompact Ξ± Ξ²) = mkOfCompact := rfl instance metricSpace : MetricSpace C(Ξ±, Ξ²) := (uniformEmbedding_equivBoundedOfCompact Ξ± Ξ²).comapMetricSpace _ #align continuous_map.metric_space ContinuousMap.metricSpace @[simps! (config := .asFn) toEquiv apply symm_apply] def isometryEquivBoundedOfCompact : C(Ξ±, Ξ²) ≃ᡒ (Ξ± →ᡇ Ξ²) where isometry_toFun _ _ := rfl toEquiv := equivBoundedOfCompact Ξ± Ξ² #align continuous_map.isometry_equiv_bounded_of_compact ContinuousMap.isometryEquivBoundedOfCompact end @[simp] theorem _root_.BoundedContinuousFunction.dist_mkOfCompact (f g : C(Ξ±, Ξ²)) : dist (mkOfCompact f) (mkOfCompact g) = dist f g := rfl #align bounded_continuous_function.dist_mk_of_compact BoundedContinuousFunction.dist_mkOfCompact @[simp] theorem _root_.BoundedContinuousFunction.dist_toContinuousMap (f g : Ξ± →ᡇ Ξ²) : dist f.toContinuousMap g.toContinuousMap = dist f g := rfl #align bounded_continuous_function.dist_to_continuous_map BoundedContinuousFunction.dist_toContinuousMap open BoundedContinuousFunction section variable {f g : C(Ξ±, Ξ²)} {C : ℝ} theorem dist_apply_le_dist (x : Ξ±) : dist (f x) (g x) ≀ dist f g := by simp only [← dist_mkOfCompact, dist_coe_le_dist, ← mkOfCompact_apply] #align continuous_map.dist_apply_le_dist ContinuousMap.dist_apply_le_dist theorem dist_le (C0 : (0 : ℝ) ≀ C) : dist f g ≀ C ↔ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C := by simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le C0, mkOfCompact_apply] #align continuous_map.dist_le ContinuousMap.dist_le
Mathlib/Topology/ContinuousFunction/Compact.lean
141
143
theorem dist_le_iff_of_nonempty [Nonempty Ξ±] : dist f g ≀ C ↔ βˆ€ x, dist (f x) (g x) ≀ C := by
simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le_iff_of_nonempty, mkOfCompact_apply]
1,642
import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.UniformSpace.Compact import Mathlib.Topology.CompactOpen import Mathlib.Topology.Sets.Compacts import Mathlib.Analysis.Normed.Group.InfiniteSum #align_import topology.continuous_function.compact from "leanprover-community/mathlib"@"d3af0609f6db8691dffdc3e1fb7feb7da72698f2" noncomputable section open scoped Classical open Topology NNReal BoundedContinuousFunction open Set Filter Metric open BoundedContinuousFunction namespace ContinuousMap variable {Ξ± Ξ² E : Type*} [TopologicalSpace Ξ±] [CompactSpace Ξ±] [MetricSpace Ξ²] [NormedAddCommGroup E] section variable (Ξ± Ξ²) @[simps (config := .asFn)] def equivBoundedOfCompact : C(Ξ±, Ξ²) ≃ (Ξ± →ᡇ Ξ²) := ⟨mkOfCompact, BoundedContinuousFunction.toContinuousMap, fun f => by ext rfl, fun f => by ext rfl⟩ #align continuous_map.equiv_bounded_of_compact ContinuousMap.equivBoundedOfCompact theorem uniformInducing_equivBoundedOfCompact : UniformInducing (equivBoundedOfCompact Ξ± Ξ²) := UniformInducing.mk' (by simp only [hasBasis_compactConvergenceUniformity.mem_iff, uniformity_basis_dist_le.mem_iff] exact fun s => ⟨fun ⟨⟨a, b⟩, ⟨_, ⟨Ρ, hΞ΅, hb⟩⟩, hs⟩ => ⟨{ p | βˆ€ x, (p.1 x, p.2 x) ∈ b }, ⟨Ρ, hΞ΅, fun _ h x => hb ((dist_le hΞ΅.le).mp h x)⟩, fun f g h => hs fun x _ => h x⟩, fun ⟨_, ⟨Ρ, hΞ΅, ht⟩, hs⟩ => ⟨⟨Set.univ, { p | dist p.1 p.2 ≀ Ξ΅ }⟩, ⟨isCompact_univ, ⟨Ρ, hΞ΅, fun _ h => h⟩⟩, fun ⟨f, g⟩ h => hs _ _ (ht ((dist_le hΞ΅.le).mpr fun x => h x (mem_univ x)))⟩⟩) #align continuous_map.uniform_inducing_equiv_bounded_of_compact ContinuousMap.uniformInducing_equivBoundedOfCompact theorem uniformEmbedding_equivBoundedOfCompact : UniformEmbedding (equivBoundedOfCompact Ξ± Ξ²) := { uniformInducing_equivBoundedOfCompact Ξ± Ξ² with inj := (equivBoundedOfCompact Ξ± Ξ²).injective } #align continuous_map.uniform_embedding_equiv_bounded_of_compact ContinuousMap.uniformEmbedding_equivBoundedOfCompact -- Porting note: the following `simps` received a "maximum recursion depth" error -- @[simps! (config := .asFn) apply symm_apply] def addEquivBoundedOfCompact [AddMonoid Ξ²] [LipschitzAdd Ξ²] : C(Ξ±, Ξ²) ≃+ (Ξ± →ᡇ Ξ²) := ({ toContinuousMapAddHom Ξ± Ξ², (equivBoundedOfCompact Ξ± Ξ²).symm with } : (Ξ± →ᡇ Ξ²) ≃+ C(Ξ±, Ξ²)).symm #align continuous_map.add_equiv_bounded_of_compact ContinuousMap.addEquivBoundedOfCompact -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_symm_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑((addEquivBoundedOfCompact Ξ± Ξ²).symm) = toContinuousMapAddHom Ξ± Ξ² := rfl -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑(addEquivBoundedOfCompact Ξ± Ξ²) = mkOfCompact := rfl instance metricSpace : MetricSpace C(Ξ±, Ξ²) := (uniformEmbedding_equivBoundedOfCompact Ξ± Ξ²).comapMetricSpace _ #align continuous_map.metric_space ContinuousMap.metricSpace @[simps! (config := .asFn) toEquiv apply symm_apply] def isometryEquivBoundedOfCompact : C(Ξ±, Ξ²) ≃ᡒ (Ξ± →ᡇ Ξ²) where isometry_toFun _ _ := rfl toEquiv := equivBoundedOfCompact Ξ± Ξ² #align continuous_map.isometry_equiv_bounded_of_compact ContinuousMap.isometryEquivBoundedOfCompact end @[simp] theorem _root_.BoundedContinuousFunction.dist_mkOfCompact (f g : C(Ξ±, Ξ²)) : dist (mkOfCompact f) (mkOfCompact g) = dist f g := rfl #align bounded_continuous_function.dist_mk_of_compact BoundedContinuousFunction.dist_mkOfCompact @[simp] theorem _root_.BoundedContinuousFunction.dist_toContinuousMap (f g : Ξ± →ᡇ Ξ²) : dist f.toContinuousMap g.toContinuousMap = dist f g := rfl #align bounded_continuous_function.dist_to_continuous_map BoundedContinuousFunction.dist_toContinuousMap open BoundedContinuousFunction section variable {f g : C(Ξ±, Ξ²)} {C : ℝ} theorem dist_apply_le_dist (x : Ξ±) : dist (f x) (g x) ≀ dist f g := by simp only [← dist_mkOfCompact, dist_coe_le_dist, ← mkOfCompact_apply] #align continuous_map.dist_apply_le_dist ContinuousMap.dist_apply_le_dist theorem dist_le (C0 : (0 : ℝ) ≀ C) : dist f g ≀ C ↔ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C := by simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le C0, mkOfCompact_apply] #align continuous_map.dist_le ContinuousMap.dist_le theorem dist_le_iff_of_nonempty [Nonempty Ξ±] : dist f g ≀ C ↔ βˆ€ x, dist (f x) (g x) ≀ C := by simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le_iff_of_nonempty, mkOfCompact_apply] #align continuous_map.dist_le_iff_of_nonempty ContinuousMap.dist_le_iff_of_nonempty
Mathlib/Topology/ContinuousFunction/Compact.lean
146
147
theorem dist_lt_iff_of_nonempty [Nonempty Ξ±] : dist f g < C ↔ βˆ€ x : Ξ±, dist (f x) (g x) < C := by
simp only [← dist_mkOfCompact, dist_lt_iff_of_nonempty_compact, mkOfCompact_apply]
1,642
import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.UniformSpace.Compact import Mathlib.Topology.CompactOpen import Mathlib.Topology.Sets.Compacts import Mathlib.Analysis.Normed.Group.InfiniteSum #align_import topology.continuous_function.compact from "leanprover-community/mathlib"@"d3af0609f6db8691dffdc3e1fb7feb7da72698f2" noncomputable section open scoped Classical open Topology NNReal BoundedContinuousFunction open Set Filter Metric open BoundedContinuousFunction namespace ContinuousMap variable {Ξ± Ξ² E : Type*} [TopologicalSpace Ξ±] [CompactSpace Ξ±] [MetricSpace Ξ²] [NormedAddCommGroup E] section variable (Ξ± Ξ²) @[simps (config := .asFn)] def equivBoundedOfCompact : C(Ξ±, Ξ²) ≃ (Ξ± →ᡇ Ξ²) := ⟨mkOfCompact, BoundedContinuousFunction.toContinuousMap, fun f => by ext rfl, fun f => by ext rfl⟩ #align continuous_map.equiv_bounded_of_compact ContinuousMap.equivBoundedOfCompact theorem uniformInducing_equivBoundedOfCompact : UniformInducing (equivBoundedOfCompact Ξ± Ξ²) := UniformInducing.mk' (by simp only [hasBasis_compactConvergenceUniformity.mem_iff, uniformity_basis_dist_le.mem_iff] exact fun s => ⟨fun ⟨⟨a, b⟩, ⟨_, ⟨Ρ, hΞ΅, hb⟩⟩, hs⟩ => ⟨{ p | βˆ€ x, (p.1 x, p.2 x) ∈ b }, ⟨Ρ, hΞ΅, fun _ h x => hb ((dist_le hΞ΅.le).mp h x)⟩, fun f g h => hs fun x _ => h x⟩, fun ⟨_, ⟨Ρ, hΞ΅, ht⟩, hs⟩ => ⟨⟨Set.univ, { p | dist p.1 p.2 ≀ Ξ΅ }⟩, ⟨isCompact_univ, ⟨Ρ, hΞ΅, fun _ h => h⟩⟩, fun ⟨f, g⟩ h => hs _ _ (ht ((dist_le hΞ΅.le).mpr fun x => h x (mem_univ x)))⟩⟩) #align continuous_map.uniform_inducing_equiv_bounded_of_compact ContinuousMap.uniformInducing_equivBoundedOfCompact theorem uniformEmbedding_equivBoundedOfCompact : UniformEmbedding (equivBoundedOfCompact Ξ± Ξ²) := { uniformInducing_equivBoundedOfCompact Ξ± Ξ² with inj := (equivBoundedOfCompact Ξ± Ξ²).injective } #align continuous_map.uniform_embedding_equiv_bounded_of_compact ContinuousMap.uniformEmbedding_equivBoundedOfCompact -- Porting note: the following `simps` received a "maximum recursion depth" error -- @[simps! (config := .asFn) apply symm_apply] def addEquivBoundedOfCompact [AddMonoid Ξ²] [LipschitzAdd Ξ²] : C(Ξ±, Ξ²) ≃+ (Ξ± →ᡇ Ξ²) := ({ toContinuousMapAddHom Ξ± Ξ², (equivBoundedOfCompact Ξ± Ξ²).symm with } : (Ξ± →ᡇ Ξ²) ≃+ C(Ξ±, Ξ²)).symm #align continuous_map.add_equiv_bounded_of_compact ContinuousMap.addEquivBoundedOfCompact -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_symm_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑((addEquivBoundedOfCompact Ξ± Ξ²).symm) = toContinuousMapAddHom Ξ± Ξ² := rfl -- Porting note: added this `simp` lemma manually because of the `simps` error above @[simp] theorem addEquivBoundedOfCompact_apply [AddMonoid Ξ²] [LipschitzAdd Ξ²] : ⇑(addEquivBoundedOfCompact Ξ± Ξ²) = mkOfCompact := rfl instance metricSpace : MetricSpace C(Ξ±, Ξ²) := (uniformEmbedding_equivBoundedOfCompact Ξ± Ξ²).comapMetricSpace _ #align continuous_map.metric_space ContinuousMap.metricSpace @[simps! (config := .asFn) toEquiv apply symm_apply] def isometryEquivBoundedOfCompact : C(Ξ±, Ξ²) ≃ᡒ (Ξ± →ᡇ Ξ²) where isometry_toFun _ _ := rfl toEquiv := equivBoundedOfCompact Ξ± Ξ² #align continuous_map.isometry_equiv_bounded_of_compact ContinuousMap.isometryEquivBoundedOfCompact end @[simp] theorem _root_.BoundedContinuousFunction.dist_mkOfCompact (f g : C(Ξ±, Ξ²)) : dist (mkOfCompact f) (mkOfCompact g) = dist f g := rfl #align bounded_continuous_function.dist_mk_of_compact BoundedContinuousFunction.dist_mkOfCompact @[simp] theorem _root_.BoundedContinuousFunction.dist_toContinuousMap (f g : Ξ± →ᡇ Ξ²) : dist f.toContinuousMap g.toContinuousMap = dist f g := rfl #align bounded_continuous_function.dist_to_continuous_map BoundedContinuousFunction.dist_toContinuousMap open BoundedContinuousFunction section variable {f g : C(Ξ±, Ξ²)} {C : ℝ} theorem dist_apply_le_dist (x : Ξ±) : dist (f x) (g x) ≀ dist f g := by simp only [← dist_mkOfCompact, dist_coe_le_dist, ← mkOfCompact_apply] #align continuous_map.dist_apply_le_dist ContinuousMap.dist_apply_le_dist theorem dist_le (C0 : (0 : ℝ) ≀ C) : dist f g ≀ C ↔ βˆ€ x : Ξ±, dist (f x) (g x) ≀ C := by simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le C0, mkOfCompact_apply] #align continuous_map.dist_le ContinuousMap.dist_le theorem dist_le_iff_of_nonempty [Nonempty Ξ±] : dist f g ≀ C ↔ βˆ€ x, dist (f x) (g x) ≀ C := by simp only [← dist_mkOfCompact, BoundedContinuousFunction.dist_le_iff_of_nonempty, mkOfCompact_apply] #align continuous_map.dist_le_iff_of_nonempty ContinuousMap.dist_le_iff_of_nonempty theorem dist_lt_iff_of_nonempty [Nonempty Ξ±] : dist f g < C ↔ βˆ€ x : Ξ±, dist (f x) (g x) < C := by simp only [← dist_mkOfCompact, dist_lt_iff_of_nonempty_compact, mkOfCompact_apply] #align continuous_map.dist_lt_iff_of_nonempty ContinuousMap.dist_lt_iff_of_nonempty theorem dist_lt_of_nonempty [Nonempty Ξ±] (w : βˆ€ x : Ξ±, dist (f x) (g x) < C) : dist f g < C := dist_lt_iff_of_nonempty.2 w #align continuous_map.dist_lt_of_nonempty ContinuousMap.dist_lt_of_nonempty
Mathlib/Topology/ContinuousFunction/Compact.lean
154
156
theorem dist_lt_iff (C0 : (0 : ℝ) < C) : dist f g < C ↔ βˆ€ x : Ξ±, dist (f x) (g x) < C := by
rw [← dist_mkOfCompact, dist_lt_iff_of_compact C0] simp only [mkOfCompact_apply]
1,642
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
58
66
theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by
unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos]
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
69
71
theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by
apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞)
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞) #align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one theorem thickenedIndicatorAux_lt_top {Ξ΄ : ℝ} {E : Set Ξ±} {x : Ξ±} : thickenedIndicatorAux Ξ΄ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top #align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
79
81
theorem thickenedIndicatorAux_closure_eq (Ξ΄ : ℝ) (E : Set Ξ±) : thickenedIndicatorAux Ξ΄ (closure E) = thickenedIndicatorAux Ξ΄ E := by
simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure]
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞) #align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one theorem thickenedIndicatorAux_lt_top {Ξ΄ : ℝ} {E : Set Ξ±} {x : Ξ±} : thickenedIndicatorAux Ξ΄ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top #align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top theorem thickenedIndicatorAux_closure_eq (Ξ΄ : ℝ) (E : Set Ξ±) : thickenedIndicatorAux Ξ΄ (closure E) = thickenedIndicatorAux Ξ΄ E := by simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure] #align thickened_indicator_aux_closure_eq thickenedIndicatorAux_closure_eq
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
84
86
theorem thickenedIndicatorAux_one (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_in_E : x ∈ E) : thickenedIndicatorAux Ξ΄ E x = 1 := by
simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero]
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞) #align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one theorem thickenedIndicatorAux_lt_top {Ξ΄ : ℝ} {E : Set Ξ±} {x : Ξ±} : thickenedIndicatorAux Ξ΄ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top #align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top theorem thickenedIndicatorAux_closure_eq (Ξ΄ : ℝ) (E : Set Ξ±) : thickenedIndicatorAux Ξ΄ (closure E) = thickenedIndicatorAux Ξ΄ E := by simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure] #align thickened_indicator_aux_closure_eq thickenedIndicatorAux_closure_eq theorem thickenedIndicatorAux_one (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_in_E : x ∈ E) : thickenedIndicatorAux Ξ΄ E x = 1 := by simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero] #align thickened_indicator_aux_one thickenedIndicatorAux_one
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
89
91
theorem thickenedIndicatorAux_one_of_mem_closure (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_mem : x ∈ closure E) : thickenedIndicatorAux Ξ΄ E x = 1 := by
rw [← thickenedIndicatorAux_closure_eq, thickenedIndicatorAux_one Ξ΄ (closure E) x_mem]
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞) #align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one theorem thickenedIndicatorAux_lt_top {Ξ΄ : ℝ} {E : Set Ξ±} {x : Ξ±} : thickenedIndicatorAux Ξ΄ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top #align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top theorem thickenedIndicatorAux_closure_eq (Ξ΄ : ℝ) (E : Set Ξ±) : thickenedIndicatorAux Ξ΄ (closure E) = thickenedIndicatorAux Ξ΄ E := by simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure] #align thickened_indicator_aux_closure_eq thickenedIndicatorAux_closure_eq theorem thickenedIndicatorAux_one (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_in_E : x ∈ E) : thickenedIndicatorAux Ξ΄ E x = 1 := by simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero] #align thickened_indicator_aux_one thickenedIndicatorAux_one theorem thickenedIndicatorAux_one_of_mem_closure (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_mem : x ∈ closure E) : thickenedIndicatorAux Ξ΄ E x = 1 := by rw [← thickenedIndicatorAux_closure_eq, thickenedIndicatorAux_one Ξ΄ (closure E) x_mem] #align thickened_indicator_aux_one_of_mem_closure thickenedIndicatorAux_one_of_mem_closure
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
94
102
theorem thickenedIndicatorAux_zero {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) {x : Ξ±} (x_out : x βˆ‰ thickening Ξ΄ E) : thickenedIndicatorAux Ξ΄ E x = 0 := by
rw [thickening, mem_setOf_eq, not_lt] at x_out unfold thickenedIndicatorAux apply le_antisymm _ bot_le have key := tsub_le_tsub (@rfl _ (1 : ℝβ‰₯0∞)).le (ENNReal.div_le_div x_out (@rfl _ (ENNReal.ofReal Ξ΄ : ℝβ‰₯0∞)).le) rw [ENNReal.div_self (ne_of_gt (ENNReal.ofReal_pos.mpr Ξ΄_pos)) ofReal_ne_top] at key simpa using key
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞) #align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one theorem thickenedIndicatorAux_lt_top {Ξ΄ : ℝ} {E : Set Ξ±} {x : Ξ±} : thickenedIndicatorAux Ξ΄ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top #align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top theorem thickenedIndicatorAux_closure_eq (Ξ΄ : ℝ) (E : Set Ξ±) : thickenedIndicatorAux Ξ΄ (closure E) = thickenedIndicatorAux Ξ΄ E := by simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure] #align thickened_indicator_aux_closure_eq thickenedIndicatorAux_closure_eq theorem thickenedIndicatorAux_one (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_in_E : x ∈ E) : thickenedIndicatorAux Ξ΄ E x = 1 := by simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero] #align thickened_indicator_aux_one thickenedIndicatorAux_one theorem thickenedIndicatorAux_one_of_mem_closure (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_mem : x ∈ closure E) : thickenedIndicatorAux Ξ΄ E x = 1 := by rw [← thickenedIndicatorAux_closure_eq, thickenedIndicatorAux_one Ξ΄ (closure E) x_mem] #align thickened_indicator_aux_one_of_mem_closure thickenedIndicatorAux_one_of_mem_closure theorem thickenedIndicatorAux_zero {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) {x : Ξ±} (x_out : x βˆ‰ thickening Ξ΄ E) : thickenedIndicatorAux Ξ΄ E x = 0 := by rw [thickening, mem_setOf_eq, not_lt] at x_out unfold thickenedIndicatorAux apply le_antisymm _ bot_le have key := tsub_le_tsub (@rfl _ (1 : ℝβ‰₯0∞)).le (ENNReal.div_le_div x_out (@rfl _ (ENNReal.ofReal Ξ΄ : ℝβ‰₯0∞)).le) rw [ENNReal.div_self (ne_of_gt (ENNReal.ofReal_pos.mpr Ξ΄_pos)) ofReal_ne_top] at key simpa using key #align thickened_indicator_aux_zero thickenedIndicatorAux_zero theorem thickenedIndicatorAux_mono {δ₁ Ξ΄β‚‚ : ℝ} (hle : δ₁ ≀ Ξ΄β‚‚) (E : Set Ξ±) : thickenedIndicatorAux δ₁ E ≀ thickenedIndicatorAux Ξ΄β‚‚ E := fun _ => tsub_le_tsub (@rfl ℝβ‰₯0∞ 1).le (ENNReal.div_le_div rfl.le (ofReal_le_ofReal hle)) #align thickened_indicator_aux_mono thickenedIndicatorAux_mono
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
110
115
theorem indicator_le_thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : (E.indicator fun _ => (1 : ℝβ‰₯0∞)) ≀ thickenedIndicatorAux Ξ΄ E := by
intro a by_cases h : a ∈ E · simp only [h, indicator_of_mem, thickenedIndicatorAux_one δ E h, le_refl] · simp only [h, indicator_of_not_mem, not_false_iff, zero_le]
1,643
import Mathlib.Data.ENNReal.Basic import Mathlib.Topology.ContinuousFunction.Bounded import Mathlib.Topology.MetricSpace.Thickening #align_import topology.metric_space.thickened_indicator from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal ENNReal Topology BoundedContinuousFunction open NNReal ENNReal Set Metric EMetric Filter noncomputable section thickenedIndicator variable {Ξ± : Type*} [PseudoEMetricSpace Ξ±] def thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄ #align thickened_indicator_aux thickenedIndicatorAux theorem continuous_thickenedIndicatorAux {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) : Continuous (thickenedIndicatorAux Ξ΄ E) := by unfold thickenedIndicatorAux let f := fun x : Ξ± => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝβ‰₯0 Γ— ℝβ‰₯0∞) let sub := fun p : ℝβ‰₯0 Γ— ℝβ‰₯0∞ => (p.1 : ℝβ‰₯0∞) - p.2 rw [show (fun x : Ξ± => (1 : ℝβ‰₯0∞) - infEdist x E / ENNReal.ofReal Ξ΄) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal Ξ΄) _).comp continuous_infEdist set_option tactic.skipAssignedInstances false in norm_num [Ξ΄_pos] #align continuous_thickened_indicator_aux continuous_thickenedIndicatorAux theorem thickenedIndicatorAux_le_one (Ξ΄ : ℝ) (E : Set Ξ±) (x : Ξ±) : thickenedIndicatorAux Ξ΄ E x ≀ 1 := by apply @tsub_le_self _ _ _ _ (1 : ℝβ‰₯0∞) #align thickened_indicator_aux_le_one thickenedIndicatorAux_le_one theorem thickenedIndicatorAux_lt_top {Ξ΄ : ℝ} {E : Set Ξ±} {x : Ξ±} : thickenedIndicatorAux Ξ΄ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top #align thickened_indicator_aux_lt_top thickenedIndicatorAux_lt_top theorem thickenedIndicatorAux_closure_eq (Ξ΄ : ℝ) (E : Set Ξ±) : thickenedIndicatorAux Ξ΄ (closure E) = thickenedIndicatorAux Ξ΄ E := by simp (config := { unfoldPartialApp := true }) only [thickenedIndicatorAux, infEdist_closure] #align thickened_indicator_aux_closure_eq thickenedIndicatorAux_closure_eq theorem thickenedIndicatorAux_one (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_in_E : x ∈ E) : thickenedIndicatorAux Ξ΄ E x = 1 := by simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero] #align thickened_indicator_aux_one thickenedIndicatorAux_one theorem thickenedIndicatorAux_one_of_mem_closure (Ξ΄ : ℝ) (E : Set Ξ±) {x : Ξ±} (x_mem : x ∈ closure E) : thickenedIndicatorAux Ξ΄ E x = 1 := by rw [← thickenedIndicatorAux_closure_eq, thickenedIndicatorAux_one Ξ΄ (closure E) x_mem] #align thickened_indicator_aux_one_of_mem_closure thickenedIndicatorAux_one_of_mem_closure theorem thickenedIndicatorAux_zero {Ξ΄ : ℝ} (Ξ΄_pos : 0 < Ξ΄) (E : Set Ξ±) {x : Ξ±} (x_out : x βˆ‰ thickening Ξ΄ E) : thickenedIndicatorAux Ξ΄ E x = 0 := by rw [thickening, mem_setOf_eq, not_lt] at x_out unfold thickenedIndicatorAux apply le_antisymm _ bot_le have key := tsub_le_tsub (@rfl _ (1 : ℝβ‰₯0∞)).le (ENNReal.div_le_div x_out (@rfl _ (ENNReal.ofReal Ξ΄ : ℝβ‰₯0∞)).le) rw [ENNReal.div_self (ne_of_gt (ENNReal.ofReal_pos.mpr Ξ΄_pos)) ofReal_ne_top] at key simpa using key #align thickened_indicator_aux_zero thickenedIndicatorAux_zero theorem thickenedIndicatorAux_mono {δ₁ Ξ΄β‚‚ : ℝ} (hle : δ₁ ≀ Ξ΄β‚‚) (E : Set Ξ±) : thickenedIndicatorAux δ₁ E ≀ thickenedIndicatorAux Ξ΄β‚‚ E := fun _ => tsub_le_tsub (@rfl ℝβ‰₯0∞ 1).le (ENNReal.div_le_div rfl.le (ofReal_le_ofReal hle)) #align thickened_indicator_aux_mono thickenedIndicatorAux_mono theorem indicator_le_thickenedIndicatorAux (Ξ΄ : ℝ) (E : Set Ξ±) : (E.indicator fun _ => (1 : ℝβ‰₯0∞)) ≀ thickenedIndicatorAux Ξ΄ E := by intro a by_cases h : a ∈ E Β· simp only [h, indicator_of_mem, thickenedIndicatorAux_one Ξ΄ E h, le_refl] Β· simp only [h, indicator_of_not_mem, not_false_iff, zero_le] #align indicator_le_thickened_indicator_aux indicator_le_thickenedIndicatorAux theorem thickenedIndicatorAux_subset (Ξ΄ : ℝ) {E₁ Eβ‚‚ : Set Ξ±} (subset : E₁ βŠ† Eβ‚‚) : thickenedIndicatorAux Ξ΄ E₁ ≀ thickenedIndicatorAux Ξ΄ Eβ‚‚ := fun _ => tsub_le_tsub (@rfl ℝβ‰₯0∞ 1).le (ENNReal.div_le_div (infEdist_anti subset) rfl.le) #align thickened_indicator_aux_subset thickenedIndicatorAux_subset
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
130
153
theorem thickenedIndicatorAux_tendsto_indicator_closure {Ξ΄seq : β„• β†’ ℝ} (Ξ΄seq_lim : Tendsto Ξ΄seq atTop (𝓝 0)) (E : Set Ξ±) : Tendsto (fun n => thickenedIndicatorAux (Ξ΄seq n) E) atTop (𝓝 (indicator (closure E) fun _ => (1 : ℝβ‰₯0∞))) := by
rw [tendsto_pi_nhds] intro x by_cases x_mem_closure : x ∈ closure E Β· simp_rw [thickenedIndicatorAux_one_of_mem_closure _ E x_mem_closure] rw [show (indicator (closure E) fun _ => (1 : ℝβ‰₯0∞)) x = 1 by simp only [x_mem_closure, indicator_of_mem]] exact tendsto_const_nhds Β· rw [show (closure E).indicator (fun _ => (1 : ℝβ‰₯0∞)) x = 0 by simp only [x_mem_closure, indicator_of_not_mem, not_false_iff]] rcases exists_real_pos_lt_infEdist_of_not_mem_closure x_mem_closure with ⟨Ρ, ⟨Ρ_pos, Ξ΅_lt⟩⟩ rw [Metric.tendsto_nhds] at Ξ΄seq_lim specialize Ξ΄seq_lim Ξ΅ Ξ΅_pos simp only [dist_zero_right, Real.norm_eq_abs, eventually_atTop, ge_iff_le] at Ξ΄seq_lim rcases Ξ΄seq_lim with ⟨N, hN⟩ apply @tendsto_atTop_of_eventually_const _ _ _ _ _ _ _ N intro n n_large have key : x βˆ‰ thickening Ξ΅ E := by simpa only [thickening, mem_setOf_eq, not_lt] using Ξ΅_lt.le refine le_antisymm ?_ bot_le apply (thickenedIndicatorAux_mono (lt_of_abs_lt (hN n n_large)).le E x).trans exact (thickenedIndicatorAux_zero Ξ΅_pos E key).le
1,643
import Mathlib.Data.Real.Sqrt import Mathlib.Analysis.NormedSpace.Star.Basic import Mathlib.Analysis.NormedSpace.ContinuousLinearMap import Mathlib.Analysis.NormedSpace.Basic #align_import data.is_R_or_C.basic from "leanprover-community/mathlib"@"baa88307f3e699fa7054ef04ec79fa4f056169cb" section local notation "π“š" => algebraMap ℝ _ open ComplexConjugate class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K, NormedAlgebra ℝ K, CompleteSpace K where re : K β†’+ ℝ im : K β†’+ ℝ I : K I_re_ax : re I = 0 I_mul_I_ax : I = 0 ∨ I * I = -1 re_add_im_ax : βˆ€ z : K, π“š (re z) + π“š (im z) * I = z ofReal_re_ax : βˆ€ r : ℝ, re (π“š r) = r ofReal_im_ax : βˆ€ r : ℝ, im (π“š r) = 0 mul_re_ax : βˆ€ z w : K, re (z * w) = re z * re w - im z * im w mul_im_ax : βˆ€ z w : K, im (z * w) = re z * im w + im z * re w conj_re_ax : βˆ€ z : K, re (conj z) = re z conj_im_ax : βˆ€ z : K, im (conj z) = -im z conj_I_ax : conj I = -I norm_sq_eq_def_ax : βˆ€ z : K, β€–zβ€– ^ 2 = re z * re z + im z * im z mul_im_I_ax : βˆ€ z : K, im z * im I = im z [toPartialOrder : PartialOrder K] le_iff_re_im {z w : K} : z ≀ w ↔ re z ≀ re w ∧ im z = im w -- note we cannot put this in the `extends` clause [toDecidableEq : DecidableEq K] #align is_R_or_C RCLike scoped[ComplexOrder] attribute [instance 100] RCLike.toPartialOrder attribute [instance 100] RCLike.toDecidableEq end variable {K E : Type*} [RCLike K] namespace RCLike open ComplexConjugate @[coe] abbrev ofReal : ℝ β†’ K := Algebra.cast noncomputable instance (priority := 900) algebraMapCoe : CoeTC ℝ K := ⟨ofReal⟩ #align is_R_or_C.algebra_map_coe RCLike.algebraMapCoe theorem ofReal_alg (x : ℝ) : (x : K) = x β€’ (1 : K) := Algebra.algebraMap_eq_smul_one x #align is_R_or_C.of_real_alg RCLike.ofReal_alg theorem real_smul_eq_coe_mul (r : ℝ) (z : K) : r β€’ z = (r : K) * z := Algebra.smul_def r z #align is_R_or_C.real_smul_eq_coe_mul RCLike.real_smul_eq_coe_mul
Mathlib/Analysis/RCLike/Basic.lean
105
106
theorem real_smul_eq_coe_smul [AddCommGroup E] [Module K E] [Module ℝ E] [IsScalarTower ℝ K E] (r : ℝ) (x : E) : r β€’ x = (r : K) β€’ x := by
rw [RCLike.ofReal_alg, smul_one_smul]
1,644
import Mathlib.Data.Real.Sqrt import Mathlib.Analysis.NormedSpace.Star.Basic import Mathlib.Analysis.NormedSpace.ContinuousLinearMap import Mathlib.Analysis.NormedSpace.Basic #align_import data.is_R_or_C.basic from "leanprover-community/mathlib"@"baa88307f3e699fa7054ef04ec79fa4f056169cb" section local notation "π“š" => algebraMap ℝ _ open ComplexConjugate class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K, NormedAlgebra ℝ K, CompleteSpace K where re : K β†’+ ℝ im : K β†’+ ℝ I : K I_re_ax : re I = 0 I_mul_I_ax : I = 0 ∨ I * I = -1 re_add_im_ax : βˆ€ z : K, π“š (re z) + π“š (im z) * I = z ofReal_re_ax : βˆ€ r : ℝ, re (π“š r) = r ofReal_im_ax : βˆ€ r : ℝ, im (π“š r) = 0 mul_re_ax : βˆ€ z w : K, re (z * w) = re z * re w - im z * im w mul_im_ax : βˆ€ z w : K, im (z * w) = re z * im w + im z * re w conj_re_ax : βˆ€ z : K, re (conj z) = re z conj_im_ax : βˆ€ z : K, im (conj z) = -im z conj_I_ax : conj I = -I norm_sq_eq_def_ax : βˆ€ z : K, β€–zβ€– ^ 2 = re z * re z + im z * im z mul_im_I_ax : βˆ€ z : K, im z * im I = im z [toPartialOrder : PartialOrder K] le_iff_re_im {z w : K} : z ≀ w ↔ re z ≀ re w ∧ im z = im w -- note we cannot put this in the `extends` clause [toDecidableEq : DecidableEq K] #align is_R_or_C RCLike scoped[ComplexOrder] attribute [instance 100] RCLike.toPartialOrder attribute [instance 100] RCLike.toDecidableEq end variable {K E : Type*} [RCLike K] namespace RCLike open ComplexConjugate @[coe] abbrev ofReal : ℝ β†’ K := Algebra.cast noncomputable instance (priority := 900) algebraMapCoe : CoeTC ℝ K := ⟨ofReal⟩ #align is_R_or_C.algebra_map_coe RCLike.algebraMapCoe theorem ofReal_alg (x : ℝ) : (x : K) = x β€’ (1 : K) := Algebra.algebraMap_eq_smul_one x #align is_R_or_C.of_real_alg RCLike.ofReal_alg theorem real_smul_eq_coe_mul (r : ℝ) (z : K) : r β€’ z = (r : K) * z := Algebra.smul_def r z #align is_R_or_C.real_smul_eq_coe_mul RCLike.real_smul_eq_coe_mul theorem real_smul_eq_coe_smul [AddCommGroup E] [Module K E] [Module ℝ E] [IsScalarTower ℝ K E] (r : ℝ) (x : E) : r β€’ x = (r : K) β€’ x := by rw [RCLike.ofReal_alg, smul_one_smul] #align is_R_or_C.real_smul_eq_coe_smul RCLike.real_smul_eq_coe_smul theorem algebraMap_eq_ofReal : ⇑(algebraMap ℝ K) = ofReal := rfl #align is_R_or_C.algebra_map_eq_of_real RCLike.algebraMap_eq_ofReal @[simp, rclike_simps] theorem re_add_im (z : K) : (re z : K) + im z * I = z := RCLike.re_add_im_ax z #align is_R_or_C.re_add_im RCLike.re_add_im @[simp, norm_cast, rclike_simps] theorem ofReal_re : βˆ€ r : ℝ, re (r : K) = r := RCLike.ofReal_re_ax #align is_R_or_C.of_real_re RCLike.ofReal_re @[simp, norm_cast, rclike_simps] theorem ofReal_im : βˆ€ r : ℝ, im (r : K) = 0 := RCLike.ofReal_im_ax #align is_R_or_C.of_real_im RCLike.ofReal_im @[simp, rclike_simps] theorem mul_re : βˆ€ z w : K, re (z * w) = re z * re w - im z * im w := RCLike.mul_re_ax #align is_R_or_C.mul_re RCLike.mul_re @[simp, rclike_simps] theorem mul_im : βˆ€ z w : K, im (z * w) = re z * im w + im z * re w := RCLike.mul_im_ax #align is_R_or_C.mul_im RCLike.mul_im theorem ext_iff {z w : K} : z = w ↔ re z = re w ∧ im z = im w := ⟨fun h => h β–Έ ⟨rfl, rfl⟩, fun ⟨h₁, hβ‚‚βŸ© => re_add_im z β–Έ re_add_im w β–Έ h₁ β–Έ hβ‚‚ β–Έ rfl⟩ #align is_R_or_C.ext_iff RCLike.ext_iff theorem ext {z w : K} (hre : re z = re w) (him : im z = im w) : z = w := ext_iff.2 ⟨hre, him⟩ #align is_R_or_C.ext RCLike.ext @[norm_cast] theorem ofReal_zero : ((0 : ℝ) : K) = 0 := algebraMap.coe_zero #align is_R_or_C.of_real_zero RCLike.ofReal_zero @[rclike_simps] theorem zero_re' : re (0 : K) = (0 : ℝ) := map_zero re #align is_R_or_C.zero_re' RCLike.zero_re' @[norm_cast] theorem ofReal_one : ((1 : ℝ) : K) = 1 := map_one (algebraMap ℝ K) #align is_R_or_C.of_real_one RCLike.ofReal_one @[simp, rclike_simps]
Mathlib/Analysis/RCLike/Basic.lean
162
162
theorem one_re : re (1 : K) = 1 := by
rw [← ofReal_one, ofReal_re]
1,644
import Mathlib.Data.Real.Sqrt import Mathlib.Analysis.NormedSpace.Star.Basic import Mathlib.Analysis.NormedSpace.ContinuousLinearMap import Mathlib.Analysis.NormedSpace.Basic #align_import data.is_R_or_C.basic from "leanprover-community/mathlib"@"baa88307f3e699fa7054ef04ec79fa4f056169cb" section local notation "π“š" => algebraMap ℝ _ open ComplexConjugate class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K, NormedAlgebra ℝ K, CompleteSpace K where re : K β†’+ ℝ im : K β†’+ ℝ I : K I_re_ax : re I = 0 I_mul_I_ax : I = 0 ∨ I * I = -1 re_add_im_ax : βˆ€ z : K, π“š (re z) + π“š (im z) * I = z ofReal_re_ax : βˆ€ r : ℝ, re (π“š r) = r ofReal_im_ax : βˆ€ r : ℝ, im (π“š r) = 0 mul_re_ax : βˆ€ z w : K, re (z * w) = re z * re w - im z * im w mul_im_ax : βˆ€ z w : K, im (z * w) = re z * im w + im z * re w conj_re_ax : βˆ€ z : K, re (conj z) = re z conj_im_ax : βˆ€ z : K, im (conj z) = -im z conj_I_ax : conj I = -I norm_sq_eq_def_ax : βˆ€ z : K, β€–zβ€– ^ 2 = re z * re z + im z * im z mul_im_I_ax : βˆ€ z : K, im z * im I = im z [toPartialOrder : PartialOrder K] le_iff_re_im {z w : K} : z ≀ w ↔ re z ≀ re w ∧ im z = im w -- note we cannot put this in the `extends` clause [toDecidableEq : DecidableEq K] #align is_R_or_C RCLike scoped[ComplexOrder] attribute [instance 100] RCLike.toPartialOrder attribute [instance 100] RCLike.toDecidableEq end variable {K E : Type*} [RCLike K] namespace RCLike open ComplexConjugate @[coe] abbrev ofReal : ℝ β†’ K := Algebra.cast noncomputable instance (priority := 900) algebraMapCoe : CoeTC ℝ K := ⟨ofReal⟩ #align is_R_or_C.algebra_map_coe RCLike.algebraMapCoe theorem ofReal_alg (x : ℝ) : (x : K) = x β€’ (1 : K) := Algebra.algebraMap_eq_smul_one x #align is_R_or_C.of_real_alg RCLike.ofReal_alg theorem real_smul_eq_coe_mul (r : ℝ) (z : K) : r β€’ z = (r : K) * z := Algebra.smul_def r z #align is_R_or_C.real_smul_eq_coe_mul RCLike.real_smul_eq_coe_mul theorem real_smul_eq_coe_smul [AddCommGroup E] [Module K E] [Module ℝ E] [IsScalarTower ℝ K E] (r : ℝ) (x : E) : r β€’ x = (r : K) β€’ x := by rw [RCLike.ofReal_alg, smul_one_smul] #align is_R_or_C.real_smul_eq_coe_smul RCLike.real_smul_eq_coe_smul theorem algebraMap_eq_ofReal : ⇑(algebraMap ℝ K) = ofReal := rfl #align is_R_or_C.algebra_map_eq_of_real RCLike.algebraMap_eq_ofReal @[simp, rclike_simps] theorem re_add_im (z : K) : (re z : K) + im z * I = z := RCLike.re_add_im_ax z #align is_R_or_C.re_add_im RCLike.re_add_im @[simp, norm_cast, rclike_simps] theorem ofReal_re : βˆ€ r : ℝ, re (r : K) = r := RCLike.ofReal_re_ax #align is_R_or_C.of_real_re RCLike.ofReal_re @[simp, norm_cast, rclike_simps] theorem ofReal_im : βˆ€ r : ℝ, im (r : K) = 0 := RCLike.ofReal_im_ax #align is_R_or_C.of_real_im RCLike.ofReal_im @[simp, rclike_simps] theorem mul_re : βˆ€ z w : K, re (z * w) = re z * re w - im z * im w := RCLike.mul_re_ax #align is_R_or_C.mul_re RCLike.mul_re @[simp, rclike_simps] theorem mul_im : βˆ€ z w : K, im (z * w) = re z * im w + im z * re w := RCLike.mul_im_ax #align is_R_or_C.mul_im RCLike.mul_im theorem ext_iff {z w : K} : z = w ↔ re z = re w ∧ im z = im w := ⟨fun h => h β–Έ ⟨rfl, rfl⟩, fun ⟨h₁, hβ‚‚βŸ© => re_add_im z β–Έ re_add_im w β–Έ h₁ β–Έ hβ‚‚ β–Έ rfl⟩ #align is_R_or_C.ext_iff RCLike.ext_iff theorem ext {z w : K} (hre : re z = re w) (him : im z = im w) : z = w := ext_iff.2 ⟨hre, him⟩ #align is_R_or_C.ext RCLike.ext @[norm_cast] theorem ofReal_zero : ((0 : ℝ) : K) = 0 := algebraMap.coe_zero #align is_R_or_C.of_real_zero RCLike.ofReal_zero @[rclike_simps] theorem zero_re' : re (0 : K) = (0 : ℝ) := map_zero re #align is_R_or_C.zero_re' RCLike.zero_re' @[norm_cast] theorem ofReal_one : ((1 : ℝ) : K) = 1 := map_one (algebraMap ℝ K) #align is_R_or_C.of_real_one RCLike.ofReal_one @[simp, rclike_simps] theorem one_re : re (1 : K) = 1 := by rw [← ofReal_one, ofReal_re] #align is_R_or_C.one_re RCLike.one_re @[simp, rclike_simps]
Mathlib/Analysis/RCLike/Basic.lean
166
166
theorem one_im : im (1 : K) = 0 := by
rw [← ofReal_one, ofReal_im]
1,644
import Mathlib.Algebra.Algebra.RestrictScalars import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.RCLike.Basic #align_import analysis.normed_space.extend from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open RCLike open ComplexConjugate variable {π•œ : Type*} [RCLike π•œ] {F : Type*} [SeminormedAddCommGroup F] [NormedSpace π•œ F] namespace LinearMap variable [Module ℝ F] [IsScalarTower ℝ π•œ F] noncomputable def extendToπ•œ' (fr : F β†’β‚—[ℝ] ℝ) : F β†’β‚—[π•œ] π•œ := by let fc : F β†’ π•œ := fun x => (fr x : π•œ) - (I : π•œ) * fr ((I : π•œ) β€’ x) have add : βˆ€ x y : F, fc (x + y) = fc x + fc y := by intro x y simp only [fc, smul_add, LinearMap.map_add, ofReal_add] rw [mul_add] abel have A : βˆ€ (c : ℝ) (x : F), (fr ((c : π•œ) β€’ x) : π•œ) = (c : π•œ) * (fr x : π•œ) := by intro c x rw [← ofReal_mul] congr 1 rw [RCLike.ofReal_alg, smul_assoc, fr.map_smul, Algebra.id.smul_eq_mul, one_smul] have smul_ℝ : βˆ€ (c : ℝ) (x : F), fc ((c : π•œ) β€’ x) = (c : π•œ) * fc x := by intro c x dsimp only [fc] rw [A c x, smul_smul, mul_comm I (c : π•œ), ← smul_smul, A, mul_sub] ring have smul_I : βˆ€ x : F, fc ((I : π•œ) β€’ x) = (I : π•œ) * fc x := by intro x dsimp only [fc] cases' @I_mul_I_ax π•œ _ with h h Β· simp [h] rw [mul_sub, ← mul_assoc, smul_smul, h] simp only [neg_mul, LinearMap.map_neg, one_mul, one_smul, mul_neg, ofReal_neg, neg_smul, sub_neg_eq_add, add_comm] have smul_π•œ : βˆ€ (c : π•œ) (x : F), fc (c β€’ x) = c β€’ fc x := by intro c x rw [← re_add_im c, add_smul, add_smul, add, smul_ℝ, ← smul_smul, smul_ℝ, smul_I, ← mul_assoc] rfl exact { toFun := fc map_add' := add map_smul' := smul_π•œ } #align linear_map.extend_to_π•œ' LinearMap.extendToπ•œ' theorem extendToπ•œ'_apply (fr : F β†’β‚—[ℝ] ℝ) (x : F) : fr.extendToπ•œ' x = (fr x : π•œ) - (I : π•œ) * (fr ((I : π•œ) β€’ x) : π•œ) := rfl #align linear_map.extend_to_π•œ'_apply LinearMap.extendToπ•œ'_apply @[simp]
Mathlib/Analysis/NormedSpace/Extend.lean
88
90
theorem extendToπ•œ'_apply_re (fr : F β†’β‚—[ℝ] ℝ) (x : F) : re (fr.extendToπ•œ' x : π•œ) = fr x := by
simp only [extendToπ•œ'_apply, map_sub, zero_mul, mul_zero, sub_zero, rclike_simps]
1,645
import Mathlib.Algebra.Algebra.RestrictScalars import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.RCLike.Basic #align_import analysis.normed_space.extend from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open RCLike open ComplexConjugate variable {π•œ : Type*} [RCLike π•œ] {F : Type*} [SeminormedAddCommGroup F] [NormedSpace π•œ F] namespace LinearMap variable [Module ℝ F] [IsScalarTower ℝ π•œ F] noncomputable def extendToπ•œ' (fr : F β†’β‚—[ℝ] ℝ) : F β†’β‚—[π•œ] π•œ := by let fc : F β†’ π•œ := fun x => (fr x : π•œ) - (I : π•œ) * fr ((I : π•œ) β€’ x) have add : βˆ€ x y : F, fc (x + y) = fc x + fc y := by intro x y simp only [fc, smul_add, LinearMap.map_add, ofReal_add] rw [mul_add] abel have A : βˆ€ (c : ℝ) (x : F), (fr ((c : π•œ) β€’ x) : π•œ) = (c : π•œ) * (fr x : π•œ) := by intro c x rw [← ofReal_mul] congr 1 rw [RCLike.ofReal_alg, smul_assoc, fr.map_smul, Algebra.id.smul_eq_mul, one_smul] have smul_ℝ : βˆ€ (c : ℝ) (x : F), fc ((c : π•œ) β€’ x) = (c : π•œ) * fc x := by intro c x dsimp only [fc] rw [A c x, smul_smul, mul_comm I (c : π•œ), ← smul_smul, A, mul_sub] ring have smul_I : βˆ€ x : F, fc ((I : π•œ) β€’ x) = (I : π•œ) * fc x := by intro x dsimp only [fc] cases' @I_mul_I_ax π•œ _ with h h Β· simp [h] rw [mul_sub, ← mul_assoc, smul_smul, h] simp only [neg_mul, LinearMap.map_neg, one_mul, one_smul, mul_neg, ofReal_neg, neg_smul, sub_neg_eq_add, add_comm] have smul_π•œ : βˆ€ (c : π•œ) (x : F), fc (c β€’ x) = c β€’ fc x := by intro c x rw [← re_add_im c, add_smul, add_smul, add, smul_ℝ, ← smul_smul, smul_ℝ, smul_I, ← mul_assoc] rfl exact { toFun := fc map_add' := add map_smul' := smul_π•œ } #align linear_map.extend_to_π•œ' LinearMap.extendToπ•œ' theorem extendToπ•œ'_apply (fr : F β†’β‚—[ℝ] ℝ) (x : F) : fr.extendToπ•œ' x = (fr x : π•œ) - (I : π•œ) * (fr ((I : π•œ) β€’ x) : π•œ) := rfl #align linear_map.extend_to_π•œ'_apply LinearMap.extendToπ•œ'_apply @[simp] theorem extendToπ•œ'_apply_re (fr : F β†’β‚—[ℝ] ℝ) (x : F) : re (fr.extendToπ•œ' x : π•œ) = fr x := by simp only [extendToπ•œ'_apply, map_sub, zero_mul, mul_zero, sub_zero, rclike_simps] #align linear_map.extend_to_π•œ'_apply_re LinearMap.extendToπ•œ'_apply_re
Mathlib/Analysis/NormedSpace/Extend.lean
93
99
theorem norm_extendToπ•œ'_apply_sq (fr : F β†’β‚—[ℝ] ℝ) (x : F) : β€–(fr.extendToπ•œ' x : π•œ)β€– ^ 2 = fr (conj (fr.extendToπ•œ' x : π•œ) β€’ x) := calc β€–(fr.extendToπ•œ' x : π•œ)β€– ^ 2 = re (conj (fr.extendToπ•œ' x) * fr.extendToπ•œ' x : π•œ) := by
rw [RCLike.conj_mul, ← ofReal_pow, ofReal_re] _ = fr (conj (fr.extendToπ•œ' x : π•œ) β€’ x) := by rw [← smul_eq_mul, ← map_smul, extendToπ•œ'_apply_re]
1,645
import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.locally_convex.continuous_of_bounded from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open TopologicalSpace Bornology Filter Topology Pointwise variable {π•œ π•œ' E F : Type*} variable [AddCommGroup E] [UniformSpace E] [UniformAddGroup E] variable [AddCommGroup F] [UniformSpace F] section RCLike open TopologicalSpace Bornology variable [FirstCountableTopology E] variable [RCLike π•œ] [Module π•œ E] [ContinuousSMul π•œ E] variable [RCLike π•œ'] [Module π•œ' F] [ContinuousSMul π•œ' F] variable {Οƒ : π•œ β†’+* π•œ'}
Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean
96
166
theorem LinearMap.continuousAt_zero_of_locally_bounded (f : E β†’β‚›β‚—[Οƒ] F) (hf : βˆ€ s, IsVonNBounded π•œ s β†’ IsVonNBounded π•œ' (f '' s)) : ContinuousAt f 0 := by
-- Assume that f is not continuous at 0 by_contra h -- We use a decreasing balanced basis for 0 : E and a balanced basis for 0 : F -- and reformulate non-continuity in terms of these bases rcases (nhds_basis_balanced π•œ E).exists_antitone_subbasis with ⟨b, bE1, bE⟩ simp only [_root_.id] at bE have bE' : (𝓝 (0 : E)).HasBasis (fun x : β„• => x β‰  0) fun n : β„• => (n : π•œ)⁻¹ β€’ b n := by refine bE.1.to_hasBasis ?_ ?_ Β· intro n _ use n + 1 simp only [Ne, Nat.succ_ne_zero, not_false_iff, Nat.cast_add, Nat.cast_one, true_and_iff] -- `b (n + 1) βŠ† b n` follows from `Antitone`. have h : b (n + 1) βŠ† b n := bE.2 (by simp) refine _root_.trans ?_ h rintro y ⟨x, hx, hy⟩ -- Since `b (n + 1)` is balanced `(n+1)⁻¹ b (n + 1) βŠ† b (n + 1)` rw [← hy] refine (bE1 (n + 1)).2.smul_mem ?_ hx have h' : 0 < (n : ℝ) + 1 := n.cast_add_one_pos rw [norm_inv, ← Nat.cast_one, ← Nat.cast_add, RCLike.norm_natCast, Nat.cast_add, Nat.cast_one, inv_le h' zero_lt_one] simp intro n hn -- The converse direction follows from continuity of the scalar multiplication have hcont : ContinuousAt (fun x : E => (n : π•œ) β€’ x) 0 := (continuous_const_smul (n : π•œ)).continuousAt simp only [ContinuousAt, map_zero, smul_zero] at hcont rw [bE.1.tendsto_left_iff] at hcont rcases hcont (b n) (bE1 n).1 with ⟨i, _, hi⟩ refine ⟨i, trivial, fun x hx => ⟨(n : π•œ) β€’ x, hi hx, ?_⟩⟩ simp [← mul_smul, hn] rw [ContinuousAt, map_zero, bE'.tendsto_iff (nhds_basis_balanced π•œ' F)] at h push_neg at h rcases h with ⟨V, ⟨hV, -⟩, h⟩ simp only [_root_.id, forall_true_left] at h -- There exists `u : β„• β†’ E` such that for all `n : β„•` we have `u n ∈ n⁻¹ β€’ b n` and `f (u n) βˆ‰ V` choose! u hu hu' using h -- The sequence `(fun n ↦ n β€’ u n)` converges to `0` have h_tendsto : Tendsto (fun n : β„• => (n : π•œ) β€’ u n) atTop (𝓝 (0 : E)) := by apply bE.tendsto intro n by_cases h : n = 0 Β· rw [h, Nat.cast_zero, zero_smul] exact mem_of_mem_nhds (bE.1.mem_of_mem <| by trivial) rcases hu n h with ⟨y, hy, hu1⟩ convert hy rw [← hu1, ← mul_smul] simp only [h, mul_inv_cancel, Ne, Nat.cast_eq_zero, not_false_iff, one_smul] -- The image `(fun n ↦ n β€’ u n)` is von Neumann bounded: have h_bounded : IsVonNBounded π•œ (Set.range fun n : β„• => (n : π•œ) β€’ u n) := h_tendsto.cauchySeq.totallyBounded_range.isVonNBounded π•œ -- Since `range u` is bounded, `V` absorbs it rcases (hf _ h_bounded hV).exists_pos with ⟨r, hr, h'⟩ cases' exists_nat_gt r with n hn -- We now find a contradiction between `f (u n) βˆ‰ V` and the absorbing property have h1 : r ≀ β€–(n : π•œ')β€– := by rw [RCLike.norm_natCast] exact hn.le have hn' : 0 < β€–(n : π•œ')β€– := lt_of_lt_of_le hr h1 rw [norm_pos_iff, Ne, Nat.cast_eq_zero] at hn' have h'' : f (u n) ∈ V := by simp only [Set.image_subset_iff] at h' specialize h' (n : π•œ') h1 (Set.mem_range_self n) simp only [Set.mem_preimage, LinearMap.map_smulβ‚›β‚—, map_natCast] at h' rcases h' with ⟨y, hy, h'⟩ apply_fun fun y : F => (n : π•œ')⁻¹ β€’ y at h' simp only [hn', inv_smul_smulβ‚€, Ne, Nat.cast_eq_zero, not_false_iff] at h' rwa [← h'] exact hu' n hn' h''
1,646
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def
Mathlib/Analysis/Convex/Gauge.lean
66
68
theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by
congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono
Mathlib/Analysis/Convex/Gauge.lean
86
89
theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by
obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp]
Mathlib/Analysis/Convex/Gauge.lean
95
99
theorem gauge_zero : gauge s 0 = 0 := by
rw [gauge_def'] by_cases h : (0 : E) ∈ s · simp only [smul_zero, sep_true, h, csInf_Ioi] · simp only [smul_zero, sep_false, h, Real.sInf_empty]
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp]
Mathlib/Analysis/Convex/Gauge.lean
103
110
theorem gauge_zero' : gauge (0 : Set E) = 0 := by
ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp]
Mathlib/Analysis/Convex/Gauge.lean
114
116
theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by
ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false]
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp] theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false] #align gauge_empty gauge_empty
Mathlib/Analysis/Convex/Gauge.lean
119
121
theorem gauge_of_subset_zero (h : s βŠ† 0) : gauge s = 0 := by
obtain rfl | rfl := subset_singleton_iff_eq.1 h exacts [gauge_empty, gauge_zero']
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp] theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false] #align gauge_empty gauge_empty theorem gauge_of_subset_zero (h : s βŠ† 0) : gauge s = 0 := by obtain rfl | rfl := subset_singleton_iff_eq.1 h exacts [gauge_empty, gauge_zero'] #align gauge_of_subset_zero gauge_of_subset_zero theorem gauge_nonneg (x : E) : 0 ≀ gauge s x := Real.sInf_nonneg _ fun _ hx => hx.1.le #align gauge_nonneg gauge_nonneg
Mathlib/Analysis/Convex/Gauge.lean
129
131
theorem gauge_neg (symmetric : βˆ€ x ∈ s, -x ∈ s) (x : E) : gauge s (-x) = gauge s x := by
have : βˆ€ x, -x ∈ s ↔ x ∈ s := fun x => ⟨fun h => by simpa using symmetric _ h, symmetric x⟩ simp_rw [gauge_def', smul_neg, this]
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp] theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false] #align gauge_empty gauge_empty theorem gauge_of_subset_zero (h : s βŠ† 0) : gauge s = 0 := by obtain rfl | rfl := subset_singleton_iff_eq.1 h exacts [gauge_empty, gauge_zero'] #align gauge_of_subset_zero gauge_of_subset_zero theorem gauge_nonneg (x : E) : 0 ≀ gauge s x := Real.sInf_nonneg _ fun _ hx => hx.1.le #align gauge_nonneg gauge_nonneg theorem gauge_neg (symmetric : βˆ€ x ∈ s, -x ∈ s) (x : E) : gauge s (-x) = gauge s x := by have : βˆ€ x, -x ∈ s ↔ x ∈ s := fun x => ⟨fun h => by simpa using symmetric _ h, symmetric x⟩ simp_rw [gauge_def', smul_neg, this] #align gauge_neg gauge_neg
Mathlib/Analysis/Convex/Gauge.lean
134
135
theorem gauge_neg_set_neg (x : E) : gauge (-s) (-x) = gauge s x := by
simp_rw [gauge_def', smul_neg, neg_mem_neg]
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp] theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false] #align gauge_empty gauge_empty theorem gauge_of_subset_zero (h : s βŠ† 0) : gauge s = 0 := by obtain rfl | rfl := subset_singleton_iff_eq.1 h exacts [gauge_empty, gauge_zero'] #align gauge_of_subset_zero gauge_of_subset_zero theorem gauge_nonneg (x : E) : 0 ≀ gauge s x := Real.sInf_nonneg _ fun _ hx => hx.1.le #align gauge_nonneg gauge_nonneg theorem gauge_neg (symmetric : βˆ€ x ∈ s, -x ∈ s) (x : E) : gauge s (-x) = gauge s x := by have : βˆ€ x, -x ∈ s ↔ x ∈ s := fun x => ⟨fun h => by simpa using symmetric _ h, symmetric x⟩ simp_rw [gauge_def', smul_neg, this] #align gauge_neg gauge_neg theorem gauge_neg_set_neg (x : E) : gauge (-s) (-x) = gauge s x := by simp_rw [gauge_def', smul_neg, neg_mem_neg] #align gauge_neg_set_neg gauge_neg_set_neg
Mathlib/Analysis/Convex/Gauge.lean
138
139
theorem gauge_neg_set_eq_gauge_neg (x : E) : gauge (-s) x = gauge s (-x) := by
rw [← gauge_neg_set_neg, neg_neg]
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp] theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false] #align gauge_empty gauge_empty theorem gauge_of_subset_zero (h : s βŠ† 0) : gauge s = 0 := by obtain rfl | rfl := subset_singleton_iff_eq.1 h exacts [gauge_empty, gauge_zero'] #align gauge_of_subset_zero gauge_of_subset_zero theorem gauge_nonneg (x : E) : 0 ≀ gauge s x := Real.sInf_nonneg _ fun _ hx => hx.1.le #align gauge_nonneg gauge_nonneg theorem gauge_neg (symmetric : βˆ€ x ∈ s, -x ∈ s) (x : E) : gauge s (-x) = gauge s x := by have : βˆ€ x, -x ∈ s ↔ x ∈ s := fun x => ⟨fun h => by simpa using symmetric _ h, symmetric x⟩ simp_rw [gauge_def', smul_neg, this] #align gauge_neg gauge_neg theorem gauge_neg_set_neg (x : E) : gauge (-s) (-x) = gauge s x := by simp_rw [gauge_def', smul_neg, neg_mem_neg] #align gauge_neg_set_neg gauge_neg_set_neg theorem gauge_neg_set_eq_gauge_neg (x : E) : gauge (-s) x = gauge s (-x) := by rw [← gauge_neg_set_neg, neg_neg] #align gauge_neg_set_eq_gauge_neg gauge_neg_set_eq_gauge_neg
Mathlib/Analysis/Convex/Gauge.lean
142
145
theorem gauge_le_of_mem (ha : 0 ≀ a) (hx : x ∈ a β€’ s) : gauge s x ≀ a := by
obtain rfl | ha' := ha.eq_or_lt · rw [mem_singleton_iff.1 (zero_smul_set_subset _ hx), gauge_zero] · exact csInf_le gauge_set_bddBelow ⟨ha', hx⟩
1,647
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩ #align exists_lt_of_gauge_lt exists_lt_of_gauge_lt @[simp] theorem gauge_zero : gauge s 0 = 0 := by rw [gauge_def'] by_cases h : (0 : E) ∈ s Β· simp only [smul_zero, sep_true, h, csInf_Ioi] Β· simp only [smul_zero, sep_false, h, Real.sInf_empty] #align gauge_zero gauge_zero @[simp] theorem gauge_zero' : gauge (0 : Set E) = 0 := by ext x rw [gauge_def'] obtain rfl | hx := eq_or_ne x 0 Β· simp only [csInf_Ioi, mem_zero, Pi.zero_apply, eq_self_iff_true, sep_true, smul_zero] Β· simp only [mem_zero, Pi.zero_apply, inv_eq_zero, smul_eq_zero] convert Real.sInf_empty exact eq_empty_iff_forall_not_mem.2 fun r hr => hr.2.elim (ne_of_gt hr.1) hx #align gauge_zero' gauge_zero' @[simp] theorem gauge_empty : gauge (βˆ… : Set E) = 0 := by ext simp only [gauge_def', Real.sInf_empty, mem_empty_iff_false, Pi.zero_apply, sep_false] #align gauge_empty gauge_empty theorem gauge_of_subset_zero (h : s βŠ† 0) : gauge s = 0 := by obtain rfl | rfl := subset_singleton_iff_eq.1 h exacts [gauge_empty, gauge_zero'] #align gauge_of_subset_zero gauge_of_subset_zero theorem gauge_nonneg (x : E) : 0 ≀ gauge s x := Real.sInf_nonneg _ fun _ hx => hx.1.le #align gauge_nonneg gauge_nonneg theorem gauge_neg (symmetric : βˆ€ x ∈ s, -x ∈ s) (x : E) : gauge s (-x) = gauge s x := by have : βˆ€ x, -x ∈ s ↔ x ∈ s := fun x => ⟨fun h => by simpa using symmetric _ h, symmetric x⟩ simp_rw [gauge_def', smul_neg, this] #align gauge_neg gauge_neg theorem gauge_neg_set_neg (x : E) : gauge (-s) (-x) = gauge s x := by simp_rw [gauge_def', smul_neg, neg_mem_neg] #align gauge_neg_set_neg gauge_neg_set_neg theorem gauge_neg_set_eq_gauge_neg (x : E) : gauge (-s) x = gauge s (-x) := by rw [← gauge_neg_set_neg, neg_neg] #align gauge_neg_set_eq_gauge_neg gauge_neg_set_eq_gauge_neg theorem gauge_le_of_mem (ha : 0 ≀ a) (hx : x ∈ a β€’ s) : gauge s x ≀ a := by obtain rfl | ha' := ha.eq_or_lt Β· rw [mem_singleton_iff.1 (zero_smul_set_subset _ hx), gauge_zero] Β· exact csInf_le gauge_set_bddBelow ⟨ha', hx⟩ #align gauge_le_of_mem gauge_le_of_mem
Mathlib/Analysis/Convex/Gauge.lean
148
163
theorem gauge_le_eq (hs₁ : Convex ℝ s) (hsβ‚€ : (0 : E) ∈ s) (hsβ‚‚ : Absorbent ℝ s) (ha : 0 ≀ a) : { x | gauge s x ≀ a } = β‹‚ (r : ℝ) (_ : a < r), r β€’ s := by
ext x simp_rw [Set.mem_iInter, Set.mem_setOf_eq] refine ⟨fun h r hr => ?_, fun h => le_of_forall_pos_lt_add fun Ξ΅ hΞ΅ => ?_⟩ Β· have hr' := ha.trans_lt hr rw [mem_smul_set_iff_inv_smul_memβ‚€ hr'.ne'] obtain ⟨δ, Ξ΄_pos, hΞ΄r, hδ⟩ := exists_lt_of_gauge_lt hsβ‚‚ (h.trans_lt hr) suffices (r⁻¹ * Ξ΄) β€’ δ⁻¹ β€’ x ∈ s by rwa [smul_smul, mul_inv_cancel_rightβ‚€ Ξ΄_pos.ne'] at this rw [mem_smul_set_iff_inv_smul_memβ‚€ Ξ΄_pos.ne'] at hΞ΄ refine hs₁.smul_mem_of_zero_mem hsβ‚€ hΞ΄ ⟨by positivity, ?_⟩ rw [inv_mul_le_iff hr', mul_one] exact hΞ΄r.le Β· have hΞ΅' := (lt_add_iff_pos_right a).2 (half_pos hΞ΅) exact (gauge_le_of_mem (ha.trans hΞ΅'.le) <| h _ hΞ΅').trans_lt (add_lt_add_left (half_lt_self hΞ΅) _)
1,647
import Mathlib.Analysis.LocallyConvex.BalancedCoreHull import Mathlib.Analysis.LocallyConvex.WithSeminorms import Mathlib.Analysis.Convex.Gauge #align_import analysis.locally_convex.abs_convex from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open NormedField Set open NNReal Pointwise Topology variable {π•œ E F G ΞΉ : Type*} section NontriviallyNormedField variable (π•œ E) {s : Set E} variable [NontriviallyNormedField π•œ] [AddCommGroup E] [Module π•œ E] variable [Module ℝ E] [SMulCommClass ℝ π•œ E] variable [TopologicalSpace E] [LocallyConvexSpace ℝ E] [ContinuousSMul π•œ E]
Mathlib/Analysis/LocallyConvex/AbsConvex.lean
52
60
theorem nhds_basis_abs_convex : (𝓝 (0 : E)).HasBasis (fun s : Set E => s ∈ 𝓝 (0 : E) ∧ Balanced π•œ s ∧ Convex ℝ s) id := by
refine (LocallyConvexSpace.convex_basis_zero ℝ E).to_hasBasis (fun s hs => ?_) fun s hs => ⟨s, ⟨hs.1, hs.2.2⟩, rfl.subset⟩ refine ⟨convexHull ℝ (balancedCore π•œ s), ?_, convexHull_min (balancedCore_subset s) hs.2⟩ refine ⟨Filter.mem_of_superset (balancedCore_mem_nhds_zero hs.1) (subset_convexHull ℝ _), ?_⟩ refine ⟨(balancedCore_balanced s).convexHull, ?_⟩ exact convex_convexHull ℝ (balancedCore π•œ s)
1,648
import Mathlib.Analysis.LocallyConvex.BalancedCoreHull import Mathlib.Analysis.LocallyConvex.WithSeminorms import Mathlib.Analysis.Convex.Gauge #align_import analysis.locally_convex.abs_convex from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open NormedField Set open NNReal Pointwise Topology variable {π•œ E F G ΞΉ : Type*} section NontriviallyNormedField variable (π•œ E) {s : Set E} variable [NontriviallyNormedField π•œ] [AddCommGroup E] [Module π•œ E] variable [Module ℝ E] [SMulCommClass ℝ π•œ E] variable [TopologicalSpace E] [LocallyConvexSpace ℝ E] [ContinuousSMul π•œ E] theorem nhds_basis_abs_convex : (𝓝 (0 : E)).HasBasis (fun s : Set E => s ∈ 𝓝 (0 : E) ∧ Balanced π•œ s ∧ Convex ℝ s) id := by refine (LocallyConvexSpace.convex_basis_zero ℝ E).to_hasBasis (fun s hs => ?_) fun s hs => ⟨s, ⟨hs.1, hs.2.2⟩, rfl.subset⟩ refine ⟨convexHull ℝ (balancedCore π•œ s), ?_, convexHull_min (balancedCore_subset s) hs.2⟩ refine ⟨Filter.mem_of_superset (balancedCore_mem_nhds_zero hs.1) (subset_convexHull ℝ _), ?_⟩ refine ⟨(balancedCore_balanced s).convexHull, ?_⟩ exact convex_convexHull ℝ (balancedCore π•œ s) #align nhds_basis_abs_convex nhds_basis_abs_convex variable [ContinuousSMul ℝ E] [TopologicalAddGroup E]
Mathlib/Analysis/LocallyConvex/AbsConvex.lean
65
74
theorem nhds_basis_abs_convex_open : (𝓝 (0 : E)).HasBasis (fun s => (0 : E) ∈ s ∧ IsOpen s ∧ Balanced π•œ s ∧ Convex ℝ s) id := by
refine (nhds_basis_abs_convex π•œ E).to_hasBasis ?_ ?_ Β· rintro s ⟨hs_nhds, hs_balanced, hs_convex⟩ refine ⟨interior s, ?_, interior_subset⟩ exact ⟨mem_interior_iff_mem_nhds.mpr hs_nhds, isOpen_interior, hs_balanced.interior (mem_interior_iff_mem_nhds.mpr hs_nhds), hs_convex.interior⟩ rintro s ⟨hs_zero, hs_open, hs_balanced, hs_convex⟩ exact ⟨s, ⟨hs_open.mem_nhds hs_zero, hs_balanced, hs_convex⟩, rfl.subset⟩
1,648
import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Pointwise #align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric variable {π•œ : Type*} [RCLike π•œ] {E : Type*} [NormedAddCommGroup E]
Mathlib/Analysis/NormedSpace/RCLike.lean
36
36
theorem RCLike.norm_coe_norm {z : E} : β€–(β€–zβ€– : π•œ)β€– = β€–zβ€– := by
simp
1,649
import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Pointwise #align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric variable {π•œ : Type*} [RCLike π•œ] {E : Type*} [NormedAddCommGroup E] theorem RCLike.norm_coe_norm {z : E} : β€–(β€–zβ€– : π•œ)β€– = β€–zβ€– := by simp #align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm variable [NormedSpace π•œ E] @[simp]
Mathlib/Analysis/NormedSpace/RCLike.lean
43
45
theorem norm_smul_inv_norm {x : E} (hx : x β‰  0) : β€–(β€–x‖⁻¹ : π•œ) β€’ xβ€– = 1 := by
have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul]
1,649
import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Pointwise #align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric variable {π•œ : Type*} [RCLike π•œ] {E : Type*} [NormedAddCommGroup E] theorem RCLike.norm_coe_norm {z : E} : β€–(β€–zβ€– : π•œ)β€– = β€–zβ€– := by simp #align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm variable [NormedSpace π•œ E] @[simp] theorem norm_smul_inv_norm {x : E} (hx : x β‰  0) : β€–(β€–x‖⁻¹ : π•œ) β€’ xβ€– = 1 := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul] #align norm_smul_inv_norm norm_smul_inv_norm
Mathlib/Analysis/NormedSpace/RCLike.lean
49
52
theorem norm_smul_inv_norm' {r : ℝ} (r_nonneg : 0 ≀ r) {x : E} (hx : x β‰  0) : β€–((r : π•œ) * (β€–xβ€– : π•œ)⁻¹) β€’ xβ€– = r := by
have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul, r_nonneg, rclike_simps]
1,649
import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Pointwise #align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric variable {π•œ : Type*} [RCLike π•œ] {E : Type*} [NormedAddCommGroup E] theorem RCLike.norm_coe_norm {z : E} : β€–(β€–zβ€– : π•œ)β€– = β€–zβ€– := by simp #align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm variable [NormedSpace π•œ E] @[simp] theorem norm_smul_inv_norm {x : E} (hx : x β‰  0) : β€–(β€–x‖⁻¹ : π•œ) β€’ xβ€– = 1 := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul] #align norm_smul_inv_norm norm_smul_inv_norm theorem norm_smul_inv_norm' {r : ℝ} (r_nonneg : 0 ≀ r) {x : E} (hx : x β‰  0) : β€–((r : π•œ) * (β€–xβ€– : π•œ)⁻¹) β€’ xβ€– = r := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul, r_nonneg, rclike_simps] #align norm_smul_inv_norm' norm_smul_inv_norm'
Mathlib/Analysis/NormedSpace/RCLike.lean
55
75
theorem LinearMap.bound_of_sphere_bound {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’β‚—[π•œ] π•œ) (h : βˆ€ z ∈ sphere (0 : E) r, β€–f zβ€– ≀ c) (z : E) : β€–f zβ€– ≀ c / r * β€–zβ€– := by
by_cases z_zero : z = 0 Β· rw [z_zero] simp only [LinearMap.map_zero, norm_zero, mul_zero] exact le_rfl set z₁ := ((r : π•œ) * (β€–zβ€– : π•œ)⁻¹) β€’ z with hz₁ have norm_f_z₁ : β€–f z₁‖ ≀ c := by apply h rw [mem_sphere_zero_iff_norm] exact norm_smul_inv_norm' r_pos.le z_zero have r_ne_zero : (r : π•œ) β‰  0 := RCLike.ofReal_ne_zero.mpr r_pos.ne' have eq : f z = β€–zβ€– / r * f z₁ := by rw [hz₁, LinearMap.map_smul, smul_eq_mul] rw [← mul_assoc, ← mul_assoc, div_mul_cancelβ‚€ _ r_ne_zero, mul_inv_cancel, one_mul] simp only [z_zero, RCLike.ofReal_eq_zero, norm_eq_zero, Ne, not_false_iff] rw [eq, norm_mul, norm_div, RCLike.norm_coe_norm, RCLike.norm_of_nonneg r_pos.le, div_mul_eq_mul_div, div_mul_eq_mul_div, mul_comm] apply div_le_div _ _ r_pos rfl.ge Β· exact mul_nonneg ((norm_nonneg _).trans norm_f_z₁) (norm_nonneg z) apply mul_le_mul norm_f_z₁ rfl.le (norm_nonneg z) ((norm_nonneg _).trans norm_f_z₁)
1,649
import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Pointwise #align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric variable {π•œ : Type*} [RCLike π•œ] {E : Type*} [NormedAddCommGroup E] theorem RCLike.norm_coe_norm {z : E} : β€–(β€–zβ€– : π•œ)β€– = β€–zβ€– := by simp #align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm variable [NormedSpace π•œ E] @[simp] theorem norm_smul_inv_norm {x : E} (hx : x β‰  0) : β€–(β€–x‖⁻¹ : π•œ) β€’ xβ€– = 1 := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul] #align norm_smul_inv_norm norm_smul_inv_norm theorem norm_smul_inv_norm' {r : ℝ} (r_nonneg : 0 ≀ r) {x : E} (hx : x β‰  0) : β€–((r : π•œ) * (β€–xβ€– : π•œ)⁻¹) β€’ xβ€– = r := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul, r_nonneg, rclike_simps] #align norm_smul_inv_norm' norm_smul_inv_norm' theorem LinearMap.bound_of_sphere_bound {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’β‚—[π•œ] π•œ) (h : βˆ€ z ∈ sphere (0 : E) r, β€–f zβ€– ≀ c) (z : E) : β€–f zβ€– ≀ c / r * β€–zβ€– := by by_cases z_zero : z = 0 Β· rw [z_zero] simp only [LinearMap.map_zero, norm_zero, mul_zero] exact le_rfl set z₁ := ((r : π•œ) * (β€–zβ€– : π•œ)⁻¹) β€’ z with hz₁ have norm_f_z₁ : β€–f z₁‖ ≀ c := by apply h rw [mem_sphere_zero_iff_norm] exact norm_smul_inv_norm' r_pos.le z_zero have r_ne_zero : (r : π•œ) β‰  0 := RCLike.ofReal_ne_zero.mpr r_pos.ne' have eq : f z = β€–zβ€– / r * f z₁ := by rw [hz₁, LinearMap.map_smul, smul_eq_mul] rw [← mul_assoc, ← mul_assoc, div_mul_cancelβ‚€ _ r_ne_zero, mul_inv_cancel, one_mul] simp only [z_zero, RCLike.ofReal_eq_zero, norm_eq_zero, Ne, not_false_iff] rw [eq, norm_mul, norm_div, RCLike.norm_coe_norm, RCLike.norm_of_nonneg r_pos.le, div_mul_eq_mul_div, div_mul_eq_mul_div, mul_comm] apply div_le_div _ _ r_pos rfl.ge Β· exact mul_nonneg ((norm_nonneg _).trans norm_f_z₁) (norm_nonneg z) apply mul_le_mul norm_f_z₁ rfl.le (norm_nonneg z) ((norm_nonneg _).trans norm_f_z₁) #align linear_map.bound_of_sphere_bound LinearMap.bound_of_sphere_bound theorem LinearMap.bound_of_ball_bound' {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’β‚—[π•œ] π•œ) (h : βˆ€ z ∈ closedBall (0 : E) r, β€–f zβ€– ≀ c) (z : E) : β€–f zβ€– ≀ c / r * β€–zβ€– := f.bound_of_sphere_bound r_pos c (fun z hz => h z hz.le) z #align linear_map.bound_of_ball_bound' LinearMap.bound_of_ball_bound'
Mathlib/Analysis/NormedSpace/RCLike.lean
85
93
theorem ContinuousLinearMap.opNorm_bound_of_ball_bound {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’L[π•œ] π•œ) (h : βˆ€ z ∈ closedBall (0 : E) r, β€–f zβ€– ≀ c) : β€–fβ€– ≀ c / r := by
apply ContinuousLinearMap.opNorm_le_bound Β· apply div_nonneg _ r_pos.le exact (norm_nonneg _).trans (h 0 (by simp only [norm_zero, mem_closedBall, dist_zero_left, r_pos.le])) apply LinearMap.bound_of_ball_bound' r_pos exact fun z hz => h z hz
1,649
import Mathlib.Algebra.DirectSum.Basic import Mathlib.LinearAlgebra.DFinsupp import Mathlib.LinearAlgebra.Basis #align_import algebra.direct_sum.module from "leanprover-community/mathlib"@"6623e6af705e97002a9054c1c05a980180276fc1" universe u v w u₁ namespace DirectSum open DirectSum section General variable {R : Type u} [Semiring R] variable {ΞΉ : Type v} [dec_ΞΉ : DecidableEq ΞΉ] variable {M : ΞΉ β†’ Type w} [βˆ€ i, AddCommMonoid (M i)] [βˆ€ i, Module R (M i)] instance : Module R (⨁ i, M i) := DFinsupp.module instance {S : Type*} [Semiring S] [βˆ€ i, Module S (M i)] [βˆ€ i, SMulCommClass R S (M i)] : SMulCommClass R S (⨁ i, M i) := DFinsupp.smulCommClass instance {S : Type*} [Semiring S] [SMul R S] [βˆ€ i, Module S (M i)] [βˆ€ i, IsScalarTower R S (M i)] : IsScalarTower R S (⨁ i, M i) := DFinsupp.isScalarTower instance [βˆ€ i, Module Rᡐᡒᡖ (M i)] [βˆ€ i, IsCentralScalar R (M i)] : IsCentralScalar R (⨁ i, M i) := DFinsupp.isCentralScalar theorem smul_apply (b : R) (v : ⨁ i, M i) (i : ΞΉ) : (b β€’ v) i = b β€’ v i := DFinsupp.smul_apply _ _ _ #align direct_sum.smul_apply DirectSum.smul_apply variable (R ΞΉ M) def lmk : βˆ€ s : Finset ΞΉ, (βˆ€ i : (↑s : Set ΞΉ), M i.val) β†’β‚—[R] ⨁ i, M i := DFinsupp.lmk #align direct_sum.lmk DirectSum.lmk def lof : βˆ€ i : ΞΉ, M i β†’β‚—[R] ⨁ i, M i := DFinsupp.lsingle #align direct_sum.lof DirectSum.lof theorem lof_eq_of (i : ΞΉ) (b : M i) : lof R ΞΉ M i b = of M i b := rfl #align direct_sum.lof_eq_of DirectSum.lof_eq_of variable {ΞΉ M} theorem single_eq_lof (i : ΞΉ) (b : M i) : DFinsupp.single i b = lof R ΞΉ M i b := rfl #align direct_sum.single_eq_lof DirectSum.single_eq_lof theorem mk_smul (s : Finset ΞΉ) (c : R) (x) : mk M s (c β€’ x) = c β€’ mk M s x := (lmk R ΞΉ M s).map_smul c x #align direct_sum.mk_smul DirectSum.mk_smul theorem of_smul (i : ΞΉ) (c : R) (x) : of M i (c β€’ x) = c β€’ of M i x := (lof R ΞΉ M i).map_smul c x #align direct_sum.of_smul DirectSum.of_smul variable {R} theorem support_smul [βˆ€ (i : ΞΉ) (x : M i), Decidable (x β‰  0)] (c : R) (v : ⨁ i, M i) : (c β€’ v).support βŠ† v.support := DFinsupp.support_smul _ _ #align direct_sum.support_smul DirectSum.support_smul variable {N : Type u₁} [AddCommMonoid N] [Module R N] variable (Ο† : βˆ€ i, M i β†’β‚—[R] N) variable (R ΞΉ N) def toModule : (⨁ i, M i) β†’β‚—[R] N := DFunLike.coe (DFinsupp.lsum β„•) Ο† #align direct_sum.to_module DirectSum.toModule theorem coe_toModule_eq_coe_toAddMonoid : (toModule R ΞΉ N Ο† : (⨁ i, M i) β†’ N) = toAddMonoid fun i ↦ (Ο† i).toAddMonoidHom := rfl #align direct_sum.coe_to_module_eq_coe_to_add_monoid DirectSum.coe_toModule_eq_coe_toAddMonoid variable {ΞΉ N Ο†} @[simp] theorem toModule_lof (i) (x : M i) : toModule R ΞΉ N Ο† (lof R ΞΉ M i x) = Ο† i x := toAddMonoid_of (fun i ↦ (Ο† i).toAddMonoidHom) i x #align direct_sum.to_module_lof DirectSum.toModule_lof variable (ψ : (⨁ i, M i) β†’β‚—[R] N) theorem toModule.unique (f : ⨁ i, M i) : ψ f = toModule R ΞΉ N (fun i ↦ ψ.comp <| lof R ΞΉ M i) f := toAddMonoid.unique ψ.toAddMonoidHom f #align direct_sum.to_module.unique DirectSum.toModule.unique variable {ψ} {ψ' : (⨁ i, M i) β†’β‚—[R] N} @[ext] theorem linearMap_ext β¦ƒΟˆ ψ' : (⨁ i, M i) β†’β‚—[R] N⦄ (H : βˆ€ i, ψ.comp (lof R ΞΉ M i) = ψ'.comp (lof R ΞΉ M i)) : ψ = ψ' := DFinsupp.lhom_ext' H #align direct_sum.linear_map_ext DirectSum.linearMap_ext def lsetToSet (S T : Set ΞΉ) (H : S βŠ† T) : (⨁ i : S, M i) β†’β‚—[R] ⨁ i : T, M i := toModule R _ _ fun i ↦ lof R T (fun i : Subtype T ↦ M i) ⟨i, H i.prop⟩ #align direct_sum.lset_to_set DirectSum.lsetToSet variable (ΞΉ M) @[simps apply] def linearEquivFunOnFintype [Fintype ΞΉ] : (⨁ i, M i) ≃ₗ[R] βˆ€ i, M i := { DFinsupp.equivFunOnFintype with toFun := (↑) map_add' := fun f g ↦ by ext rw [add_apply, Pi.add_apply] map_smul' := fun c f ↦ by simp_rw [RingHom.id_apply] rw [DFinsupp.coe_smul] } #align direct_sum.linear_equiv_fun_on_fintype DirectSum.linearEquivFunOnFintype variable {ΞΉ M} @[simp]
Mathlib/Algebra/DirectSum/Module.lean
164
168
theorem linearEquivFunOnFintype_lof [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (m : M i) : (linearEquivFunOnFintype R ΞΉ M) (lof R ΞΉ M i m) = Pi.single i m := by
ext a change (DFinsupp.equivFunOnFintype (lof R ΞΉ M i m)) a = _ convert _root_.congr_fun (DFinsupp.equivFunOnFintype_single i m) a
1,650
import Mathlib.Data.Finset.Order import Mathlib.Algebra.DirectSum.Module import Mathlib.RingTheory.FreeCommRing import Mathlib.RingTheory.Ideal.Maps import Mathlib.RingTheory.Ideal.Quotient import Mathlib.Tactic.SuppressCompilation #align_import algebra.direct_limit from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" suppress_compilation universe u v v' v'' w u₁ open Submodule variable {R : Type u} [Ring R] variable {ΞΉ : Type v} variable [Preorder ΞΉ] variable (G : ΞΉ β†’ Type w) class DirectedSystem (f : βˆ€ i j, i ≀ j β†’ G i β†’ G j) : Prop where map_self' : βˆ€ i x h, f i i h x = x map_map' : βˆ€ {i j k} (hij hjk x), f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x #align directed_system DirectedSystem section variable {G} (f : βˆ€ i j, i ≀ j β†’ G i β†’ G j) [DirectedSystem G fun i j h => f i j h] theorem DirectedSystem.map_self i x h : f i i h x = x := DirectedSystem.map_self' i x h theorem DirectedSystem.map_map {i j k} (hij hjk x) : f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x := DirectedSystem.map_map' hij hjk x end namespace Module variable [βˆ€ i, AddCommGroup (G i)] [βˆ€ i, Module R (G i)] variable {G} (f : βˆ€ i j, i ≀ j β†’ G i β†’β‚—[R] G j) nonrec theorem DirectedSystem.map_self [DirectedSystem G fun i j h => f i j h] (i x h) : f i i h x = x := DirectedSystem.map_self (fun i j h => f i j h) i x h #align module.directed_system.map_self Module.DirectedSystem.map_self nonrec theorem DirectedSystem.map_map [DirectedSystem G fun i j h => f i j h] {i j k} (hij hjk x) : f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x := DirectedSystem.map_map (fun i j h => f i j h) hij hjk x #align module.directed_system.map_map Module.DirectedSystem.map_map variable (G) variable [DecidableEq ΞΉ] def DirectLimit : Type max v w := DirectSum ΞΉ G β§Έ (span R <| { a | βˆƒ (i j : _) (H : i ≀ j) (x : _), DirectSum.lof R ΞΉ G i x - DirectSum.lof R ΞΉ G j (f i j H x) = a }) #align module.direct_limit Module.DirectLimit namespace DirectLimit instance addCommGroup : AddCommGroup (DirectLimit G f) := Quotient.addCommGroup _ instance module : Module R (DirectLimit G f) := Quotient.module _ instance inhabited : Inhabited (DirectLimit G f) := ⟨0⟩ instance unique [IsEmpty ΞΉ] : Unique (DirectLimit G f) := inferInstanceAs <| Unique (Quotient _) variable (R ΞΉ) def of (i) : G i β†’β‚—[R] DirectLimit G f := (mkQ _).comp <| DirectSum.lof R ΞΉ G i #align module.direct_limit.of Module.DirectLimit.of variable {R ΞΉ G f} @[simp] theorem of_f {i j hij x} : of R ΞΉ G f j (f i j hij x) = of R ΞΉ G f i x := Eq.symm <| (Submodule.Quotient.eq _).2 <| subset_span ⟨i, j, hij, x, rfl⟩ #align module.direct_limit.of_f Module.DirectLimit.of_f theorem exists_of [Nonempty ΞΉ] [IsDirected ΞΉ (Β· ≀ Β·)] (z : DirectLimit G f) : βˆƒ i x, of R ΞΉ G f i x = z := Nonempty.elim (by infer_instance) fun ind : ΞΉ => Quotient.inductionOn' z fun z => DirectSum.induction_on z ⟨ind, 0, LinearMap.map_zero _⟩ (fun i x => ⟨i, x, rfl⟩) fun p q ⟨i, x, ihx⟩ ⟨j, y, ihy⟩ => let ⟨k, hik, hjk⟩ := exists_ge_ge i j ⟨k, f i k hik x + f j k hjk y, by rw [LinearMap.map_add, of_f, of_f, ihx, ihy] rfl ⟩ #align module.direct_limit.exists_of Module.DirectLimit.exists_of @[elab_as_elim] protected theorem induction_on [Nonempty ΞΉ] [IsDirected ΞΉ (Β· ≀ Β·)] {C : DirectLimit G f β†’ Prop} (z : DirectLimit G f) (ih : βˆ€ i x, C (of R ΞΉ G f i x)) : C z := let ⟨i, x, h⟩ := exists_of z h β–Έ ih i x #align module.direct_limit.induction_on Module.DirectLimit.induction_on variable {P : Type u₁} [AddCommGroup P] [Module R P] (g : βˆ€ i, G i β†’β‚—[R] P) variable (Hg : βˆ€ i j hij x, g j (f i j hij x) = g i x) variable (R ΞΉ G f) def lift : DirectLimit G f β†’β‚—[R] P := liftQ _ (DirectSum.toModule R ΞΉ P g) (span_le.2 fun a ⟨i, j, hij, x, hx⟩ => by rw [← hx, SetLike.mem_coe, LinearMap.sub_mem_ker_iff, DirectSum.toModule_lof, DirectSum.toModule_lof, Hg]) #align module.direct_limit.lift Module.DirectLimit.lift variable {R ΞΉ G f} theorem lift_of {i} (x) : lift R ΞΉ G f g Hg (of R ΞΉ G f i x) = g i x := DirectSum.toModule_lof R _ _ #align module.direct_limit.lift_of Module.DirectLimit.lift_of
Mathlib/Algebra/DirectLimit.lean
164
170
theorem lift_unique [IsDirected ΞΉ (Β· ≀ Β·)] (F : DirectLimit G f β†’β‚—[R] P) (x) : F x = lift R ΞΉ G f (fun i => F.comp <| of R ΞΉ G f i) (fun i j hij x => by rw [LinearMap.comp_apply, of_f]; rfl) x := by
cases isEmpty_or_nonempty ΞΉ Β· simp_rw [Subsingleton.elim x 0, _root_.map_zero] Β· exact DirectLimit.induction_on x fun i x => by rw [lift_of]; rfl
1,651
import Mathlib.Init.Align import Mathlib.Data.Fintype.Order import Mathlib.Algebra.DirectLimit import Mathlib.ModelTheory.Quotients import Mathlib.ModelTheory.FinitelyGenerated #align_import model_theory.direct_limit from "leanprover-community/mathlib"@"f53b23994ac4c13afa38d31195c588a1121d1860" universe v w w' u₁ uβ‚‚ open FirstOrder namespace FirstOrder namespace Language open Structure Set variable {L : Language} {ΞΉ : Type v} [Preorder ΞΉ] variable {G : ΞΉ β†’ Type w} [βˆ€ i, L.Structure (G i)] variable (f : βˆ€ i j, i ≀ j β†’ G i β†ͺ[L] G j) namespace DirectedSystem nonrec theorem map_self [DirectedSystem G fun i j h => f i j h] (i x h) : f i i h x = x := DirectedSystem.map_self (fun i j h => f i j h) i x h #align first_order.language.directed_system.map_self FirstOrder.Language.DirectedSystem.map_self nonrec theorem map_map [DirectedSystem G fun i j h => f i j h] {i j k} (hij hjk x) : f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x := DirectedSystem.map_map (fun i j h => f i j h) hij hjk x #align first_order.language.directed_system.map_map FirstOrder.Language.DirectedSystem.map_map variable {G' : β„• β†’ Type w} [βˆ€ i, L.Structure (G' i)] (f' : βˆ€ n : β„•, G' n β†ͺ[L] G' (n + 1)) def natLERec (m n : β„•) (h : m ≀ n) : G' m β†ͺ[L] G' n := Nat.leRecOn h (@fun k g => (f' k).comp g) (Embedding.refl L _) #align first_order.language.directed_system.nat_le_rec FirstOrder.Language.DirectedSystem.natLERec @[simp]
Mathlib/ModelTheory/DirectLimit.lean
67
76
theorem coe_natLERec (m n : β„•) (h : m ≀ n) : (natLERec f' m n h : G' m β†’ G' n) = Nat.leRecOn h (@fun k => f' k) := by
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le h ext x induction' k with k ih Β· -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [natLERec, Nat.leRecOn_self, Embedding.refl_apply, Nat.leRecOn_self] Β· -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [Nat.leRecOn_succ le_self_add, natLERec, Nat.leRecOn_succ le_self_add, ← natLERec, Embedding.comp_apply, ih]
1,652
import Mathlib.ModelTheory.FinitelyGenerated import Mathlib.ModelTheory.DirectLimit import Mathlib.ModelTheory.Bundled #align_import model_theory.fraisse from "leanprover-community/mathlib"@"0602c59878ff3d5f71dea69c2d32ccf2e93e5398" universe u v w w' open scoped FirstOrder open Set CategoryTheory namespace FirstOrder namespace Language open Structure Substructure variable (L : Language.{u, v}) def age (M : Type w) [L.Structure M] : Set (Bundled.{w} L.Structure) := {N | Structure.FG L N ∧ Nonempty (N β†ͺ[L] M)} #align first_order.language.age FirstOrder.Language.age variable {L} (K : Set (Bundled.{w} L.Structure)) def Hereditary : Prop := βˆ€ M : Bundled.{w} L.Structure, M ∈ K β†’ L.age M βŠ† K #align first_order.language.hereditary FirstOrder.Language.Hereditary def JointEmbedding : Prop := DirectedOn (fun M N : Bundled.{w} L.Structure => Nonempty (M β†ͺ[L] N)) K #align first_order.language.joint_embedding FirstOrder.Language.JointEmbedding def Amalgamation : Prop := βˆ€ (M N P : Bundled.{w} L.Structure) (MN : M β†ͺ[L] N) (MP : M β†ͺ[L] P), M ∈ K β†’ N ∈ K β†’ P ∈ K β†’ βˆƒ (Q : Bundled.{w} L.Structure) (NQ : N β†ͺ[L] Q) (PQ : P β†ͺ[L] Q), Q ∈ K ∧ NQ.comp MN = PQ.comp MP #align first_order.language.amalgamation FirstOrder.Language.Amalgamation class IsFraisse : Prop where is_nonempty : K.Nonempty FG : βˆ€ M : Bundled.{w} L.Structure, M ∈ K β†’ Structure.FG L M is_equiv_invariant : βˆ€ M N : Bundled.{w} L.Structure, Nonempty (M ≃[L] N) β†’ (M ∈ K ↔ N ∈ K) is_essentially_countable : (Quotient.mk' '' K).Countable hereditary : Hereditary K jointEmbedding : JointEmbedding K amalgamation : Amalgamation K #align first_order.language.is_fraisse FirstOrder.Language.IsFraisse variable {K} (L) (M : Type w) [Structure L M] theorem age.is_equiv_invariant (N P : Bundled.{w} L.Structure) (h : Nonempty (N ≃[L] P)) : N ∈ L.age M ↔ P ∈ L.age M := and_congr h.some.fg_iff ⟨Nonempty.map fun x => Embedding.comp x h.some.symm.toEmbedding, Nonempty.map fun x => Embedding.comp x h.some.toEmbedding⟩ #align first_order.language.age.is_equiv_invariant FirstOrder.Language.age.is_equiv_invariant variable {L} {M} {N : Type w} [Structure L N] theorem Embedding.age_subset_age (MN : M β†ͺ[L] N) : L.age M βŠ† L.age N := fun _ => And.imp_right (Nonempty.map MN.comp) #align first_order.language.embedding.age_subset_age FirstOrder.Language.Embedding.age_subset_age theorem Equiv.age_eq_age (MN : M ≃[L] N) : L.age M = L.age N := le_antisymm MN.toEmbedding.age_subset_age MN.symm.toEmbedding.age_subset_age #align first_order.language.equiv.age_eq_age FirstOrder.Language.Equiv.age_eq_age theorem Structure.FG.mem_age_of_equiv {M N : Bundled L.Structure} (h : Structure.FG L M) (MN : Nonempty (M ≃[L] N)) : N ∈ L.age M := ⟨MN.some.fg_iff.1 h, ⟨MN.some.symm.toEmbedding⟩⟩ set_option linter.uppercaseLean3 false in #align first_order.language.Structure.fg.mem_age_of_equiv FirstOrder.Language.Structure.FG.mem_age_of_equiv theorem Hereditary.is_equiv_invariant_of_fg (h : Hereditary K) (fg : βˆ€ M : Bundled.{w} L.Structure, M ∈ K β†’ Structure.FG L M) (M N : Bundled.{w} L.Structure) (hn : Nonempty (M ≃[L] N)) : M ∈ K ↔ N ∈ K := ⟨fun MK => h M MK ((fg M MK).mem_age_of_equiv hn), fun NK => h N NK ((fg N NK).mem_age_of_equiv ⟨hn.some.symm⟩)⟩ #align first_order.language.hereditary.is_equiv_invariant_of_fg FirstOrder.Language.Hereditary.is_equiv_invariant_of_fg variable (M) theorem age.nonempty : (L.age M).Nonempty := ⟨Bundled.of (Substructure.closure L (βˆ… : Set M)), (fg_iff_structure_fg _).1 (fg_closure Set.finite_empty), ⟨Substructure.subtype _⟩⟩ #align first_order.language.age.nonempty FirstOrder.Language.age.nonempty theorem age.hereditary : Hereditary (L.age M) := fun _ hN _ hP => hN.2.some.age_subset_age hP #align first_order.language.age.hereditary FirstOrder.Language.age.hereditary theorem age.jointEmbedding : JointEmbedding (L.age M) := fun _ hN _ hP => ⟨Bundled.of (β†₯(hN.2.some.toHom.range βŠ” hP.2.some.toHom.range)), ⟨(fg_iff_structure_fg _).1 ((hN.1.range hN.2.some.toHom).sup (hP.1.range hP.2.some.toHom)), ⟨Substructure.subtype _⟩⟩, ⟨Embedding.comp (inclusion le_sup_left) hN.2.some.equivRange.toEmbedding⟩, ⟨Embedding.comp (inclusion le_sup_right) hP.2.some.equivRange.toEmbedding⟩⟩ #align first_order.language.age.joint_embedding FirstOrder.Language.age.jointEmbedding
Mathlib/ModelTheory/Fraisse.lean
169
182
theorem age.countable_quotient [h : Countable M] : (Quotient.mk' '' L.age M).Countable := by
classical refine (congr_arg _ (Set.ext <| Quotient.forall.2 fun N => ?_)).mp (countable_range fun s : Finset M => ⟦⟨closure L (s : Set M), inferInstance⟩⟧) constructor Β· rintro ⟨s, hs⟩ use Bundled.of (closure L (s : Set M)) exact ⟨⟨(fg_iff_structure_fg _).1 (fg_closure s.finite_toSet), ⟨Substructure.subtype _⟩⟩, hs⟩ Β· simp only [mem_range, Quotient.eq] rintro ⟨P, ⟨⟨s, hs⟩, ⟨PM⟩⟩, hP2⟩ have : P β‰ˆ N := by apply Quotient.eq'.mp; rw [hP2]; rfl -- Porting note: added refine ⟨s.image PM, Setoid.trans (b := P) ?_ this⟩ rw [← Embedding.coe_toHom, Finset.coe_image, closure_image PM.toHom, hs, ← Hom.range_eq_map] exact ⟨PM.equivRange.symm⟩
1,653
import Mathlib.Algebra.DirectSum.Module import Mathlib.Algebra.Module.Submodule.Basic #align_import algebra.direct_sum.decomposition from "leanprover-community/mathlib"@"4e861f25ba5ceef42ba0712d8ffeb32f38ad6441" variable {ΞΉ R M Οƒ : Type*} open DirectSum namespace DirectSum section AddCommMonoid variable [DecidableEq ΞΉ] [AddCommMonoid M] variable [SetLike Οƒ M] [AddSubmonoidClass Οƒ M] (β„³ : ΞΉ β†’ Οƒ) class Decomposition where decompose' : M β†’ ⨁ i, β„³ i left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom β„³) decompose' right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom β„³) decompose' #align direct_sum.decomposition DirectSum.Decomposition instance : Subsingleton (Decomposition β„³) := ⟨fun x y ↦ by cases' x with x xl xr cases' y with y yl yr congr exact Function.LeftInverse.eq_rightInverse xr yl⟩ abbrev Decomposition.ofAddHom (decompose : M β†’+ ⨁ i, β„³ i) (h_left_inv : (DirectSum.coeAddMonoidHom β„³).comp decompose = .id _) (h_right_inv : decompose.comp (DirectSum.coeAddMonoidHom β„³) = .id _) : Decomposition β„³ where decompose' := decompose left_inv := DFunLike.congr_fun h_left_inv right_inv := DFunLike.congr_fun h_right_inv noncomputable def IsInternal.chooseDecomposition (h : IsInternal β„³) : DirectSum.Decomposition β„³ where decompose' := (Equiv.ofBijective _ h).symm left_inv := (Equiv.ofBijective _ h).right_inv right_inv := (Equiv.ofBijective _ h).left_inv variable [Decomposition β„³] protected theorem Decomposition.isInternal : DirectSum.IsInternal β„³ := ⟨Decomposition.right_inv.injective, Decomposition.left_inv.surjective⟩ #align direct_sum.decomposition.is_internal DirectSum.Decomposition.isInternal def decompose : M ≃ ⨁ i, β„³ i where toFun := Decomposition.decompose' invFun := DirectSum.coeAddMonoidHom β„³ left_inv := Decomposition.left_inv right_inv := Decomposition.right_inv #align direct_sum.decompose DirectSum.decompose protected theorem Decomposition.inductionOn {p : M β†’ Prop} (h_zero : p 0) (h_homogeneous : βˆ€ {i} (m : β„³ i), p (m : M)) (h_add : βˆ€ m m' : M, p m β†’ p m' β†’ p (m + m')) : βˆ€ m, p m := by let β„³' : ΞΉ β†’ AddSubmonoid M := fun i ↦ (βŸ¨βŸ¨β„³ i, fun x y ↦ AddMemClass.add_mem x y⟩, (ZeroMemClass.zero_mem _)⟩ : AddSubmonoid M) haveI t : DirectSum.Decomposition β„³' := { decompose' := DirectSum.decompose β„³ left_inv := fun _ ↦ (decompose β„³).left_inv _ right_inv := fun _ ↦ (decompose β„³).right_inv _ } have mem : βˆ€ m, m ∈ iSup β„³' := fun _m ↦ (DirectSum.IsInternal.addSubmonoid_iSup_eq_top β„³' (Decomposition.isInternal β„³')).symm β–Έ trivial -- Porting note: needs to use @ even though no implicit argument is provided exact fun m ↦ @AddSubmonoid.iSup_induction _ _ _ β„³' _ _ (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add -- exact fun m ↦ -- AddSubmonoid.iSup_induction β„³' (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add #align direct_sum.decomposition.induction_on DirectSum.Decomposition.inductionOn @[simp] theorem Decomposition.decompose'_eq : Decomposition.decompose' = decompose β„³ := rfl #align direct_sum.decomposition.decompose'_eq DirectSum.Decomposition.decompose'_eq @[simp] theorem decompose_symm_of {i : ΞΉ} (x : β„³ i) : (decompose β„³).symm (DirectSum.of _ i x) = x := DirectSum.coeAddMonoidHom_of β„³ _ _ #align direct_sum.decompose_symm_of DirectSum.decompose_symm_of @[simp]
Mathlib/Algebra/DirectSum/Decomposition.lean
127
128
theorem decompose_coe {i : ΞΉ} (x : β„³ i) : decompose β„³ (x : M) = DirectSum.of _ i x := by
rw [← decompose_symm_of _, Equiv.apply_symm_apply]
1,654
import Mathlib.Algebra.DirectSum.Module import Mathlib.Algebra.Module.Submodule.Basic #align_import algebra.direct_sum.decomposition from "leanprover-community/mathlib"@"4e861f25ba5ceef42ba0712d8ffeb32f38ad6441" variable {ΞΉ R M Οƒ : Type*} open DirectSum namespace DirectSum section AddCommMonoid variable [DecidableEq ΞΉ] [AddCommMonoid M] variable [SetLike Οƒ M] [AddSubmonoidClass Οƒ M] (β„³ : ΞΉ β†’ Οƒ) class Decomposition where decompose' : M β†’ ⨁ i, β„³ i left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom β„³) decompose' right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom β„³) decompose' #align direct_sum.decomposition DirectSum.Decomposition instance : Subsingleton (Decomposition β„³) := ⟨fun x y ↦ by cases' x with x xl xr cases' y with y yl yr congr exact Function.LeftInverse.eq_rightInverse xr yl⟩ abbrev Decomposition.ofAddHom (decompose : M β†’+ ⨁ i, β„³ i) (h_left_inv : (DirectSum.coeAddMonoidHom β„³).comp decompose = .id _) (h_right_inv : decompose.comp (DirectSum.coeAddMonoidHom β„³) = .id _) : Decomposition β„³ where decompose' := decompose left_inv := DFunLike.congr_fun h_left_inv right_inv := DFunLike.congr_fun h_right_inv noncomputable def IsInternal.chooseDecomposition (h : IsInternal β„³) : DirectSum.Decomposition β„³ where decompose' := (Equiv.ofBijective _ h).symm left_inv := (Equiv.ofBijective _ h).right_inv right_inv := (Equiv.ofBijective _ h).left_inv variable [Decomposition β„³] protected theorem Decomposition.isInternal : DirectSum.IsInternal β„³ := ⟨Decomposition.right_inv.injective, Decomposition.left_inv.surjective⟩ #align direct_sum.decomposition.is_internal DirectSum.Decomposition.isInternal def decompose : M ≃ ⨁ i, β„³ i where toFun := Decomposition.decompose' invFun := DirectSum.coeAddMonoidHom β„³ left_inv := Decomposition.left_inv right_inv := Decomposition.right_inv #align direct_sum.decompose DirectSum.decompose protected theorem Decomposition.inductionOn {p : M β†’ Prop} (h_zero : p 0) (h_homogeneous : βˆ€ {i} (m : β„³ i), p (m : M)) (h_add : βˆ€ m m' : M, p m β†’ p m' β†’ p (m + m')) : βˆ€ m, p m := by let β„³' : ΞΉ β†’ AddSubmonoid M := fun i ↦ (βŸ¨βŸ¨β„³ i, fun x y ↦ AddMemClass.add_mem x y⟩, (ZeroMemClass.zero_mem _)⟩ : AddSubmonoid M) haveI t : DirectSum.Decomposition β„³' := { decompose' := DirectSum.decompose β„³ left_inv := fun _ ↦ (decompose β„³).left_inv _ right_inv := fun _ ↦ (decompose β„³).right_inv _ } have mem : βˆ€ m, m ∈ iSup β„³' := fun _m ↦ (DirectSum.IsInternal.addSubmonoid_iSup_eq_top β„³' (Decomposition.isInternal β„³')).symm β–Έ trivial -- Porting note: needs to use @ even though no implicit argument is provided exact fun m ↦ @AddSubmonoid.iSup_induction _ _ _ β„³' _ _ (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add -- exact fun m ↦ -- AddSubmonoid.iSup_induction β„³' (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add #align direct_sum.decomposition.induction_on DirectSum.Decomposition.inductionOn @[simp] theorem Decomposition.decompose'_eq : Decomposition.decompose' = decompose β„³ := rfl #align direct_sum.decomposition.decompose'_eq DirectSum.Decomposition.decompose'_eq @[simp] theorem decompose_symm_of {i : ΞΉ} (x : β„³ i) : (decompose β„³).symm (DirectSum.of _ i x) = x := DirectSum.coeAddMonoidHom_of β„³ _ _ #align direct_sum.decompose_symm_of DirectSum.decompose_symm_of @[simp] theorem decompose_coe {i : ΞΉ} (x : β„³ i) : decompose β„³ (x : M) = DirectSum.of _ i x := by rw [← decompose_symm_of _, Equiv.apply_symm_apply] #align direct_sum.decompose_coe DirectSum.decompose_coe theorem decompose_of_mem {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : decompose β„³ x = DirectSum.of (fun i ↦ β„³ i) i ⟨x, hx⟩ := decompose_coe _ ⟨x, hx⟩ #align direct_sum.decompose_of_mem DirectSum.decompose_of_mem
Mathlib/Algebra/DirectSum/Decomposition.lean
136
137
theorem decompose_of_mem_same {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : (decompose β„³ x i : M) = x := by
rw [decompose_of_mem _ hx, DirectSum.of_eq_same, Subtype.coe_mk]
1,654
import Mathlib.Algebra.DirectSum.Module import Mathlib.Algebra.Module.Submodule.Basic #align_import algebra.direct_sum.decomposition from "leanprover-community/mathlib"@"4e861f25ba5ceef42ba0712d8ffeb32f38ad6441" variable {ΞΉ R M Οƒ : Type*} open DirectSum namespace DirectSum section AddCommMonoid variable [DecidableEq ΞΉ] [AddCommMonoid M] variable [SetLike Οƒ M] [AddSubmonoidClass Οƒ M] (β„³ : ΞΉ β†’ Οƒ) class Decomposition where decompose' : M β†’ ⨁ i, β„³ i left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom β„³) decompose' right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom β„³) decompose' #align direct_sum.decomposition DirectSum.Decomposition instance : Subsingleton (Decomposition β„³) := ⟨fun x y ↦ by cases' x with x xl xr cases' y with y yl yr congr exact Function.LeftInverse.eq_rightInverse xr yl⟩ abbrev Decomposition.ofAddHom (decompose : M β†’+ ⨁ i, β„³ i) (h_left_inv : (DirectSum.coeAddMonoidHom β„³).comp decompose = .id _) (h_right_inv : decompose.comp (DirectSum.coeAddMonoidHom β„³) = .id _) : Decomposition β„³ where decompose' := decompose left_inv := DFunLike.congr_fun h_left_inv right_inv := DFunLike.congr_fun h_right_inv noncomputable def IsInternal.chooseDecomposition (h : IsInternal β„³) : DirectSum.Decomposition β„³ where decompose' := (Equiv.ofBijective _ h).symm left_inv := (Equiv.ofBijective _ h).right_inv right_inv := (Equiv.ofBijective _ h).left_inv variable [Decomposition β„³] protected theorem Decomposition.isInternal : DirectSum.IsInternal β„³ := ⟨Decomposition.right_inv.injective, Decomposition.left_inv.surjective⟩ #align direct_sum.decomposition.is_internal DirectSum.Decomposition.isInternal def decompose : M ≃ ⨁ i, β„³ i where toFun := Decomposition.decompose' invFun := DirectSum.coeAddMonoidHom β„³ left_inv := Decomposition.left_inv right_inv := Decomposition.right_inv #align direct_sum.decompose DirectSum.decompose protected theorem Decomposition.inductionOn {p : M β†’ Prop} (h_zero : p 0) (h_homogeneous : βˆ€ {i} (m : β„³ i), p (m : M)) (h_add : βˆ€ m m' : M, p m β†’ p m' β†’ p (m + m')) : βˆ€ m, p m := by let β„³' : ΞΉ β†’ AddSubmonoid M := fun i ↦ (βŸ¨βŸ¨β„³ i, fun x y ↦ AddMemClass.add_mem x y⟩, (ZeroMemClass.zero_mem _)⟩ : AddSubmonoid M) haveI t : DirectSum.Decomposition β„³' := { decompose' := DirectSum.decompose β„³ left_inv := fun _ ↦ (decompose β„³).left_inv _ right_inv := fun _ ↦ (decompose β„³).right_inv _ } have mem : βˆ€ m, m ∈ iSup β„³' := fun _m ↦ (DirectSum.IsInternal.addSubmonoid_iSup_eq_top β„³' (Decomposition.isInternal β„³')).symm β–Έ trivial -- Porting note: needs to use @ even though no implicit argument is provided exact fun m ↦ @AddSubmonoid.iSup_induction _ _ _ β„³' _ _ (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add -- exact fun m ↦ -- AddSubmonoid.iSup_induction β„³' (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add #align direct_sum.decomposition.induction_on DirectSum.Decomposition.inductionOn @[simp] theorem Decomposition.decompose'_eq : Decomposition.decompose' = decompose β„³ := rfl #align direct_sum.decomposition.decompose'_eq DirectSum.Decomposition.decompose'_eq @[simp] theorem decompose_symm_of {i : ΞΉ} (x : β„³ i) : (decompose β„³).symm (DirectSum.of _ i x) = x := DirectSum.coeAddMonoidHom_of β„³ _ _ #align direct_sum.decompose_symm_of DirectSum.decompose_symm_of @[simp] theorem decompose_coe {i : ΞΉ} (x : β„³ i) : decompose β„³ (x : M) = DirectSum.of _ i x := by rw [← decompose_symm_of _, Equiv.apply_symm_apply] #align direct_sum.decompose_coe DirectSum.decompose_coe theorem decompose_of_mem {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : decompose β„³ x = DirectSum.of (fun i ↦ β„³ i) i ⟨x, hx⟩ := decompose_coe _ ⟨x, hx⟩ #align direct_sum.decompose_of_mem DirectSum.decompose_of_mem theorem decompose_of_mem_same {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : (decompose β„³ x i : M) = x := by rw [decompose_of_mem _ hx, DirectSum.of_eq_same, Subtype.coe_mk] #align direct_sum.decompose_of_mem_same DirectSum.decompose_of_mem_same
Mathlib/Algebra/DirectSum/Decomposition.lean
140
142
theorem decompose_of_mem_ne {x : M} {i j : ΞΉ} (hx : x ∈ β„³ i) (hij : i β‰  j) : (decompose β„³ x j : M) = 0 := by
rw [decompose_of_mem _ hx, DirectSum.of_eq_of_ne _ _ _ _ hij, ZeroMemClass.coe_zero]
1,654
import Mathlib.Algebra.DirectSum.Module import Mathlib.Algebra.Module.Submodule.Basic #align_import algebra.direct_sum.decomposition from "leanprover-community/mathlib"@"4e861f25ba5ceef42ba0712d8ffeb32f38ad6441" variable {ΞΉ R M Οƒ : Type*} open DirectSum namespace DirectSum section AddCommMonoid variable [DecidableEq ΞΉ] [AddCommMonoid M] variable [SetLike Οƒ M] [AddSubmonoidClass Οƒ M] (β„³ : ΞΉ β†’ Οƒ) class Decomposition where decompose' : M β†’ ⨁ i, β„³ i left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom β„³) decompose' right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom β„³) decompose' #align direct_sum.decomposition DirectSum.Decomposition instance : Subsingleton (Decomposition β„³) := ⟨fun x y ↦ by cases' x with x xl xr cases' y with y yl yr congr exact Function.LeftInverse.eq_rightInverse xr yl⟩ abbrev Decomposition.ofAddHom (decompose : M β†’+ ⨁ i, β„³ i) (h_left_inv : (DirectSum.coeAddMonoidHom β„³).comp decompose = .id _) (h_right_inv : decompose.comp (DirectSum.coeAddMonoidHom β„³) = .id _) : Decomposition β„³ where decompose' := decompose left_inv := DFunLike.congr_fun h_left_inv right_inv := DFunLike.congr_fun h_right_inv noncomputable def IsInternal.chooseDecomposition (h : IsInternal β„³) : DirectSum.Decomposition β„³ where decompose' := (Equiv.ofBijective _ h).symm left_inv := (Equiv.ofBijective _ h).right_inv right_inv := (Equiv.ofBijective _ h).left_inv variable [Decomposition β„³] protected theorem Decomposition.isInternal : DirectSum.IsInternal β„³ := ⟨Decomposition.right_inv.injective, Decomposition.left_inv.surjective⟩ #align direct_sum.decomposition.is_internal DirectSum.Decomposition.isInternal def decompose : M ≃ ⨁ i, β„³ i where toFun := Decomposition.decompose' invFun := DirectSum.coeAddMonoidHom β„³ left_inv := Decomposition.left_inv right_inv := Decomposition.right_inv #align direct_sum.decompose DirectSum.decompose protected theorem Decomposition.inductionOn {p : M β†’ Prop} (h_zero : p 0) (h_homogeneous : βˆ€ {i} (m : β„³ i), p (m : M)) (h_add : βˆ€ m m' : M, p m β†’ p m' β†’ p (m + m')) : βˆ€ m, p m := by let β„³' : ΞΉ β†’ AddSubmonoid M := fun i ↦ (βŸ¨βŸ¨β„³ i, fun x y ↦ AddMemClass.add_mem x y⟩, (ZeroMemClass.zero_mem _)⟩ : AddSubmonoid M) haveI t : DirectSum.Decomposition β„³' := { decompose' := DirectSum.decompose β„³ left_inv := fun _ ↦ (decompose β„³).left_inv _ right_inv := fun _ ↦ (decompose β„³).right_inv _ } have mem : βˆ€ m, m ∈ iSup β„³' := fun _m ↦ (DirectSum.IsInternal.addSubmonoid_iSup_eq_top β„³' (Decomposition.isInternal β„³')).symm β–Έ trivial -- Porting note: needs to use @ even though no implicit argument is provided exact fun m ↦ @AddSubmonoid.iSup_induction _ _ _ β„³' _ _ (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add -- exact fun m ↦ -- AddSubmonoid.iSup_induction β„³' (mem m) (fun i m h ↦ h_homogeneous ⟨m, h⟩) h_zero h_add #align direct_sum.decomposition.induction_on DirectSum.Decomposition.inductionOn @[simp] theorem Decomposition.decompose'_eq : Decomposition.decompose' = decompose β„³ := rfl #align direct_sum.decomposition.decompose'_eq DirectSum.Decomposition.decompose'_eq @[simp] theorem decompose_symm_of {i : ΞΉ} (x : β„³ i) : (decompose β„³).symm (DirectSum.of _ i x) = x := DirectSum.coeAddMonoidHom_of β„³ _ _ #align direct_sum.decompose_symm_of DirectSum.decompose_symm_of @[simp] theorem decompose_coe {i : ΞΉ} (x : β„³ i) : decompose β„³ (x : M) = DirectSum.of _ i x := by rw [← decompose_symm_of _, Equiv.apply_symm_apply] #align direct_sum.decompose_coe DirectSum.decompose_coe theorem decompose_of_mem {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : decompose β„³ x = DirectSum.of (fun i ↦ β„³ i) i ⟨x, hx⟩ := decompose_coe _ ⟨x, hx⟩ #align direct_sum.decompose_of_mem DirectSum.decompose_of_mem theorem decompose_of_mem_same {x : M} {i : ΞΉ} (hx : x ∈ β„³ i) : (decompose β„³ x i : M) = x := by rw [decompose_of_mem _ hx, DirectSum.of_eq_same, Subtype.coe_mk] #align direct_sum.decompose_of_mem_same DirectSum.decompose_of_mem_same theorem decompose_of_mem_ne {x : M} {i j : ΞΉ} (hx : x ∈ β„³ i) (hij : i β‰  j) : (decompose β„³ x j : M) = 0 := by rw [decompose_of_mem _ hx, DirectSum.of_eq_of_ne _ _ _ _ hij, ZeroMemClass.coe_zero] #align direct_sum.decompose_of_mem_ne DirectSum.decompose_of_mem_ne
Mathlib/Algebra/DirectSum/Decomposition.lean
145
147
theorem degree_eq_of_mem_mem {x : M} {i j : ΞΉ} (hxi : x ∈ β„³ i) (hxj : x ∈ β„³ j) (hx : x β‰  0) : i = j := by
contrapose! hx; rw [← decompose_of_mem_same β„³ hxj, decompose_of_mem_ne β„³ hxi hx]
1,654
import Mathlib.RingTheory.GradedAlgebra.Basic import Mathlib.Algebra.GradedMulAction import Mathlib.Algebra.DirectSum.Decomposition import Mathlib.Algebra.Module.BigOperators #align_import algebra.module.graded_module from "leanprover-community/mathlib"@"59cdeb0da2480abbc235b7e611ccd9a7e5603d7c" section open DirectSum variable {ΞΉA ΞΉB : Type*} (A : ΞΉA β†’ Type*) (M : ΞΉB β†’ Type*) namespace DirectSum open GradedMonoid class GdistribMulAction [AddMonoid ΞΉA] [VAdd ΞΉA ΞΉB] [GMonoid A] [βˆ€ i, AddMonoid (M i)] extends GMulAction A M where smul_add {i j} (a : A i) (b c : M j) : smul a (b + c) = smul a b + smul a c smul_zero {i j} (a : A i) : smul a (0 : M j) = 0 #align direct_sum.gdistrib_mul_action DirectSum.GdistribMulAction class Gmodule [AddMonoid ΞΉA] [VAdd ΞΉA ΞΉB] [βˆ€ i, AddMonoid (A i)] [βˆ€ i, AddMonoid (M i)] [GMonoid A] extends GdistribMulAction A M where add_smul {i j} (a a' : A i) (b : M j) : smul (a + a') b = smul a b + smul a' b zero_smul {i j} (b : M j) : smul (0 : A i) b = 0 #align direct_sum.gmodule DirectSum.Gmodule instance GSemiring.toGmodule [AddMonoid ΞΉA] [βˆ€ i : ΞΉA, AddCommMonoid (A i)] [h : GSemiring A] : Gmodule A A := { GMonoid.toGMulAction A with smul_add := fun _ _ _ => h.mul_add _ _ _ smul_zero := fun _ => h.mul_zero _ add_smul := fun _ _ => h.add_mul _ _ zero_smul := fun _ => h.zero_mul _ } #align direct_sum.gsemiring.to_gmodule DirectSum.GSemiring.toGmodule variable [AddMonoid ΞΉA] [VAdd ΞΉA ΞΉB] [βˆ€ i : ΞΉA, AddCommMonoid (A i)] [βˆ€ i, AddCommMonoid (M i)] @[simps] def gsmulHom [GMonoid A] [Gmodule A M] {i j} : A i β†’+ M j β†’+ M (i +α΅₯ j) where toFun a := { toFun := fun b => GSMul.smul a b map_zero' := GdistribMulAction.smul_zero _ map_add' := GdistribMulAction.smul_add _ } map_zero' := AddMonoidHom.ext fun a => Gmodule.zero_smul a map_add' _a₁ _aβ‚‚ := AddMonoidHom.ext fun _b => Gmodule.add_smul _ _ _ #align direct_sum.gsmul_hom DirectSum.gsmulHom namespace Gmodule def smulAddMonoidHom [DecidableEq ΞΉA] [DecidableEq ΞΉB] [GMonoid A] [Gmodule A M] : (⨁ i, A i) β†’+ (⨁ i, M i) β†’+ ⨁ i, M i := toAddMonoid fun _i => AddMonoidHom.flip <| toAddMonoid fun _j => AddMonoidHom.flip <| (of M _).compHom.comp <| gsmulHom A M #align direct_sum.gmodule.smul_add_monoid_hom DirectSum.Gmodule.smulAddMonoidHom section open GradedMonoid DirectSum Gmodule instance [DecidableEq ΞΉA] [DecidableEq ΞΉB] [GMonoid A] [Gmodule A M] : SMul (⨁ i, A i) (⨁ i, M i) where smul x y := smulAddMonoidHom A M x y @[simp] theorem smul_def [DecidableEq ΞΉA] [DecidableEq ΞΉB] [GMonoid A] [Gmodule A M] (x : ⨁ i, A i) (y : ⨁ i, M i) : x β€’ y = smulAddMonoidHom _ _ x y := rfl #align direct_sum.gmodule.smul_def DirectSum.Gmodule.smul_def @[simp]
Mathlib/Algebra/Module/GradedModule.lean
99
102
theorem smulAddMonoidHom_apply_of_of [DecidableEq ΞΉA] [DecidableEq ΞΉB] [GMonoid A] [Gmodule A M] {i j} (x : A i) (y : M j) : smulAddMonoidHom A M (DirectSum.of A i x) (of M j y) = of M (i +α΅₯ j) (GSMul.smul x y) := by
simp [smulAddMonoidHom]
1,655
import Mathlib.LinearAlgebra.TensorProduct.Tower import Mathlib.Algebra.DirectSum.Module #align_import linear_algebra.direct_sum.tensor_product from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" suppress_compilation universe u v₁ vβ‚‚ w₁ w₁' wβ‚‚ wβ‚‚' section Ring namespace TensorProduct open TensorProduct open DirectSum open LinearMap attribute [local ext] TensorProduct.ext variable (R : Type u) [CommSemiring R] (S) [Semiring S] [Algebra R S] variable {ι₁ : Type v₁} {ΞΉβ‚‚ : Type vβ‚‚} variable [DecidableEq ι₁] [DecidableEq ΞΉβ‚‚] variable (M₁ : ι₁ β†’ Type w₁) (M₁' : Type w₁') (Mβ‚‚ : ΞΉβ‚‚ β†’ Type wβ‚‚) (Mβ‚‚' : Type wβ‚‚') variable [βˆ€ i₁, AddCommMonoid (M₁ i₁)] [AddCommMonoid M₁'] variable [βˆ€ iβ‚‚, AddCommMonoid (Mβ‚‚ iβ‚‚)] [AddCommMonoid Mβ‚‚'] variable [βˆ€ i₁, Module R (M₁ i₁)] [Module R M₁'] [βˆ€ iβ‚‚, Module R (Mβ‚‚ iβ‚‚)] [Module R Mβ‚‚'] variable [βˆ€ i₁, Module S (M₁ i₁)] [βˆ€ i₁, IsScalarTower R S (M₁ i₁)] protected def directSum : ((⨁ i₁, M₁ i₁) βŠ—[R] ⨁ iβ‚‚, Mβ‚‚ iβ‚‚) ≃ₗ[S] ⨁ i : ι₁ Γ— ΞΉβ‚‚, M₁ i.1 βŠ—[R] Mβ‚‚ i.2 := by -- Porting note: entirely rewritten to allow unification to happen one step at a time refine LinearEquiv.ofLinear (R := S) (Rβ‚‚ := S) ?toFun ?invFun ?left ?right Β· refine AlgebraTensorModule.lift ?_ refine DirectSum.toModule S _ _ fun i₁ => ?_ refine LinearMap.flip ?_ refine DirectSum.toModule R _ _ fun iβ‚‚ => LinearMap.flip <| ?_ refine AlgebraTensorModule.curry ?_ exact DirectSum.lof S (ι₁ Γ— ΞΉβ‚‚) (fun i => M₁ i.1 βŠ—[R] Mβ‚‚ i.2) (i₁, iβ‚‚) Β· refine DirectSum.toModule S _ _ fun i => ?_ exact AlgebraTensorModule.map (DirectSum.lof S _ M₁ i.1) (DirectSum.lof R _ Mβ‚‚ i.2) Β· refine DirectSum.linearMap_ext S fun ⟨i₁, iβ‚‚βŸ© => ?_ refine TensorProduct.AlgebraTensorModule.ext fun m₁ mβ‚‚ => ?_ -- Porting note: seems much nicer than the `repeat` lean 3 proof. simp only [coe_comp, Function.comp_apply, toModule_lof, AlgebraTensorModule.map_tmul, AlgebraTensorModule.lift_apply, lift.tmul, coe_restrictScalars, flip_apply, AlgebraTensorModule.curry_apply, curry_apply, id_comp] Β· -- `(_)` prevents typeclass search timing out on problems that can be solved immediately by -- unification apply TensorProduct.AlgebraTensorModule.curry_injective refine DirectSum.linearMap_ext _ fun i₁ => ?_ refine LinearMap.ext fun x₁ => ?_ refine DirectSum.linearMap_ext _ fun iβ‚‚ => ?_ refine LinearMap.ext fun xβ‚‚ => ?_ -- Porting note: seems much nicer than the `repeat` lean 3 proof. simp only [coe_comp, Function.comp_apply, AlgebraTensorModule.curry_apply, curry_apply, coe_restrictScalars, AlgebraTensorModule.lift_apply, lift.tmul, toModule_lof, flip_apply, AlgebraTensorModule.map_tmul, id_coe, id_eq] #align tensor_product.direct_sum TensorProduct.directSum def directSumLeft : (⨁ i₁, M₁ i₁) βŠ—[R] Mβ‚‚' ≃ₗ[R] ⨁ i, M₁ i βŠ—[R] Mβ‚‚' := LinearEquiv.ofLinear (lift <| DirectSum.toModule R _ _ fun i => (mk R _ _).comprβ‚‚ <| DirectSum.lof R ι₁ (fun i => M₁ i βŠ—[R] Mβ‚‚') _) (DirectSum.toModule R _ _ fun i => rTensor _ (DirectSum.lof R ι₁ _ _)) (DirectSum.linearMap_ext R fun i => TensorProduct.ext <| LinearMap.extβ‚‚ fun m₁ mβ‚‚ => by dsimp only [comp_apply, comprβ‚‚_apply, id_apply, mk_apply] simp_rw [DirectSum.toModule_lof, rTensor_tmul, lift.tmul, DirectSum.toModule_lof, comprβ‚‚_apply, mk_apply]) (TensorProduct.ext <| DirectSum.linearMap_ext R fun i => LinearMap.extβ‚‚ fun m₁ mβ‚‚ => by dsimp only [comp_apply, comprβ‚‚_apply, id_apply, mk_apply] simp_rw [lift.tmul, DirectSum.toModule_lof, comprβ‚‚_apply, mk_apply, DirectSum.toModule_lof, rTensor_tmul]) #align tensor_product.direct_sum_left TensorProduct.directSumLeft def directSumRight : (M₁' βŠ—[R] ⨁ i, Mβ‚‚ i) ≃ₗ[R] ⨁ i, M₁' βŠ—[R] Mβ‚‚ i := TensorProduct.comm R _ _ β‰ͺ≫ₗ directSumLeft R Mβ‚‚ M₁' β‰ͺ≫ₗ DFinsupp.mapRange.linearEquiv fun _ => TensorProduct.comm R _ _ #align tensor_product.direct_sum_right TensorProduct.directSumRight variable {M₁ M₁' Mβ‚‚ Mβ‚‚'} @[simp]
Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean
150
153
theorem directSum_lof_tmul_lof (i₁ : ι₁) (m₁ : M₁ i₁) (iβ‚‚ : ΞΉβ‚‚) (mβ‚‚ : Mβ‚‚ iβ‚‚) : TensorProduct.directSum R S M₁ Mβ‚‚ (DirectSum.lof S ι₁ M₁ i₁ m₁ βŠ—β‚œ DirectSum.lof R ΞΉβ‚‚ Mβ‚‚ iβ‚‚ mβ‚‚) = DirectSum.lof S (ι₁ Γ— ΞΉβ‚‚) (fun i => M₁ i.1 βŠ—[R] Mβ‚‚ i.2) (i₁, iβ‚‚) (m₁ βŠ—β‚œ mβ‚‚) := by
simp [TensorProduct.directSum]
1,656
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule section TensorProduct variable (R : Type*) [CommSemiring R] (M : Type*) [AddCommMonoid M] [Module R M] (N : Type*) [AddCommMonoid N] [Module R N] namespace TensorProduct variable (ΞΉ : Type*) [DecidableEq ΞΉ] noncomputable def finsuppLeft : (ΞΉ β†’β‚€ M) βŠ—[R] N ≃ₗ[R] ΞΉ β†’β‚€ M βŠ—[R] N := congr (finsuppLEquivDirectSum R M ΞΉ) (.refl R N) β‰ͺ≫ₗ directSumLeft R (fun _ ↦ M) N β‰ͺ≫ₗ (finsuppLEquivDirectSum R _ ΞΉ).symm variable {R M N ΞΉ} lemma finsuppLeft_apply_tmul (p : ΞΉ β†’β‚€ M) (n : N) : finsuppLeft R M N ΞΉ (p βŠ—β‚œ[R] n) = p.sum fun i m ↦ Finsupp.single i (m βŠ—β‚œ[R] n) := by apply p.induction_linear Β· simp Β· intros f g hf hg; simp [add_tmul, map_add, hf, hg, Finsupp.sum_add_index] Β· simp [finsuppLeft] @[simp] lemma finsuppLeft_apply_tmul_apply (p : ΞΉ β†’β‚€ M) (n : N) (i : ΞΉ) : finsuppLeft R M N ΞΉ (p βŠ—β‚œ[R] n) i = p i βŠ—β‚œ[R] n := by rw [finsuppLeft_apply_tmul, Finsupp.sum_apply, Finsupp.sum_eq_single i (fun _ _ ↦ Finsupp.single_eq_of_ne) (by simp), Finsupp.single_eq_same]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
102
107
theorem finsuppLeft_apply (t : (ΞΉ β†’β‚€ M) βŠ—[R] N) (i : ΞΉ) : finsuppLeft R M N ΞΉ t i = rTensor N (Finsupp.lapply i) t := by
induction t using TensorProduct.induction_on with | zero => simp | tmul f n => simp only [finsuppLeft_apply_tmul_apply, rTensor_tmul, Finsupp.lapply_apply] | add x y hx hy => simp [map_add, hx, hy]
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule section TensorProduct variable (R : Type*) [CommSemiring R] (M : Type*) [AddCommMonoid M] [Module R M] (N : Type*) [AddCommMonoid N] [Module R N] namespace TensorProduct variable (ΞΉ : Type*) [DecidableEq ΞΉ] noncomputable def finsuppLeft : (ΞΉ β†’β‚€ M) βŠ—[R] N ≃ₗ[R] ΞΉ β†’β‚€ M βŠ—[R] N := congr (finsuppLEquivDirectSum R M ΞΉ) (.refl R N) β‰ͺ≫ₗ directSumLeft R (fun _ ↦ M) N β‰ͺ≫ₗ (finsuppLEquivDirectSum R _ ΞΉ).symm variable {R M N ΞΉ} lemma finsuppLeft_apply_tmul (p : ΞΉ β†’β‚€ M) (n : N) : finsuppLeft R M N ΞΉ (p βŠ—β‚œ[R] n) = p.sum fun i m ↦ Finsupp.single i (m βŠ—β‚œ[R] n) := by apply p.induction_linear Β· simp Β· intros f g hf hg; simp [add_tmul, map_add, hf, hg, Finsupp.sum_add_index] Β· simp [finsuppLeft] @[simp] lemma finsuppLeft_apply_tmul_apply (p : ΞΉ β†’β‚€ M) (n : N) (i : ΞΉ) : finsuppLeft R M N ΞΉ (p βŠ—β‚œ[R] n) i = p i βŠ—β‚œ[R] n := by rw [finsuppLeft_apply_tmul, Finsupp.sum_apply, Finsupp.sum_eq_single i (fun _ _ ↦ Finsupp.single_eq_of_ne) (by simp), Finsupp.single_eq_same] theorem finsuppLeft_apply (t : (ΞΉ β†’β‚€ M) βŠ—[R] N) (i : ΞΉ) : finsuppLeft R M N ΞΉ t i = rTensor N (Finsupp.lapply i) t := by induction t using TensorProduct.induction_on with | zero => simp | tmul f n => simp only [finsuppLeft_apply_tmul_apply, rTensor_tmul, Finsupp.lapply_apply] | add x y hx hy => simp [map_add, hx, hy] @[simp] lemma finsuppLeft_symm_apply_single (i : ΞΉ) (m : M) (n : N) : (finsuppLeft R M N ΞΉ).symm (Finsupp.single i (m βŠ—β‚œ[R] n)) = Finsupp.single i m βŠ—β‚œ[R] n := by simp [finsuppLeft, Finsupp.lsum] variable (R M N ΞΉ) noncomputable def finsuppRight : M βŠ—[R] (ΞΉ β†’β‚€ N) ≃ₗ[R] ΞΉ β†’β‚€ M βŠ—[R] N := congr (.refl R M) (finsuppLEquivDirectSum R N ΞΉ) β‰ͺ≫ₗ directSumRight R M (fun _ : ΞΉ ↦ N) β‰ͺ≫ₗ (finsuppLEquivDirectSum R _ ΞΉ).symm variable {R M N ΞΉ} lemma finsuppRight_apply_tmul (m : M) (p : ΞΉ β†’β‚€ N) : finsuppRight R M N ΞΉ (m βŠ—β‚œ[R] p) = p.sum fun i n ↦ Finsupp.single i (m βŠ—β‚œ[R] n) := by apply p.induction_linear Β· simp Β· intros f g hf hg; simp [tmul_add, map_add, hf, hg, Finsupp.sum_add_index] Β· simp [finsuppRight] @[simp] lemma finsuppRight_apply_tmul_apply (m : M) (p : ΞΉ β†’β‚€ N) (i : ΞΉ) : finsuppRight R M N ΞΉ (m βŠ—β‚œ[R] p) i = m βŠ—β‚œ[R] p i := by rw [finsuppRight_apply_tmul, Finsupp.sum_apply, Finsupp.sum_eq_single i (fun _ _ ↦ Finsupp.single_eq_of_ne) (by simp), Finsupp.single_eq_same]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
137
142
theorem finsuppRight_apply (t : M βŠ—[R] (ΞΉ β†’β‚€ N)) (i : ΞΉ) : finsuppRight R M N ΞΉ t i = lTensor M (Finsupp.lapply i) t := by
induction t using TensorProduct.induction_on with | zero => simp | tmul m f => simp [finsuppRight_apply_tmul_apply] | add x y hx hy => simp [map_add, hx, hy]
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ΞΉ ΞΊ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[S] ΞΉ Γ— ΞΊ β†’β‚€ M βŠ—[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ΞΉ) (finsuppLEquivDirectSum R N ΞΊ) β‰ͺ≫ₗ ((TensorProduct.directSum R S (fun _ : ΞΉ => M) fun _ : ΞΊ => N) β‰ͺ≫ₗ (finsuppLEquivDirectSum S (M βŠ—[R] N) (ΞΉ Γ— ΞΊ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
256
259
theorem finsuppTensorFinsupp_single (i : ΞΉ) (m : M) (k : ΞΊ) (n : N) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (Finsupp.single i m βŠ—β‚œ Finsupp.single k n) = Finsupp.single (i, k) (m βŠ—β‚œ n) := by
simp [finsuppTensorFinsupp]
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ΞΉ ΞΊ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[S] ΞΉ Γ— ΞΊ β†’β‚€ M βŠ—[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ΞΉ) (finsuppLEquivDirectSum R N ΞΊ) β‰ͺ≫ₗ ((TensorProduct.directSum R S (fun _ : ΞΉ => M) fun _ : ΞΊ => N) β‰ͺ≫ₗ (finsuppLEquivDirectSum S (M βŠ—[R] N) (ΞΉ Γ— ΞΊ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp] theorem finsuppTensorFinsupp_single (i : ΞΉ) (m : M) (k : ΞΊ) (n : N) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (Finsupp.single i m βŠ—β‚œ Finsupp.single k n) = Finsupp.single (i, k) (m βŠ—β‚œ n) := by simp [finsuppTensorFinsupp] #align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
263
277
theorem finsuppTensorFinsupp_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ N) (i : ΞΉ) (k : ΞΊ) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (f βŠ—β‚œ g) (i, k) = f i βŠ—β‚œ g k := by
apply Finsupp.induction_linear f Β· simp Β· intro f₁ fβ‚‚ hf₁ hfβ‚‚ simp [add_tmul, hf₁, hfβ‚‚] intro i' m apply Finsupp.induction_linear g Β· simp Β· intro g₁ gβ‚‚ hg₁ hgβ‚‚ simp [tmul_add, hg₁, hgβ‚‚] intro k' n classical simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and] split_ifs <;> simp
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ΞΉ ΞΊ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[S] ΞΉ Γ— ΞΊ β†’β‚€ M βŠ—[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ΞΉ) (finsuppLEquivDirectSum R N ΞΊ) β‰ͺ≫ₗ ((TensorProduct.directSum R S (fun _ : ΞΉ => M) fun _ : ΞΊ => N) β‰ͺ≫ₗ (finsuppLEquivDirectSum S (M βŠ—[R] N) (ΞΉ Γ— ΞΊ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp] theorem finsuppTensorFinsupp_single (i : ΞΉ) (m : M) (k : ΞΊ) (n : N) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (Finsupp.single i m βŠ—β‚œ Finsupp.single k n) = Finsupp.single (i, k) (m βŠ—β‚œ n) := by simp [finsuppTensorFinsupp] #align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single @[simp] theorem finsuppTensorFinsupp_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ N) (i : ΞΉ) (k : ΞΊ) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (f βŠ—β‚œ g) (i, k) = f i βŠ—β‚œ g k := by apply Finsupp.induction_linear f Β· simp Β· intro f₁ fβ‚‚ hf₁ hfβ‚‚ simp [add_tmul, hf₁, hfβ‚‚] intro i' m apply Finsupp.induction_linear g Β· simp Β· intro g₁ gβ‚‚ hg₁ hgβ‚‚ simp [tmul_add, hg₁, hgβ‚‚] intro k' n classical simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and] split_ifs <;> simp #align finsupp_tensor_finsupp_apply finsuppTensorFinsupp_apply @[simp] theorem finsuppTensorFinsupp_symm_single (i : ΞΉ Γ— ΞΊ) (m : M) (n : N) : (finsuppTensorFinsupp R S M N ΞΉ ΞΊ).symm (Finsupp.single i (m βŠ—β‚œ n)) = Finsupp.single i.1 m βŠ—β‚œ Finsupp.single i.2 n := Prod.casesOn i fun _ _ => (LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsupp_single _ _ _ _ _ _ _ _ _ _).symm #align finsupp_tensor_finsupp_symm_single finsuppTensorFinsupp_symm_single def finsuppTensorFinsuppLid : (ΞΉ β†’β‚€ R) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[R] ΞΉ Γ— ΞΊ β†’β‚€ N := finsuppTensorFinsupp R R R N ΞΉ ΞΊ β‰ͺ≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.lid R N) @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
293
295
theorem finsuppTensorFinsuppLid_apply_apply (f : ΞΉ β†’β‚€ R) (g : ΞΊ β†’β‚€ N) (a : ΞΉ) (b : ΞΊ) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (f βŠ—β‚œ[R] g) (a, b) = f a β€’ g b := by
simp [finsuppTensorFinsuppLid]
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ΞΉ ΞΊ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[S] ΞΉ Γ— ΞΊ β†’β‚€ M βŠ—[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ΞΉ) (finsuppLEquivDirectSum R N ΞΊ) β‰ͺ≫ₗ ((TensorProduct.directSum R S (fun _ : ΞΉ => M) fun _ : ΞΊ => N) β‰ͺ≫ₗ (finsuppLEquivDirectSum S (M βŠ—[R] N) (ΞΉ Γ— ΞΊ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp] theorem finsuppTensorFinsupp_single (i : ΞΉ) (m : M) (k : ΞΊ) (n : N) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (Finsupp.single i m βŠ—β‚œ Finsupp.single k n) = Finsupp.single (i, k) (m βŠ—β‚œ n) := by simp [finsuppTensorFinsupp] #align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single @[simp] theorem finsuppTensorFinsupp_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ N) (i : ΞΉ) (k : ΞΊ) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (f βŠ—β‚œ g) (i, k) = f i βŠ—β‚œ g k := by apply Finsupp.induction_linear f Β· simp Β· intro f₁ fβ‚‚ hf₁ hfβ‚‚ simp [add_tmul, hf₁, hfβ‚‚] intro i' m apply Finsupp.induction_linear g Β· simp Β· intro g₁ gβ‚‚ hg₁ hgβ‚‚ simp [tmul_add, hg₁, hgβ‚‚] intro k' n classical simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and] split_ifs <;> simp #align finsupp_tensor_finsupp_apply finsuppTensorFinsupp_apply @[simp] theorem finsuppTensorFinsupp_symm_single (i : ΞΉ Γ— ΞΊ) (m : M) (n : N) : (finsuppTensorFinsupp R S M N ΞΉ ΞΊ).symm (Finsupp.single i (m βŠ—β‚œ n)) = Finsupp.single i.1 m βŠ—β‚œ Finsupp.single i.2 n := Prod.casesOn i fun _ _ => (LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsupp_single _ _ _ _ _ _ _ _ _ _).symm #align finsupp_tensor_finsupp_symm_single finsuppTensorFinsupp_symm_single def finsuppTensorFinsuppLid : (ΞΉ β†’β‚€ R) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[R] ΞΉ Γ— ΞΊ β†’β‚€ N := finsuppTensorFinsupp R R R N ΞΉ ΞΊ β‰ͺ≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.lid R N) @[simp] theorem finsuppTensorFinsuppLid_apply_apply (f : ΞΉ β†’β‚€ R) (g : ΞΊ β†’β‚€ N) (a : ΞΉ) (b : ΞΊ) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (f βŠ—β‚œ[R] g) (a, b) = f a β€’ g b := by simp [finsuppTensorFinsuppLid] @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
298
301
theorem finsuppTensorFinsuppLid_single_tmul_single (a : ΞΉ) (b : ΞΊ) (r : R) (n : N) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (Finsupp.single a r βŠ—β‚œ[R] Finsupp.single b n) = Finsupp.single (a, b) (r β€’ n) := by
simp [finsuppTensorFinsuppLid]
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ΞΉ ΞΊ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[S] ΞΉ Γ— ΞΊ β†’β‚€ M βŠ—[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ΞΉ) (finsuppLEquivDirectSum R N ΞΊ) β‰ͺ≫ₗ ((TensorProduct.directSum R S (fun _ : ΞΉ => M) fun _ : ΞΊ => N) β‰ͺ≫ₗ (finsuppLEquivDirectSum S (M βŠ—[R] N) (ΞΉ Γ— ΞΊ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp] theorem finsuppTensorFinsupp_single (i : ΞΉ) (m : M) (k : ΞΊ) (n : N) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (Finsupp.single i m βŠ—β‚œ Finsupp.single k n) = Finsupp.single (i, k) (m βŠ—β‚œ n) := by simp [finsuppTensorFinsupp] #align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single @[simp] theorem finsuppTensorFinsupp_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ N) (i : ΞΉ) (k : ΞΊ) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (f βŠ—β‚œ g) (i, k) = f i βŠ—β‚œ g k := by apply Finsupp.induction_linear f Β· simp Β· intro f₁ fβ‚‚ hf₁ hfβ‚‚ simp [add_tmul, hf₁, hfβ‚‚] intro i' m apply Finsupp.induction_linear g Β· simp Β· intro g₁ gβ‚‚ hg₁ hgβ‚‚ simp [tmul_add, hg₁, hgβ‚‚] intro k' n classical simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and] split_ifs <;> simp #align finsupp_tensor_finsupp_apply finsuppTensorFinsupp_apply @[simp] theorem finsuppTensorFinsupp_symm_single (i : ΞΉ Γ— ΞΊ) (m : M) (n : N) : (finsuppTensorFinsupp R S M N ΞΉ ΞΊ).symm (Finsupp.single i (m βŠ—β‚œ n)) = Finsupp.single i.1 m βŠ—β‚œ Finsupp.single i.2 n := Prod.casesOn i fun _ _ => (LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsupp_single _ _ _ _ _ _ _ _ _ _).symm #align finsupp_tensor_finsupp_symm_single finsuppTensorFinsupp_symm_single def finsuppTensorFinsuppLid : (ΞΉ β†’β‚€ R) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[R] ΞΉ Γ— ΞΊ β†’β‚€ N := finsuppTensorFinsupp R R R N ΞΉ ΞΊ β‰ͺ≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.lid R N) @[simp] theorem finsuppTensorFinsuppLid_apply_apply (f : ΞΉ β†’β‚€ R) (g : ΞΊ β†’β‚€ N) (a : ΞΉ) (b : ΞΊ) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (f βŠ—β‚œ[R] g) (a, b) = f a β€’ g b := by simp [finsuppTensorFinsuppLid] @[simp] theorem finsuppTensorFinsuppLid_single_tmul_single (a : ΞΉ) (b : ΞΊ) (r : R) (n : N) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (Finsupp.single a r βŠ—β‚œ[R] Finsupp.single b n) = Finsupp.single (a, b) (r β€’ n) := by simp [finsuppTensorFinsuppLid] @[simp] theorem finsuppTensorFinsuppLid_symm_single_smul (i : ΞΉ Γ— ΞΊ) (r : R) (n : N) : (finsuppTensorFinsuppLid R N ΞΉ ΞΊ).symm (Finsupp.single i (r β€’ n)) = Finsupp.single i.1 r βŠ—β‚œ Finsupp.single i.2 n := Prod.casesOn i fun _ _ => (LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsuppLid_single_tmul_single ..).symm def finsuppTensorFinsuppRid : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ R) ≃ₗ[R] ΞΉ Γ— ΞΊ β†’β‚€ M := finsuppTensorFinsupp R R M R ΞΉ ΞΊ β‰ͺ≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.rid R M) @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
315
317
theorem finsuppTensorFinsuppRid_apply_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ R) (a : ΞΉ) (b : ΞΊ) : finsuppTensorFinsuppRid R M ΞΉ ΞΊ (f βŠ—β‚œ[R] g) (a, b) = g b β€’ f a := by
simp [finsuppTensorFinsuppRid]
1,657
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule variable (R S M N ΞΉ ΞΊ : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [Semiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] open scoped Classical in def finsuppTensorFinsupp : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[S] ΞΉ Γ— ΞΊ β†’β‚€ M βŠ—[R] N := TensorProduct.AlgebraTensorModule.congr (finsuppLEquivDirectSum S M ΞΉ) (finsuppLEquivDirectSum R N ΞΊ) β‰ͺ≫ₗ ((TensorProduct.directSum R S (fun _ : ΞΉ => M) fun _ : ΞΊ => N) β‰ͺ≫ₗ (finsuppLEquivDirectSum S (M βŠ—[R] N) (ΞΉ Γ— ΞΊ)).symm) #align finsupp_tensor_finsupp finsuppTensorFinsupp @[simp] theorem finsuppTensorFinsupp_single (i : ΞΉ) (m : M) (k : ΞΊ) (n : N) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (Finsupp.single i m βŠ—β‚œ Finsupp.single k n) = Finsupp.single (i, k) (m βŠ—β‚œ n) := by simp [finsuppTensorFinsupp] #align finsupp_tensor_finsupp_single finsuppTensorFinsupp_single @[simp] theorem finsuppTensorFinsupp_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ N) (i : ΞΉ) (k : ΞΊ) : finsuppTensorFinsupp R S M N ΞΉ ΞΊ (f βŠ—β‚œ g) (i, k) = f i βŠ—β‚œ g k := by apply Finsupp.induction_linear f Β· simp Β· intro f₁ fβ‚‚ hf₁ hfβ‚‚ simp [add_tmul, hf₁, hfβ‚‚] intro i' m apply Finsupp.induction_linear g Β· simp Β· intro g₁ gβ‚‚ hg₁ hgβ‚‚ simp [tmul_add, hg₁, hgβ‚‚] intro k' n classical simp_rw [finsuppTensorFinsupp_single, Finsupp.single_apply, Prod.mk.inj_iff, ite_and] split_ifs <;> simp #align finsupp_tensor_finsupp_apply finsuppTensorFinsupp_apply @[simp] theorem finsuppTensorFinsupp_symm_single (i : ΞΉ Γ— ΞΊ) (m : M) (n : N) : (finsuppTensorFinsupp R S M N ΞΉ ΞΊ).symm (Finsupp.single i (m βŠ—β‚œ n)) = Finsupp.single i.1 m βŠ—β‚œ Finsupp.single i.2 n := Prod.casesOn i fun _ _ => (LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsupp_single _ _ _ _ _ _ _ _ _ _).symm #align finsupp_tensor_finsupp_symm_single finsuppTensorFinsupp_symm_single def finsuppTensorFinsuppLid : (ΞΉ β†’β‚€ R) βŠ—[R] (ΞΊ β†’β‚€ N) ≃ₗ[R] ΞΉ Γ— ΞΊ β†’β‚€ N := finsuppTensorFinsupp R R R N ΞΉ ΞΊ β‰ͺ≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.lid R N) @[simp] theorem finsuppTensorFinsuppLid_apply_apply (f : ΞΉ β†’β‚€ R) (g : ΞΊ β†’β‚€ N) (a : ΞΉ) (b : ΞΊ) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (f βŠ—β‚œ[R] g) (a, b) = f a β€’ g b := by simp [finsuppTensorFinsuppLid] @[simp] theorem finsuppTensorFinsuppLid_single_tmul_single (a : ΞΉ) (b : ΞΊ) (r : R) (n : N) : finsuppTensorFinsuppLid R N ΞΉ ΞΊ (Finsupp.single a r βŠ—β‚œ[R] Finsupp.single b n) = Finsupp.single (a, b) (r β€’ n) := by simp [finsuppTensorFinsuppLid] @[simp] theorem finsuppTensorFinsuppLid_symm_single_smul (i : ΞΉ Γ— ΞΊ) (r : R) (n : N) : (finsuppTensorFinsuppLid R N ΞΉ ΞΊ).symm (Finsupp.single i (r β€’ n)) = Finsupp.single i.1 r βŠ—β‚œ Finsupp.single i.2 n := Prod.casesOn i fun _ _ => (LinearEquiv.symm_apply_eq _).2 (finsuppTensorFinsuppLid_single_tmul_single ..).symm def finsuppTensorFinsuppRid : (ΞΉ β†’β‚€ M) βŠ—[R] (ΞΊ β†’β‚€ R) ≃ₗ[R] ΞΉ Γ— ΞΊ β†’β‚€ M := finsuppTensorFinsupp R R M R ΞΉ ΞΊ β‰ͺ≫ₗ Finsupp.lcongr (Equiv.refl _) (TensorProduct.rid R M) @[simp] theorem finsuppTensorFinsuppRid_apply_apply (f : ΞΉ β†’β‚€ M) (g : ΞΊ β†’β‚€ R) (a : ΞΉ) (b : ΞΊ) : finsuppTensorFinsuppRid R M ΞΉ ΞΊ (f βŠ—β‚œ[R] g) (a, b) = g b β€’ f a := by simp [finsuppTensorFinsuppRid] @[simp]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
320
323
theorem finsuppTensorFinsuppRid_single_tmul_single (a : ΞΉ) (b : ΞΊ) (m : M) (r : R) : finsuppTensorFinsuppRid R M ΞΉ ΞΊ (Finsupp.single a m βŠ—β‚œ[R] Finsupp.single b r) = Finsupp.single (a, b) (r β€’ m) := by
simp [finsuppTensorFinsuppRid]
1,657
import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic import Mathlib.CategoryTheory.Monoidal.Functorial import Mathlib.CategoryTheory.Monoidal.Types.Basic import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.CategoryTheory.Linear.LinearFunctor #align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"95a87616d63b3cb49d3fe678d416fbe9c4217bf4" set_option linter.uppercaseLean3 false -- `Module` noncomputable section open CategoryTheory namespace ModuleCat universe u open scoped Classical variable (R : Type u) section variable [Ring R] @[simps] def free : Type u β₯€ ModuleCat R where obj X := ModuleCat.of R (X β†’β‚€ R) map {X Y} f := Finsupp.lmapDomain _ _ f map_id := by intros; exact Finsupp.lmapDomain_id _ _ map_comp := by intros; exact Finsupp.lmapDomain_comp _ _ _ _ #align Module.free ModuleCat.free def adj : free R ⊣ forget (ModuleCat.{u} R) := Adjunction.mkOfHomEquiv { homEquiv := fun X M => (Finsupp.lift M R X).toEquiv.symm homEquiv_naturality_left_symm := fun {_ _} M f g => Finsupp.lhom_ext' fun x => LinearMap.ext_ring (Finsupp.sum_mapDomain_index_addMonoidHom fun y => (smulAddHom R M).flip (g y)).symm } #align Module.adj ModuleCat.adj instance : (forget (ModuleCat.{u} R)).IsRightAdjoint := (adj R).isRightAdjoint end namespace Free open MonoidalCategory variable [CommRing R] attribute [local ext] TensorProduct.ext def Ξ΅ : πŸ™_ (ModuleCat.{u} R) ⟢ (free R).obj (πŸ™_ (Type u)) := Finsupp.lsingle PUnit.unit #align Module.free.Ξ΅ ModuleCat.Free.Ξ΅ -- This lemma has always been bad, but lean4#2644 made `simp` start noticing @[simp, nolint simpNF] theorem Ξ΅_apply (r : R) : Ξ΅ R r = Finsupp.single PUnit.unit r := rfl #align Module.free.Ξ΅_apply ModuleCat.Free.Ξ΅_apply def ΞΌ (Ξ± Ξ² : Type u) : (free R).obj Ξ± βŠ— (free R).obj Ξ² β‰… (free R).obj (Ξ± βŠ— Ξ²) := (finsuppTensorFinsupp' R Ξ± Ξ²).toModuleIso #align Module.free.ΞΌ ModuleCat.Free.ΞΌ
Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean
89
109
theorem ΞΌ_natural {X Y X' Y' : Type u} (f : X ⟢ Y) (g : X' ⟢ Y') : ((free R).map f βŠ— (free R).map g) ≫ (ΞΌ R Y Y').hom = (ΞΌ R X X').hom ≫ (free R).map (f βŠ— g) := by
-- Porting note (#11041): broken ext apply TensorProduct.ext apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x' apply LinearMap.ext_ring apply Finsupp.ext intro ⟨y, y'⟩ -- Porting note (#10934): used to be dsimp [ΞΌ] change (finsuppTensorFinsupp' R Y Y') (Finsupp.mapDomain f (Finsupp.single x 1) βŠ—β‚œ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _ = (Finsupp.mapDomain (f βŠ— g) (finsuppTensorFinsupp' R X X' (Finsupp.single x 1 βŠ—β‚œ[R] Finsupp.single x' 1))) _ -- extra `rfl` after leanprover/lean4#2466 simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one, Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl
1,658
import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic import Mathlib.CategoryTheory.Monoidal.Functorial import Mathlib.CategoryTheory.Monoidal.Types.Basic import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.CategoryTheory.Linear.LinearFunctor #align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"95a87616d63b3cb49d3fe678d416fbe9c4217bf4" set_option linter.uppercaseLean3 false -- `Module` noncomputable section open CategoryTheory namespace ModuleCat universe u open scoped Classical variable (R : Type u) section variable [Ring R] @[simps] def free : Type u β₯€ ModuleCat R where obj X := ModuleCat.of R (X β†’β‚€ R) map {X Y} f := Finsupp.lmapDomain _ _ f map_id := by intros; exact Finsupp.lmapDomain_id _ _ map_comp := by intros; exact Finsupp.lmapDomain_comp _ _ _ _ #align Module.free ModuleCat.free def adj : free R ⊣ forget (ModuleCat.{u} R) := Adjunction.mkOfHomEquiv { homEquiv := fun X M => (Finsupp.lift M R X).toEquiv.symm homEquiv_naturality_left_symm := fun {_ _} M f g => Finsupp.lhom_ext' fun x => LinearMap.ext_ring (Finsupp.sum_mapDomain_index_addMonoidHom fun y => (smulAddHom R M).flip (g y)).symm } #align Module.adj ModuleCat.adj instance : (forget (ModuleCat.{u} R)).IsRightAdjoint := (adj R).isRightAdjoint end namespace Free open MonoidalCategory variable [CommRing R] attribute [local ext] TensorProduct.ext def Ξ΅ : πŸ™_ (ModuleCat.{u} R) ⟢ (free R).obj (πŸ™_ (Type u)) := Finsupp.lsingle PUnit.unit #align Module.free.Ξ΅ ModuleCat.Free.Ξ΅ -- This lemma has always been bad, but lean4#2644 made `simp` start noticing @[simp, nolint simpNF] theorem Ξ΅_apply (r : R) : Ξ΅ R r = Finsupp.single PUnit.unit r := rfl #align Module.free.Ξ΅_apply ModuleCat.Free.Ξ΅_apply def ΞΌ (Ξ± Ξ² : Type u) : (free R).obj Ξ± βŠ— (free R).obj Ξ² β‰… (free R).obj (Ξ± βŠ— Ξ²) := (finsuppTensorFinsupp' R Ξ± Ξ²).toModuleIso #align Module.free.ΞΌ ModuleCat.Free.ΞΌ theorem ΞΌ_natural {X Y X' Y' : Type u} (f : X ⟢ Y) (g : X' ⟢ Y') : ((free R).map f βŠ— (free R).map g) ≫ (ΞΌ R Y Y').hom = (ΞΌ R X X').hom ≫ (free R).map (f βŠ— g) := by -- Porting note (#11041): broken ext apply TensorProduct.ext apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x' apply LinearMap.ext_ring apply Finsupp.ext intro ⟨y, y'⟩ -- Porting note (#10934): used to be dsimp [ΞΌ] change (finsuppTensorFinsupp' R Y Y') (Finsupp.mapDomain f (Finsupp.single x 1) βŠ—β‚œ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _ = (Finsupp.mapDomain (f βŠ— g) (finsuppTensorFinsupp' R X X' (Finsupp.single x 1 βŠ—β‚œ[R] Finsupp.single x' 1))) _ -- extra `rfl` after leanprover/lean4#2466 simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one, Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl #align Module.free.ΞΌ_natural ModuleCat.Free.ΞΌ_natural
Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean
112
129
theorem left_unitality (X : Type u) : (Ξ»_ ((free R).obj X)).hom = (Ξ΅ R βŠ— πŸ™ ((free R).obj X)) ≫ (ΞΌ R (πŸ™_ (Type u)) X).hom ≫ map (free R).obj (Ξ»_ X).hom := by
-- Porting note (#11041): broken ext apply TensorProduct.ext apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.ext intro x' -- Porting note (#10934): used to be dsimp [Ξ΅, ΞΌ] let q : X β†’β‚€ R := ((Ξ»_ (of R (X β†’β‚€ R))).hom) (1 βŠ—β‚œ[R] Finsupp.single x 1) change q x' = Finsupp.mapDomain (Ξ»_ X).hom (finsuppTensorFinsupp' R (πŸ™_ (Type u)) X (Finsupp.single PUnit.unit 1 βŠ—β‚œ[R] Finsupp.single x 1)) x' simp_rw [q, finsuppTensorFinsupp'_single_tmul_single, ModuleCat.MonoidalCategory.leftUnitor_hom_apply, mul_one, Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply, one_smul]
1,658
import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic import Mathlib.CategoryTheory.Monoidal.Functorial import Mathlib.CategoryTheory.Monoidal.Types.Basic import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.CategoryTheory.Linear.LinearFunctor #align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"95a87616d63b3cb49d3fe678d416fbe9c4217bf4" set_option linter.uppercaseLean3 false -- `Module` noncomputable section open CategoryTheory namespace ModuleCat universe u open scoped Classical variable (R : Type u) section variable [Ring R] @[simps] def free : Type u β₯€ ModuleCat R where obj X := ModuleCat.of R (X β†’β‚€ R) map {X Y} f := Finsupp.lmapDomain _ _ f map_id := by intros; exact Finsupp.lmapDomain_id _ _ map_comp := by intros; exact Finsupp.lmapDomain_comp _ _ _ _ #align Module.free ModuleCat.free def adj : free R ⊣ forget (ModuleCat.{u} R) := Adjunction.mkOfHomEquiv { homEquiv := fun X M => (Finsupp.lift M R X).toEquiv.symm homEquiv_naturality_left_symm := fun {_ _} M f g => Finsupp.lhom_ext' fun x => LinearMap.ext_ring (Finsupp.sum_mapDomain_index_addMonoidHom fun y => (smulAddHom R M).flip (g y)).symm } #align Module.adj ModuleCat.adj instance : (forget (ModuleCat.{u} R)).IsRightAdjoint := (adj R).isRightAdjoint end namespace Free open MonoidalCategory variable [CommRing R] attribute [local ext] TensorProduct.ext def Ξ΅ : πŸ™_ (ModuleCat.{u} R) ⟢ (free R).obj (πŸ™_ (Type u)) := Finsupp.lsingle PUnit.unit #align Module.free.Ξ΅ ModuleCat.Free.Ξ΅ -- This lemma has always been bad, but lean4#2644 made `simp` start noticing @[simp, nolint simpNF] theorem Ξ΅_apply (r : R) : Ξ΅ R r = Finsupp.single PUnit.unit r := rfl #align Module.free.Ξ΅_apply ModuleCat.Free.Ξ΅_apply def ΞΌ (Ξ± Ξ² : Type u) : (free R).obj Ξ± βŠ— (free R).obj Ξ² β‰… (free R).obj (Ξ± βŠ— Ξ²) := (finsuppTensorFinsupp' R Ξ± Ξ²).toModuleIso #align Module.free.ΞΌ ModuleCat.Free.ΞΌ theorem ΞΌ_natural {X Y X' Y' : Type u} (f : X ⟢ Y) (g : X' ⟢ Y') : ((free R).map f βŠ— (free R).map g) ≫ (ΞΌ R Y Y').hom = (ΞΌ R X X').hom ≫ (free R).map (f βŠ— g) := by -- Porting note (#11041): broken ext apply TensorProduct.ext apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x' apply LinearMap.ext_ring apply Finsupp.ext intro ⟨y, y'⟩ -- Porting note (#10934): used to be dsimp [ΞΌ] change (finsuppTensorFinsupp' R Y Y') (Finsupp.mapDomain f (Finsupp.single x 1) βŠ—β‚œ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _ = (Finsupp.mapDomain (f βŠ— g) (finsuppTensorFinsupp' R X X' (Finsupp.single x 1 βŠ—β‚œ[R] Finsupp.single x' 1))) _ -- extra `rfl` after leanprover/lean4#2466 simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one, Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl #align Module.free.ΞΌ_natural ModuleCat.Free.ΞΌ_natural theorem left_unitality (X : Type u) : (Ξ»_ ((free R).obj X)).hom = (Ξ΅ R βŠ— πŸ™ ((free R).obj X)) ≫ (ΞΌ R (πŸ™_ (Type u)) X).hom ≫ map (free R).obj (Ξ»_ X).hom := by -- Porting note (#11041): broken ext apply TensorProduct.ext apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.ext intro x' -- Porting note (#10934): used to be dsimp [Ξ΅, ΞΌ] let q : X β†’β‚€ R := ((Ξ»_ (of R (X β†’β‚€ R))).hom) (1 βŠ—β‚œ[R] Finsupp.single x 1) change q x' = Finsupp.mapDomain (Ξ»_ X).hom (finsuppTensorFinsupp' R (πŸ™_ (Type u)) X (Finsupp.single PUnit.unit 1 βŠ—β‚œ[R] Finsupp.single x 1)) x' simp_rw [q, finsuppTensorFinsupp'_single_tmul_single, ModuleCat.MonoidalCategory.leftUnitor_hom_apply, mul_one, Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply, one_smul] #align Module.free.left_unitality ModuleCat.Free.left_unitality
Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean
132
149
theorem right_unitality (X : Type u) : (ρ_ ((free R).obj X)).hom = (πŸ™ ((free R).obj X) βŠ— Ξ΅ R) ≫ (ΞΌ R X (πŸ™_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom := by
-- Porting note (#11041): broken ext apply TensorProduct.ext apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply LinearMap.ext_ring apply Finsupp.ext intro x' -- Porting note (#10934): used to be dsimp [Ξ΅, ΞΌ] let q : X β†’β‚€ R := ((ρ_ (of R (X β†’β‚€ R))).hom) (Finsupp.single x 1 βŠ—β‚œ[R] 1) change q x' = Finsupp.mapDomain (ρ_ X).hom (finsuppTensorFinsupp' R X (πŸ™_ (Type u)) (Finsupp.single x 1 βŠ—β‚œ[R] Finsupp.single PUnit.unit 1)) x' simp_rw [q, finsuppTensorFinsupp'_single_tmul_single, ModuleCat.MonoidalCategory.rightUnitor_hom_apply, mul_one, Finsupp.mapDomain_single, CategoryTheory.rightUnitor_hom_apply, one_smul]
1,658
import Mathlib.LinearAlgebra.BilinearMap import Mathlib.LinearAlgebra.BilinearForm.Basic import Mathlib.LinearAlgebra.Basis import Mathlib.Algebra.Algebra.Bilinear open LinearMap (BilinForm) universe u v w variable {R : Type*} {M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] variable {R₁ : Type*} {M₁ : Type*} [CommRing R₁] [AddCommGroup M₁] [Module R₁ M₁] variable {V : Type*} {K : Type*} [Field K] [AddCommGroup V] [Module K V] variable {B : BilinForm R M} {B₁ : BilinForm R₁ M₁} namespace LinearMap namespace BilinForm section ToLin' def toLinHomAux₁ (A : BilinForm R M) (x : M) : M β†’β‚—[R] R := A x #align bilin_form.to_lin_hom_aux₁ LinearMap.BilinForm.toLinHomAux₁ @[deprecated (since := "2024-04-26")] def toLinHomAuxβ‚‚ (A : BilinForm R M) : M β†’β‚—[R] M β†’β‚—[R] R := A #align bilin_form.to_lin_hom_auxβ‚‚ LinearMap.BilinForm.toLinHomAuxβ‚‚ @[deprecated (since := "2024-04-26")] def toLinHom : BilinForm R M β†’β‚—[R] M β†’β‚—[R] M β†’β‚—[R] R := LinearMap.id #align bilin_form.to_lin_hom LinearMap.BilinForm.toLinHom set_option linter.deprecated false in @[deprecated (since := "2024-04-26")] theorem toLin'_apply (A : BilinForm R M) (x : M) : toLinHom (M := M) A x = A x := rfl #align bilin_form.to_lin'_apply LinearMap.BilinForm.toLin'_apply variable (B) theorem sum_left {Ξ±} (t : Finset Ξ±) (g : Ξ± β†’ M) (w : M) : B (βˆ‘ i ∈ t, g i) w = βˆ‘ i ∈ t, B (g i) w := B.map_sumβ‚‚ t g w #align bilin_form.sum_left LinearMap.BilinForm.sum_left variable (w : M) theorem sum_right {Ξ±} (t : Finset Ξ±) (w : M) (g : Ξ± β†’ M) : B w (βˆ‘ i ∈ t, g i) = βˆ‘ i ∈ t, B w (g i) := map_sum _ _ _ #align bilin_form.sum_right LinearMap.BilinForm.sum_right
Mathlib/LinearAlgebra/BilinearForm/Hom.lean
90
92
theorem sum_apply {Ξ±} (t : Finset Ξ±) (B : Ξ± β†’ BilinForm R M) (v w : M) : (βˆ‘ i ∈ t, B i) v w = βˆ‘ i ∈ t, B i v w := by
simp only [coeFn_sum, Finset.sum_apply]
1,659
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Multilinear.Basic #align_import linear_algebra.multilinear.basis from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" open MultilinearMap variable {R : Type*} {ΞΉ : Type*} {n : β„•} {M : Fin n β†’ Type*} {Mβ‚‚ : Type*} {M₃ : Type*} variable [CommSemiring R] [AddCommMonoid Mβ‚‚] [AddCommMonoid M₃] [βˆ€ i, AddCommMonoid (M i)] variable [βˆ€ i, Module R (M i)] [Module R Mβ‚‚] [Module R M₃]
Mathlib/LinearAlgebra/Multilinear/Basis.lean
32
49
theorem Basis.ext_multilinear_fin {f g : MultilinearMap R M Mβ‚‚} {ι₁ : Fin n β†’ Type*} (e : βˆ€ i, Basis (ι₁ i) R (M i)) (h : βˆ€ v : βˆ€ i, ι₁ i, (f fun i => e i (v i)) = g fun i => e i (v i)) : f = g := by
induction' n with m hm Β· ext x convert h finZeroElim Β· apply Function.LeftInverse.injective uncurry_curryLeft refine Basis.ext (e 0) ?_ intro i apply hm (Fin.tail e) intro j convert h (Fin.cons i j) iterate 2 rw [curryLeft_apply] congr 1 with x refine Fin.cases rfl (fun x => ?_) x dsimp [Fin.tail] rw [Fin.cons_succ, Fin.cons_succ]
1,660
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Multilinear.Basic #align_import linear_algebra.multilinear.basis from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" open MultilinearMap variable {R : Type*} {ΞΉ : Type*} {n : β„•} {M : Fin n β†’ Type*} {Mβ‚‚ : Type*} {M₃ : Type*} variable [CommSemiring R] [AddCommMonoid Mβ‚‚] [AddCommMonoid M₃] [βˆ€ i, AddCommMonoid (M i)] variable [βˆ€ i, Module R (M i)] [Module R Mβ‚‚] [Module R M₃] theorem Basis.ext_multilinear_fin {f g : MultilinearMap R M Mβ‚‚} {ι₁ : Fin n β†’ Type*} (e : βˆ€ i, Basis (ι₁ i) R (M i)) (h : βˆ€ v : βˆ€ i, ι₁ i, (f fun i => e i (v i)) = g fun i => e i (v i)) : f = g := by induction' n with m hm Β· ext x convert h finZeroElim Β· apply Function.LeftInverse.injective uncurry_curryLeft refine Basis.ext (e 0) ?_ intro i apply hm (Fin.tail e) intro j convert h (Fin.cons i j) iterate 2 rw [curryLeft_apply] congr 1 with x refine Fin.cases rfl (fun x => ?_) x dsimp [Fin.tail] rw [Fin.cons_succ, Fin.cons_succ] #align basis.ext_multilinear_fin Basis.ext_multilinear_fin
Mathlib/LinearAlgebra/Multilinear/Basis.lean
56
61
theorem Basis.ext_multilinear [Finite ΞΉ] {f g : MultilinearMap R (fun _ : ΞΉ => Mβ‚‚) M₃} {ι₁ : Type*} (e : Basis ι₁ R Mβ‚‚) (h : βˆ€ v : ΞΉ β†’ ι₁, (f fun i => e (v i)) = g fun i => e (v i)) : f = g := by
cases nonempty_fintype ι exact (domDomCongr_eq_iff (Fintype.equivFin ι) f g).mp (Basis.ext_multilinear_fin (fun _ => e) fun i => h (i ∘ _))
1,660
import Mathlib.Data.Matrix.Basis import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Pi #align_import linear_algebra.std_basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule namespace LinearMap variable (R : Type*) {ΞΉ : Type*} [Semiring R] (Ο† : ΞΉ β†’ Type*) [βˆ€ i, AddCommMonoid (Ο† i)] [βˆ€ i, Module R (Ο† i)] [DecidableEq ΞΉ] def stdBasis : βˆ€ i : ΞΉ, Ο† i β†’β‚—[R] βˆ€ i, Ο† i := single #align linear_map.std_basis LinearMap.stdBasis theorem stdBasis_apply (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b = update (0 : (a : ΞΉ) β†’ Ο† a) i b := rfl #align linear_map.std_basis_apply LinearMap.stdBasis_apply @[simp]
Mathlib/LinearAlgebra/StdBasis.lean
55
57
theorem stdBasis_apply' (i i' : ΞΉ) : (stdBasis R (fun _x : ΞΉ => R) i) 1 i' = ite (i = i') 1 0 := by
rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] congr 1; rw [eq_iff_iff, eq_comm]
1,661
import Mathlib.Data.Matrix.Basis import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Pi #align_import linear_algebra.std_basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule namespace LinearMap variable (R : Type*) {ΞΉ : Type*} [Semiring R] (Ο† : ΞΉ β†’ Type*) [βˆ€ i, AddCommMonoid (Ο† i)] [βˆ€ i, Module R (Ο† i)] [DecidableEq ΞΉ] def stdBasis : βˆ€ i : ΞΉ, Ο† i β†’β‚—[R] βˆ€ i, Ο† i := single #align linear_map.std_basis LinearMap.stdBasis theorem stdBasis_apply (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b = update (0 : (a : ΞΉ) β†’ Ο† a) i b := rfl #align linear_map.std_basis_apply LinearMap.stdBasis_apply @[simp] theorem stdBasis_apply' (i i' : ΞΉ) : (stdBasis R (fun _x : ΞΉ => R) i) 1 i' = ite (i = i') 1 0 := by rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] congr 1; rw [eq_iff_iff, eq_comm] #align linear_map.std_basis_apply' LinearMap.stdBasis_apply' theorem coe_stdBasis (i : ΞΉ) : ⇑(stdBasis R Ο† i) = Pi.single i := rfl #align linear_map.coe_std_basis LinearMap.coe_stdBasis @[simp] theorem stdBasis_same (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b i = b := Pi.single_eq_same i b #align linear_map.std_basis_same LinearMap.stdBasis_same theorem stdBasis_ne (i j : ΞΉ) (h : j β‰  i) (b : Ο† i) : stdBasis R Ο† i b j = 0 := Pi.single_eq_of_ne h b #align linear_map.std_basis_ne LinearMap.stdBasis_ne
Mathlib/LinearAlgebra/StdBasis.lean
73
77
theorem stdBasis_eq_pi_diag (i : ΞΉ) : stdBasis R Ο† i = pi (diag i) := by
ext x j -- Porting note: made types explicit convert (update_apply (R := R) (Ο† := Ο†) (ΞΉ := ΞΉ) 0 x i j _).symm rfl
1,661
import Mathlib.Data.Matrix.Basis import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Pi #align_import linear_algebra.std_basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule namespace LinearMap variable (R : Type*) {ΞΉ : Type*} [Semiring R] (Ο† : ΞΉ β†’ Type*) [βˆ€ i, AddCommMonoid (Ο† i)] [βˆ€ i, Module R (Ο† i)] [DecidableEq ΞΉ] def stdBasis : βˆ€ i : ΞΉ, Ο† i β†’β‚—[R] βˆ€ i, Ο† i := single #align linear_map.std_basis LinearMap.stdBasis theorem stdBasis_apply (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b = update (0 : (a : ΞΉ) β†’ Ο† a) i b := rfl #align linear_map.std_basis_apply LinearMap.stdBasis_apply @[simp] theorem stdBasis_apply' (i i' : ΞΉ) : (stdBasis R (fun _x : ΞΉ => R) i) 1 i' = ite (i = i') 1 0 := by rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] congr 1; rw [eq_iff_iff, eq_comm] #align linear_map.std_basis_apply' LinearMap.stdBasis_apply' theorem coe_stdBasis (i : ΞΉ) : ⇑(stdBasis R Ο† i) = Pi.single i := rfl #align linear_map.coe_std_basis LinearMap.coe_stdBasis @[simp] theorem stdBasis_same (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b i = b := Pi.single_eq_same i b #align linear_map.std_basis_same LinearMap.stdBasis_same theorem stdBasis_ne (i j : ΞΉ) (h : j β‰  i) (b : Ο† i) : stdBasis R Ο† i b j = 0 := Pi.single_eq_of_ne h b #align linear_map.std_basis_ne LinearMap.stdBasis_ne theorem stdBasis_eq_pi_diag (i : ΞΉ) : stdBasis R Ο† i = pi (diag i) := by ext x j -- Porting note: made types explicit convert (update_apply (R := R) (Ο† := Ο†) (ΞΉ := ΞΉ) 0 x i j _).symm rfl #align linear_map.std_basis_eq_pi_diag LinearMap.stdBasis_eq_pi_diag theorem ker_stdBasis (i : ΞΉ) : ker (stdBasis R Ο† i) = βŠ₯ := ker_eq_bot_of_injective <| Pi.single_injective _ _ #align linear_map.ker_std_basis LinearMap.ker_stdBasis
Mathlib/LinearAlgebra/StdBasis.lean
84
85
theorem proj_comp_stdBasis (i j : ΞΉ) : (proj i).comp (stdBasis R Ο† j) = diag j i := by
rw [stdBasis_eq_pi_diag, proj_pi]
1,661
import Mathlib.Data.Matrix.Basis import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Pi #align_import linear_algebra.std_basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule namespace LinearMap variable (R : Type*) {ΞΉ : Type*} [Semiring R] (Ο† : ΞΉ β†’ Type*) [βˆ€ i, AddCommMonoid (Ο† i)] [βˆ€ i, Module R (Ο† i)] [DecidableEq ΞΉ] def stdBasis : βˆ€ i : ΞΉ, Ο† i β†’β‚—[R] βˆ€ i, Ο† i := single #align linear_map.std_basis LinearMap.stdBasis theorem stdBasis_apply (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b = update (0 : (a : ΞΉ) β†’ Ο† a) i b := rfl #align linear_map.std_basis_apply LinearMap.stdBasis_apply @[simp] theorem stdBasis_apply' (i i' : ΞΉ) : (stdBasis R (fun _x : ΞΉ => R) i) 1 i' = ite (i = i') 1 0 := by rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] congr 1; rw [eq_iff_iff, eq_comm] #align linear_map.std_basis_apply' LinearMap.stdBasis_apply' theorem coe_stdBasis (i : ΞΉ) : ⇑(stdBasis R Ο† i) = Pi.single i := rfl #align linear_map.coe_std_basis LinearMap.coe_stdBasis @[simp] theorem stdBasis_same (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b i = b := Pi.single_eq_same i b #align linear_map.std_basis_same LinearMap.stdBasis_same theorem stdBasis_ne (i j : ΞΉ) (h : j β‰  i) (b : Ο† i) : stdBasis R Ο† i b j = 0 := Pi.single_eq_of_ne h b #align linear_map.std_basis_ne LinearMap.stdBasis_ne theorem stdBasis_eq_pi_diag (i : ΞΉ) : stdBasis R Ο† i = pi (diag i) := by ext x j -- Porting note: made types explicit convert (update_apply (R := R) (Ο† := Ο†) (ΞΉ := ΞΉ) 0 x i j _).symm rfl #align linear_map.std_basis_eq_pi_diag LinearMap.stdBasis_eq_pi_diag theorem ker_stdBasis (i : ΞΉ) : ker (stdBasis R Ο† i) = βŠ₯ := ker_eq_bot_of_injective <| Pi.single_injective _ _ #align linear_map.ker_std_basis LinearMap.ker_stdBasis theorem proj_comp_stdBasis (i j : ΞΉ) : (proj i).comp (stdBasis R Ο† j) = diag j i := by rw [stdBasis_eq_pi_diag, proj_pi] #align linear_map.proj_comp_std_basis LinearMap.proj_comp_stdBasis theorem proj_stdBasis_same (i : ΞΉ) : (proj i).comp (stdBasis R Ο† i) = id := LinearMap.ext <| stdBasis_same R Ο† i #align linear_map.proj_std_basis_same LinearMap.proj_stdBasis_same theorem proj_stdBasis_ne (i j : ΞΉ) (h : i β‰  j) : (proj i).comp (stdBasis R Ο† j) = 0 := LinearMap.ext <| stdBasis_ne R Ο† _ _ h #align linear_map.proj_std_basis_ne LinearMap.proj_stdBasis_ne
Mathlib/LinearAlgebra/StdBasis.lean
96
103
theorem iSup_range_stdBasis_le_iInf_ker_proj (I J : Set ΞΉ) (h : Disjoint I J) : ⨆ i ∈ I, range (stdBasis R Ο† i) ≀ β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) := by
refine iSup_le fun i => iSup_le fun hi => range_le_iff_comap.2 ?_ simp only [← ker_comp, eq_top_iff, SetLike.le_def, mem_ker, comap_iInf, mem_iInf] rintro b - j hj rw [proj_stdBasis_ne R Ο† j i, zero_apply] rintro rfl exact h.le_bot ⟨hi, hj⟩
1,661
import Mathlib.Data.Matrix.Basis import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Pi #align_import linear_algebra.std_basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule namespace LinearMap variable (R : Type*) {ΞΉ : Type*} [Semiring R] (Ο† : ΞΉ β†’ Type*) [βˆ€ i, AddCommMonoid (Ο† i)] [βˆ€ i, Module R (Ο† i)] [DecidableEq ΞΉ] def stdBasis : βˆ€ i : ΞΉ, Ο† i β†’β‚—[R] βˆ€ i, Ο† i := single #align linear_map.std_basis LinearMap.stdBasis theorem stdBasis_apply (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b = update (0 : (a : ΞΉ) β†’ Ο† a) i b := rfl #align linear_map.std_basis_apply LinearMap.stdBasis_apply @[simp] theorem stdBasis_apply' (i i' : ΞΉ) : (stdBasis R (fun _x : ΞΉ => R) i) 1 i' = ite (i = i') 1 0 := by rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] congr 1; rw [eq_iff_iff, eq_comm] #align linear_map.std_basis_apply' LinearMap.stdBasis_apply' theorem coe_stdBasis (i : ΞΉ) : ⇑(stdBasis R Ο† i) = Pi.single i := rfl #align linear_map.coe_std_basis LinearMap.coe_stdBasis @[simp] theorem stdBasis_same (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b i = b := Pi.single_eq_same i b #align linear_map.std_basis_same LinearMap.stdBasis_same theorem stdBasis_ne (i j : ΞΉ) (h : j β‰  i) (b : Ο† i) : stdBasis R Ο† i b j = 0 := Pi.single_eq_of_ne h b #align linear_map.std_basis_ne LinearMap.stdBasis_ne theorem stdBasis_eq_pi_diag (i : ΞΉ) : stdBasis R Ο† i = pi (diag i) := by ext x j -- Porting note: made types explicit convert (update_apply (R := R) (Ο† := Ο†) (ΞΉ := ΞΉ) 0 x i j _).symm rfl #align linear_map.std_basis_eq_pi_diag LinearMap.stdBasis_eq_pi_diag theorem ker_stdBasis (i : ΞΉ) : ker (stdBasis R Ο† i) = βŠ₯ := ker_eq_bot_of_injective <| Pi.single_injective _ _ #align linear_map.ker_std_basis LinearMap.ker_stdBasis theorem proj_comp_stdBasis (i j : ΞΉ) : (proj i).comp (stdBasis R Ο† j) = diag j i := by rw [stdBasis_eq_pi_diag, proj_pi] #align linear_map.proj_comp_std_basis LinearMap.proj_comp_stdBasis theorem proj_stdBasis_same (i : ΞΉ) : (proj i).comp (stdBasis R Ο† i) = id := LinearMap.ext <| stdBasis_same R Ο† i #align linear_map.proj_std_basis_same LinearMap.proj_stdBasis_same theorem proj_stdBasis_ne (i j : ΞΉ) (h : i β‰  j) : (proj i).comp (stdBasis R Ο† j) = 0 := LinearMap.ext <| stdBasis_ne R Ο† _ _ h #align linear_map.proj_std_basis_ne LinearMap.proj_stdBasis_ne theorem iSup_range_stdBasis_le_iInf_ker_proj (I J : Set ΞΉ) (h : Disjoint I J) : ⨆ i ∈ I, range (stdBasis R Ο† i) ≀ β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) := by refine iSup_le fun i => iSup_le fun hi => range_le_iff_comap.2 ?_ simp only [← ker_comp, eq_top_iff, SetLike.le_def, mem_ker, comap_iInf, mem_iInf] rintro b - j hj rw [proj_stdBasis_ne R Ο† j i, zero_apply] rintro rfl exact h.le_bot ⟨hi, hj⟩ #align linear_map.supr_range_std_basis_le_infi_ker_proj LinearMap.iSup_range_stdBasis_le_iInf_ker_proj theorem iInf_ker_proj_le_iSup_range_stdBasis {I : Finset ΞΉ} {J : Set ΞΉ} (hu : Set.univ βŠ† ↑I βˆͺ J) : β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) ≀ ⨆ i ∈ I, range (stdBasis R Ο† i) := SetLike.le_def.2 (by intro b hb simp only [mem_iInf, mem_ker, proj_apply] at hb rw [← show (βˆ‘ i ∈ I, stdBasis R Ο† i (b i)) = b by ext i rw [Finset.sum_apply, ← stdBasis_same R Ο† i (b i)] refine Finset.sum_eq_single i (fun j _ ne => stdBasis_ne _ _ _ _ ne.symm _) ?_ intro hiI rw [stdBasis_same] exact hb _ ((hu trivial).resolve_left hiI)] exact sum_mem_biSup fun i _ => mem_range_self (stdBasis R Ο† i) (b i)) #align linear_map.infi_ker_proj_le_supr_range_std_basis LinearMap.iInf_ker_proj_le_iSup_range_stdBasis
Mathlib/LinearAlgebra/StdBasis.lean
123
129
theorem iSup_range_stdBasis_eq_iInf_ker_proj {I J : Set ΞΉ} (hd : Disjoint I J) (hu : Set.univ βŠ† I βˆͺ J) (hI : Set.Finite I) : ⨆ i ∈ I, range (stdBasis R Ο† i) = β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) := by
refine le_antisymm (iSup_range_stdBasis_le_iInf_ker_proj _ _ _ _ hd) ?_ have : Set.univ βŠ† ↑hI.toFinset βˆͺ J := by rwa [hI.coe_toFinset] refine le_trans (iInf_ker_proj_le_iSup_range_stdBasis R Ο† this) (iSup_mono fun i => ?_) rw [Set.Finite.mem_toFinset]
1,661
import Mathlib.Data.Matrix.Basis import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.Pi #align_import linear_algebra.std_basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" open Function Set Submodule namespace LinearMap variable (R : Type*) {ΞΉ : Type*} [Semiring R] (Ο† : ΞΉ β†’ Type*) [βˆ€ i, AddCommMonoid (Ο† i)] [βˆ€ i, Module R (Ο† i)] [DecidableEq ΞΉ] def stdBasis : βˆ€ i : ΞΉ, Ο† i β†’β‚—[R] βˆ€ i, Ο† i := single #align linear_map.std_basis LinearMap.stdBasis theorem stdBasis_apply (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b = update (0 : (a : ΞΉ) β†’ Ο† a) i b := rfl #align linear_map.std_basis_apply LinearMap.stdBasis_apply @[simp] theorem stdBasis_apply' (i i' : ΞΉ) : (stdBasis R (fun _x : ΞΉ => R) i) 1 i' = ite (i = i') 1 0 := by rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] congr 1; rw [eq_iff_iff, eq_comm] #align linear_map.std_basis_apply' LinearMap.stdBasis_apply' theorem coe_stdBasis (i : ΞΉ) : ⇑(stdBasis R Ο† i) = Pi.single i := rfl #align linear_map.coe_std_basis LinearMap.coe_stdBasis @[simp] theorem stdBasis_same (i : ΞΉ) (b : Ο† i) : stdBasis R Ο† i b i = b := Pi.single_eq_same i b #align linear_map.std_basis_same LinearMap.stdBasis_same theorem stdBasis_ne (i j : ΞΉ) (h : j β‰  i) (b : Ο† i) : stdBasis R Ο† i b j = 0 := Pi.single_eq_of_ne h b #align linear_map.std_basis_ne LinearMap.stdBasis_ne theorem stdBasis_eq_pi_diag (i : ΞΉ) : stdBasis R Ο† i = pi (diag i) := by ext x j -- Porting note: made types explicit convert (update_apply (R := R) (Ο† := Ο†) (ΞΉ := ΞΉ) 0 x i j _).symm rfl #align linear_map.std_basis_eq_pi_diag LinearMap.stdBasis_eq_pi_diag theorem ker_stdBasis (i : ΞΉ) : ker (stdBasis R Ο† i) = βŠ₯ := ker_eq_bot_of_injective <| Pi.single_injective _ _ #align linear_map.ker_std_basis LinearMap.ker_stdBasis theorem proj_comp_stdBasis (i j : ΞΉ) : (proj i).comp (stdBasis R Ο† j) = diag j i := by rw [stdBasis_eq_pi_diag, proj_pi] #align linear_map.proj_comp_std_basis LinearMap.proj_comp_stdBasis theorem proj_stdBasis_same (i : ΞΉ) : (proj i).comp (stdBasis R Ο† i) = id := LinearMap.ext <| stdBasis_same R Ο† i #align linear_map.proj_std_basis_same LinearMap.proj_stdBasis_same theorem proj_stdBasis_ne (i j : ΞΉ) (h : i β‰  j) : (proj i).comp (stdBasis R Ο† j) = 0 := LinearMap.ext <| stdBasis_ne R Ο† _ _ h #align linear_map.proj_std_basis_ne LinearMap.proj_stdBasis_ne theorem iSup_range_stdBasis_le_iInf_ker_proj (I J : Set ΞΉ) (h : Disjoint I J) : ⨆ i ∈ I, range (stdBasis R Ο† i) ≀ β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) := by refine iSup_le fun i => iSup_le fun hi => range_le_iff_comap.2 ?_ simp only [← ker_comp, eq_top_iff, SetLike.le_def, mem_ker, comap_iInf, mem_iInf] rintro b - j hj rw [proj_stdBasis_ne R Ο† j i, zero_apply] rintro rfl exact h.le_bot ⟨hi, hj⟩ #align linear_map.supr_range_std_basis_le_infi_ker_proj LinearMap.iSup_range_stdBasis_le_iInf_ker_proj theorem iInf_ker_proj_le_iSup_range_stdBasis {I : Finset ΞΉ} {J : Set ΞΉ} (hu : Set.univ βŠ† ↑I βˆͺ J) : β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) ≀ ⨆ i ∈ I, range (stdBasis R Ο† i) := SetLike.le_def.2 (by intro b hb simp only [mem_iInf, mem_ker, proj_apply] at hb rw [← show (βˆ‘ i ∈ I, stdBasis R Ο† i (b i)) = b by ext i rw [Finset.sum_apply, ← stdBasis_same R Ο† i (b i)] refine Finset.sum_eq_single i (fun j _ ne => stdBasis_ne _ _ _ _ ne.symm _) ?_ intro hiI rw [stdBasis_same] exact hb _ ((hu trivial).resolve_left hiI)] exact sum_mem_biSup fun i _ => mem_range_self (stdBasis R Ο† i) (b i)) #align linear_map.infi_ker_proj_le_supr_range_std_basis LinearMap.iInf_ker_proj_le_iSup_range_stdBasis theorem iSup_range_stdBasis_eq_iInf_ker_proj {I J : Set ΞΉ} (hd : Disjoint I J) (hu : Set.univ βŠ† I βˆͺ J) (hI : Set.Finite I) : ⨆ i ∈ I, range (stdBasis R Ο† i) = β¨… i ∈ J, ker (proj i : (βˆ€ i, Ο† i) β†’β‚—[R] Ο† i) := by refine le_antisymm (iSup_range_stdBasis_le_iInf_ker_proj _ _ _ _ hd) ?_ have : Set.univ βŠ† ↑hI.toFinset βˆͺ J := by rwa [hI.coe_toFinset] refine le_trans (iInf_ker_proj_le_iSup_range_stdBasis R Ο† this) (iSup_mono fun i => ?_) rw [Set.Finite.mem_toFinset] #align linear_map.supr_range_std_basis_eq_infi_ker_proj LinearMap.iSup_range_stdBasis_eq_iInf_ker_proj
Mathlib/LinearAlgebra/StdBasis.lean
132
137
theorem iSup_range_stdBasis [Finite ΞΉ] : ⨆ i, range (stdBasis R Ο† i) = ⊀ := by
cases nonempty_fintype ΞΉ convert top_unique (iInf_emptyset.ge.trans <| iInf_ker_proj_le_iSup_range_stdBasis R Ο† _) Β· rename_i i exact ((@iSup_pos _ _ _ fun _ => range <| stdBasis R Ο† i) <| Finset.mem_univ i).symm Β· rw [Finset.coe_univ, Set.union_empty]
1,661
import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Data.Finset.PiAntidiagonal import Mathlib.LinearAlgebra.StdBasis import Mathlib.Tactic.Linarith #align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60" noncomputable section open Finset (antidiagonal mem_antidiagonal) def MvPowerSeries (Οƒ : Type*) (R : Type*) := (Οƒ β†’β‚€ β„•) β†’ R #align mv_power_series MvPowerSeries namespace MvPowerSeries open Finsupp variable {Οƒ R : Type*} instance [Inhabited R] : Inhabited (MvPowerSeries Οƒ R) := ⟨fun _ => default⟩ instance [Zero R] : Zero (MvPowerSeries Οƒ R) := Pi.instZero instance [AddMonoid R] : AddMonoid (MvPowerSeries Οƒ R) := Pi.addMonoid instance [AddGroup R] : AddGroup (MvPowerSeries Οƒ R) := Pi.addGroup instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Οƒ R) := Pi.addCommMonoid instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Οƒ R) := Pi.addCommGroup instance [Nontrivial R] : Nontrivial (MvPowerSeries Οƒ R) := Function.nontrivial instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Οƒ A) := Pi.module _ _ _ instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S] [IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Οƒ A) := Pi.isScalarTower section Semiring variable (R) [Semiring R] def monomial (n : Οƒ β†’β‚€ β„•) : R β†’β‚—[R] MvPowerSeries Οƒ R := letI := Classical.decEq Οƒ LinearMap.stdBasis R (fun _ ↦ R) n #align mv_power_series.monomial MvPowerSeries.monomial def coeff (n : Οƒ β†’β‚€ β„•) : MvPowerSeries Οƒ R β†’β‚—[R] R := LinearMap.proj n #align mv_power_series.coeff MvPowerSeries.coeff variable {R} @[ext] theorem ext {Ο† ψ} (h : βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ) : Ο† = ψ := funext h #align mv_power_series.ext MvPowerSeries.ext theorem ext_iff {Ο† ψ : MvPowerSeries Οƒ R} : Ο† = ψ ↔ βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ := Function.funext_iff #align mv_power_series.ext_iff MvPowerSeries.ext_iff
Mathlib/RingTheory/MvPowerSeries/Basic.lean
127
131
theorem monomial_def [DecidableEq Οƒ] (n : Οƒ β†’β‚€ β„•) : (monomial R n) = LinearMap.stdBasis R (fun _ ↦ R) n := by
rw [monomial] -- unify the `Decidable` arguments convert rfl
1,662
import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Data.Finset.PiAntidiagonal import Mathlib.LinearAlgebra.StdBasis import Mathlib.Tactic.Linarith #align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60" noncomputable section open Finset (antidiagonal mem_antidiagonal) def MvPowerSeries (Οƒ : Type*) (R : Type*) := (Οƒ β†’β‚€ β„•) β†’ R #align mv_power_series MvPowerSeries namespace MvPowerSeries open Finsupp variable {Οƒ R : Type*} instance [Inhabited R] : Inhabited (MvPowerSeries Οƒ R) := ⟨fun _ => default⟩ instance [Zero R] : Zero (MvPowerSeries Οƒ R) := Pi.instZero instance [AddMonoid R] : AddMonoid (MvPowerSeries Οƒ R) := Pi.addMonoid instance [AddGroup R] : AddGroup (MvPowerSeries Οƒ R) := Pi.addGroup instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Οƒ R) := Pi.addCommMonoid instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Οƒ R) := Pi.addCommGroup instance [Nontrivial R] : Nontrivial (MvPowerSeries Οƒ R) := Function.nontrivial instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Οƒ A) := Pi.module _ _ _ instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S] [IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Οƒ A) := Pi.isScalarTower section Semiring variable (R) [Semiring R] def monomial (n : Οƒ β†’β‚€ β„•) : R β†’β‚—[R] MvPowerSeries Οƒ R := letI := Classical.decEq Οƒ LinearMap.stdBasis R (fun _ ↦ R) n #align mv_power_series.monomial MvPowerSeries.monomial def coeff (n : Οƒ β†’β‚€ β„•) : MvPowerSeries Οƒ R β†’β‚—[R] R := LinearMap.proj n #align mv_power_series.coeff MvPowerSeries.coeff variable {R} @[ext] theorem ext {Ο† ψ} (h : βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ) : Ο† = ψ := funext h #align mv_power_series.ext MvPowerSeries.ext theorem ext_iff {Ο† ψ : MvPowerSeries Οƒ R} : Ο† = ψ ↔ βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ := Function.funext_iff #align mv_power_series.ext_iff MvPowerSeries.ext_iff theorem monomial_def [DecidableEq Οƒ] (n : Οƒ β†’β‚€ β„•) : (monomial R n) = LinearMap.stdBasis R (fun _ ↦ R) n := by rw [monomial] -- unify the `Decidable` arguments convert rfl #align mv_power_series.monomial_def MvPowerSeries.monomial_def
Mathlib/RingTheory/MvPowerSeries/Basic.lean
134
140
theorem coeff_monomial [DecidableEq Οƒ] (m n : Οƒ β†’β‚€ β„•) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0 := by
-- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [coeff, monomial_def, LinearMap.proj_apply (i := m)] dsimp only -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
1,662
import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Data.Finset.PiAntidiagonal import Mathlib.LinearAlgebra.StdBasis import Mathlib.Tactic.Linarith #align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60" noncomputable section open Finset (antidiagonal mem_antidiagonal) def MvPowerSeries (Οƒ : Type*) (R : Type*) := (Οƒ β†’β‚€ β„•) β†’ R #align mv_power_series MvPowerSeries namespace MvPowerSeries open Finsupp variable {Οƒ R : Type*} instance [Inhabited R] : Inhabited (MvPowerSeries Οƒ R) := ⟨fun _ => default⟩ instance [Zero R] : Zero (MvPowerSeries Οƒ R) := Pi.instZero instance [AddMonoid R] : AddMonoid (MvPowerSeries Οƒ R) := Pi.addMonoid instance [AddGroup R] : AddGroup (MvPowerSeries Οƒ R) := Pi.addGroup instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Οƒ R) := Pi.addCommMonoid instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Οƒ R) := Pi.addCommGroup instance [Nontrivial R] : Nontrivial (MvPowerSeries Οƒ R) := Function.nontrivial instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Οƒ A) := Pi.module _ _ _ instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S] [IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Οƒ A) := Pi.isScalarTower section Semiring variable (R) [Semiring R] def monomial (n : Οƒ β†’β‚€ β„•) : R β†’β‚—[R] MvPowerSeries Οƒ R := letI := Classical.decEq Οƒ LinearMap.stdBasis R (fun _ ↦ R) n #align mv_power_series.monomial MvPowerSeries.monomial def coeff (n : Οƒ β†’β‚€ β„•) : MvPowerSeries Οƒ R β†’β‚—[R] R := LinearMap.proj n #align mv_power_series.coeff MvPowerSeries.coeff variable {R} @[ext] theorem ext {Ο† ψ} (h : βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ) : Ο† = ψ := funext h #align mv_power_series.ext MvPowerSeries.ext theorem ext_iff {Ο† ψ : MvPowerSeries Οƒ R} : Ο† = ψ ↔ βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ := Function.funext_iff #align mv_power_series.ext_iff MvPowerSeries.ext_iff theorem monomial_def [DecidableEq Οƒ] (n : Οƒ β†’β‚€ β„•) : (monomial R n) = LinearMap.stdBasis R (fun _ ↦ R) n := by rw [monomial] -- unify the `Decidable` arguments convert rfl #align mv_power_series.monomial_def MvPowerSeries.monomial_def theorem coeff_monomial [DecidableEq Οƒ] (m n : Οƒ β†’β‚€ β„•) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0 := by -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [coeff, monomial_def, LinearMap.proj_apply (i := m)] dsimp only -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] #align mv_power_series.coeff_monomial MvPowerSeries.coeff_monomial @[simp]
Mathlib/RingTheory/MvPowerSeries/Basic.lean
144
147
theorem coeff_monomial_same (n : Οƒ β†’β‚€ β„•) (a : R) : coeff R n (monomial R n a) = a := by
classical rw [monomial_def] exact LinearMap.stdBasis_same R (fun _ ↦ R) n a
1,662
import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Data.Finset.PiAntidiagonal import Mathlib.LinearAlgebra.StdBasis import Mathlib.Tactic.Linarith #align_import ring_theory.power_series.basic from "leanprover-community/mathlib"@"2d5739b61641ee4e7e53eca5688a08f66f2e6a60" noncomputable section open Finset (antidiagonal mem_antidiagonal) def MvPowerSeries (Οƒ : Type*) (R : Type*) := (Οƒ β†’β‚€ β„•) β†’ R #align mv_power_series MvPowerSeries namespace MvPowerSeries open Finsupp variable {Οƒ R : Type*} instance [Inhabited R] : Inhabited (MvPowerSeries Οƒ R) := ⟨fun _ => default⟩ instance [Zero R] : Zero (MvPowerSeries Οƒ R) := Pi.instZero instance [AddMonoid R] : AddMonoid (MvPowerSeries Οƒ R) := Pi.addMonoid instance [AddGroup R] : AddGroup (MvPowerSeries Οƒ R) := Pi.addGroup instance [AddCommMonoid R] : AddCommMonoid (MvPowerSeries Οƒ R) := Pi.addCommMonoid instance [AddCommGroup R] : AddCommGroup (MvPowerSeries Οƒ R) := Pi.addCommGroup instance [Nontrivial R] : Nontrivial (MvPowerSeries Οƒ R) := Function.nontrivial instance {A} [Semiring R] [AddCommMonoid A] [Module R A] : Module R (MvPowerSeries Οƒ A) := Pi.module _ _ _ instance {A S} [Semiring R] [Semiring S] [AddCommMonoid A] [Module R A] [Module S A] [SMul R S] [IsScalarTower R S A] : IsScalarTower R S (MvPowerSeries Οƒ A) := Pi.isScalarTower section Semiring variable (R) [Semiring R] def monomial (n : Οƒ β†’β‚€ β„•) : R β†’β‚—[R] MvPowerSeries Οƒ R := letI := Classical.decEq Οƒ LinearMap.stdBasis R (fun _ ↦ R) n #align mv_power_series.monomial MvPowerSeries.monomial def coeff (n : Οƒ β†’β‚€ β„•) : MvPowerSeries Οƒ R β†’β‚—[R] R := LinearMap.proj n #align mv_power_series.coeff MvPowerSeries.coeff variable {R} @[ext] theorem ext {Ο† ψ} (h : βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ) : Ο† = ψ := funext h #align mv_power_series.ext MvPowerSeries.ext theorem ext_iff {Ο† ψ : MvPowerSeries Οƒ R} : Ο† = ψ ↔ βˆ€ n : Οƒ β†’β‚€ β„•, coeff R n Ο† = coeff R n ψ := Function.funext_iff #align mv_power_series.ext_iff MvPowerSeries.ext_iff theorem monomial_def [DecidableEq Οƒ] (n : Οƒ β†’β‚€ β„•) : (monomial R n) = LinearMap.stdBasis R (fun _ ↦ R) n := by rw [monomial] -- unify the `Decidable` arguments convert rfl #align mv_power_series.monomial_def MvPowerSeries.monomial_def theorem coeff_monomial [DecidableEq Οƒ] (m n : Οƒ β†’β‚€ β„•) (a : R) : coeff R m (monomial R n a) = if m = n then a else 0 := by -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [coeff, monomial_def, LinearMap.proj_apply (i := m)] dsimp only -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply] #align mv_power_series.coeff_monomial MvPowerSeries.coeff_monomial @[simp] theorem coeff_monomial_same (n : Οƒ β†’β‚€ β„•) (a : R) : coeff R n (monomial R n a) = a := by classical rw [monomial_def] exact LinearMap.stdBasis_same R (fun _ ↦ R) n a #align mv_power_series.coeff_monomial_same MvPowerSeries.coeff_monomial_same
Mathlib/RingTheory/MvPowerSeries/Basic.lean
150
153
theorem coeff_monomial_ne {m n : Οƒ β†’β‚€ β„•} (h : m β‰  n) (a : R) : coeff R m (monomial R n a) = 0 := by
classical rw [monomial_def] exact LinearMap.stdBasis_ne R (fun _ ↦ R) _ _ h a
1,662
import Mathlib.RingTheory.MvPowerSeries.Basic import Mathlib.Data.Finsupp.Interval noncomputable section open Finset (antidiagonal mem_antidiagonal) namespace MvPowerSeries open Finsupp variable {Οƒ R : Type*} section Trunc variable [CommSemiring R] (n : Οƒ β†’β‚€ β„•) def truncFun (Ο† : MvPowerSeries Οƒ R) : MvPolynomial Οƒ R := βˆ‘ m ∈ Finset.Iio n, MvPolynomial.monomial m (coeff R m Ο†) #align mv_power_series.trunc_fun MvPowerSeries.truncFun
Mathlib/RingTheory/MvPowerSeries/Trunc.lean
43
46
theorem coeff_truncFun (m : Οƒ β†’β‚€ β„•) (Ο† : MvPowerSeries Οƒ R) : (truncFun n Ο†).coeff m = if m < n then coeff R m Ο† else 0 := by
classical simp [truncFun, MvPolynomial.coeff_sum]
1,663
import Mathlib.RingTheory.MvPowerSeries.Basic import Mathlib.Data.Finsupp.Interval noncomputable section open Finset (antidiagonal mem_antidiagonal) namespace MvPowerSeries open Finsupp variable {Οƒ R : Type*} section Trunc variable [CommSemiring R] (n : Οƒ β†’β‚€ β„•) def truncFun (Ο† : MvPowerSeries Οƒ R) : MvPolynomial Οƒ R := βˆ‘ m ∈ Finset.Iio n, MvPolynomial.monomial m (coeff R m Ο†) #align mv_power_series.trunc_fun MvPowerSeries.truncFun theorem coeff_truncFun (m : Οƒ β†’β‚€ β„•) (Ο† : MvPowerSeries Οƒ R) : (truncFun n Ο†).coeff m = if m < n then coeff R m Ο† else 0 := by classical simp [truncFun, MvPolynomial.coeff_sum] #align mv_power_series.coeff_trunc_fun MvPowerSeries.coeff_truncFun variable (R) def trunc : MvPowerSeries Οƒ R β†’+ MvPolynomial Οƒ R where toFun := truncFun n map_zero' := by classical ext simp [coeff_truncFun] map_add' := by classical intros x y ext m simp only [coeff_truncFun, MvPolynomial.coeff_add] split_ifs Β· rw [map_add] Β· rw [zero_add] #align mv_power_series.trunc MvPowerSeries.trunc variable {R}
Mathlib/RingTheory/MvPowerSeries/Trunc.lean
71
73
theorem coeff_trunc (m : Οƒ β†’β‚€ β„•) (Ο† : MvPowerSeries Οƒ R) : (trunc R n Ο†).coeff m = if m < n then coeff R m Ο† else 0 := by
classical simp [trunc, coeff_truncFun]
1,663
import Mathlib.LinearAlgebra.DFinsupp import Mathlib.LinearAlgebra.StdBasis #align_import linear_algebra.finsupp_vector_space from "leanprover-community/mathlib"@"59628387770d82eb6f6dd7b7107308aa2509ec95" noncomputable section open Set LinearMap Submodule open scoped Cardinal universe u v w namespace Finsupp section Ring variable {R : Type*} {M : Type*} {ΞΉ : Type*} variable [Ring R] [AddCommGroup M] [Module R M]
Mathlib/LinearAlgebra/FinsuppVectorSpace.lean
34
51
theorem linearIndependent_single {Ο† : ΞΉ β†’ Type*} {f : βˆ€ ΞΉ, Ο† ΞΉ β†’ M} (hf : βˆ€ i, LinearIndependent R (f i)) : LinearIndependent R fun ix : Ξ£i, Ο† i => single ix.1 (f ix.1 ix.2) := by
apply @linearIndependent_iUnion_finite R _ _ _ _ ΞΉ Ο† fun i x => single i (f i x) Β· intro i have h_disjoint : Disjoint (span R (range (f i))) (ker (lsingle i)) := by rw [ker_lsingle] exact disjoint_bot_right apply (hf i).map h_disjoint Β· intro i t _ hit refine (disjoint_lsingle_lsingle {i} t (disjoint_singleton_left.2 hit)).mono ?_ ?_ Β· rw [span_le] simp only [iSup_singleton] rw [range_coe] apply range_comp_subset_range _ (lsingle i) Β· refine iSupβ‚‚_mono fun i hi => ?_ rw [span_le, range_coe] apply range_comp_subset_range _ (lsingle i)
1,664
import Mathlib.LinearAlgebra.DFinsupp import Mathlib.LinearAlgebra.StdBasis #align_import linear_algebra.finsupp_vector_space from "leanprover-community/mathlib"@"59628387770d82eb6f6dd7b7107308aa2509ec95" noncomputable section open Set LinearMap Submodule open scoped Cardinal universe u v w namespace Finsupp namespace Basis variable {R M n : Type*} variable [DecidableEq n] variable [Semiring R] [AddCommMonoid M] [Module R M]
Mathlib/LinearAlgebra/FinsuppVectorSpace.lean
161
164
theorem _root_.Finset.sum_single_ite [Fintype n] (a : R) (i : n) : (βˆ‘ x : n, Finsupp.single x (if i = x then a else 0)) = Finsupp.single i a := by
simp only [apply_ite (Finsupp.single _), Finsupp.single_zero, Finset.sum_ite_eq, if_pos (Finset.mem_univ _)]
1,664
import Mathlib.LinearAlgebra.DFinsupp import Mathlib.LinearAlgebra.StdBasis #align_import linear_algebra.finsupp_vector_space from "leanprover-community/mathlib"@"59628387770d82eb6f6dd7b7107308aa2509ec95" noncomputable section open Set LinearMap Submodule open scoped Cardinal universe u v w namespace Finsupp namespace Basis variable {R M n : Type*} variable [DecidableEq n] variable [Semiring R] [AddCommMonoid M] [Module R M] theorem _root_.Finset.sum_single_ite [Fintype n] (a : R) (i : n) : (βˆ‘ x : n, Finsupp.single x (if i = x then a else 0)) = Finsupp.single i a := by simp only [apply_ite (Finsupp.single _), Finsupp.single_zero, Finset.sum_ite_eq, if_pos (Finset.mem_univ _)] #align finset.sum_single_ite Finset.sum_single_ite
Mathlib/LinearAlgebra/FinsuppVectorSpace.lean
167
170
theorem equivFun_symm_stdBasis [Finite n] (b : Basis n R M) (i : n) : b.equivFun.symm (LinearMap.stdBasis R (fun _ => R) i 1) = b i := by
cases nonempty_fintype n simp
1,664
import Mathlib.Algebra.Category.ModuleCat.EpiMono import Mathlib.Algebra.Module.Projective import Mathlib.CategoryTheory.Preadditive.Projective import Mathlib.LinearAlgebra.FinsuppVectorSpace import Mathlib.Data.Finsupp.Basic #align_import algebra.category.Module.projective from "leanprover-community/mathlib"@"201a3f4a0e59b5f836fe8a6c1a462ee674327211" universe v u u' open CategoryTheory open CategoryTheory.Limits open LinearMap open ModuleCat open scoped Module
Mathlib/Algebra/Category/ModuleCat/Projective.lean
31
41
theorem IsProjective.iff_projective {R : Type u} [Ring R] {P : Type max u v} [AddCommGroup P] [Module R P] : Module.Projective R P ↔ Projective (ModuleCat.of R P) := by
refine ⟨fun h => ?_, fun h => ?_⟩ Β· letI : Module.Projective R (ModuleCat.of R P) := h exact ⟨fun E X epi => Module.projective_lifting_property _ _ ((ModuleCat.epi_iff_surjective _).mp epi)⟩ Β· refine Module.Projective.of_lifting_property.{u,v} ?_ intro E X mE mX sE sX f g s haveI : Epi (β†Ÿf) := (ModuleCat.epi_iff_surjective (β†Ÿf)).mpr s letI : Projective (ModuleCat.of R P) := h exact ⟨Projective.factorThru (β†Ÿg) (β†Ÿf), Projective.factorThru_comp (β†Ÿg) (β†Ÿf)⟩
1,665
import Mathlib.Algebra.Category.ModuleCat.Projective import Mathlib.AlgebraicTopology.ExtraDegeneracy import Mathlib.CategoryTheory.Abelian.Ext import Mathlib.RepresentationTheory.Rep #align_import representation_theory.group_cohomology.resolution from "leanprover-community/mathlib"@"cec81510e48e579bde6acd8568c06a87af045b63" noncomputable section universe u v w variable {k G : Type u} [CommRing k] {n : β„•} open CategoryTheory local notation "Gⁿ" => Fin n β†’ G set_option quotPrecheck false local notation "Gⁿ⁺¹" => Fin (n + 1) β†’ G namespace groupCohomology.resolution open Finsupp hiding lift open MonoidalCategory open Fin (partialProd) section Basis variable (k G n) [Group G] section Action open Action def actionDiagonalSucc (G : Type u) [Group G] : βˆ€ n : β„•, diagonal G (n + 1) β‰… leftRegular G βŠ— Action.mk (Fin n β†’ G) 1 | 0 => diagonalOneIsoLeftRegular G β‰ͺ≫ (ρ_ _).symm β‰ͺ≫ tensorIso (Iso.refl _) (tensorUnitIso (Equiv.equivOfUnique PUnit _).toIso) | n + 1 => diagonalSucc _ _ β‰ͺ≫ tensorIso (Iso.refl _) (actionDiagonalSucc G n) β‰ͺ≫ leftRegularTensorIso _ _ β‰ͺ≫ tensorIso (Iso.refl _) (mkIso (Equiv.piFinSuccAbove (fun _ => G) 0).symm.toIso fun _ => rfl) set_option linter.uppercaseLean3 false in #align group_cohomology.resolution.Action_diagonal_succ groupCohomology.resolution.actionDiagonalSucc
Mathlib/RepresentationTheory/GroupCohomology/Resolution.lean
108
124
theorem actionDiagonalSucc_hom_apply {G : Type u} [Group G] {n : β„•} (f : Fin (n + 1) β†’ G) : (actionDiagonalSucc G n).hom.hom f = (f 0, fun i => (f (Fin.castSucc i))⁻¹ * f i.succ) := by
induction' n with n hn Β· exact Prod.ext rfl (funext fun x => Fin.elim0 x) Β· refine Prod.ext rfl (funext fun x => ?_) /- Porting note (#11039): broken proof was Β· dsimp only [actionDiagonalSucc] simp only [Iso.trans_hom, comp_hom, types_comp_apply, diagonalSucc_hom_hom, leftRegularTensorIso_hom_hom, tensorIso_hom, mkIso_hom_hom, Equiv.toIso_hom, Action.tensorHom, Equiv.piFinSuccAbove_symm_apply, tensor_apply, types_id_apply, tensor_rho, MonoidHom.one_apply, End.one_def, hn fun j : Fin (n + 1) => f j.succ, Fin.insertNth_zero'] refine' Fin.cases (Fin.cons_zero _ _) (fun i => _) x Β· simp only [Fin.cons_succ, mul_left_inj, inv_inj, Fin.castSucc_fin_succ] -/ dsimp [actionDiagonalSucc] erw [hn (fun (j : Fin (n + 1)) => f j.succ)] exact Fin.cases rfl (fun i => rfl) x
1,666
import Mathlib.Algebra.Category.ModuleCat.Projective import Mathlib.AlgebraicTopology.ExtraDegeneracy import Mathlib.CategoryTheory.Abelian.Ext import Mathlib.RepresentationTheory.Rep #align_import representation_theory.group_cohomology.resolution from "leanprover-community/mathlib"@"cec81510e48e579bde6acd8568c06a87af045b63" noncomputable section universe u v w variable {k G : Type u} [CommRing k] {n : β„•} open CategoryTheory local notation "Gⁿ" => Fin n β†’ G set_option quotPrecheck false local notation "Gⁿ⁺¹" => Fin (n + 1) β†’ G namespace groupCohomology.resolution open Finsupp hiding lift open MonoidalCategory open Fin (partialProd) section Basis variable (k G n) [Group G] section Action open Action def actionDiagonalSucc (G : Type u) [Group G] : βˆ€ n : β„•, diagonal G (n + 1) β‰… leftRegular G βŠ— Action.mk (Fin n β†’ G) 1 | 0 => diagonalOneIsoLeftRegular G β‰ͺ≫ (ρ_ _).symm β‰ͺ≫ tensorIso (Iso.refl _) (tensorUnitIso (Equiv.equivOfUnique PUnit _).toIso) | n + 1 => diagonalSucc _ _ β‰ͺ≫ tensorIso (Iso.refl _) (actionDiagonalSucc G n) β‰ͺ≫ leftRegularTensorIso _ _ β‰ͺ≫ tensorIso (Iso.refl _) (mkIso (Equiv.piFinSuccAbove (fun _ => G) 0).symm.toIso fun _ => rfl) set_option linter.uppercaseLean3 false in #align group_cohomology.resolution.Action_diagonal_succ groupCohomology.resolution.actionDiagonalSucc theorem actionDiagonalSucc_hom_apply {G : Type u} [Group G] {n : β„•} (f : Fin (n + 1) β†’ G) : (actionDiagonalSucc G n).hom.hom f = (f 0, fun i => (f (Fin.castSucc i))⁻¹ * f i.succ) := by induction' n with n hn Β· exact Prod.ext rfl (funext fun x => Fin.elim0 x) Β· refine Prod.ext rfl (funext fun x => ?_) dsimp [actionDiagonalSucc] erw [hn (fun (j : Fin (n + 1)) => f j.succ)] exact Fin.cases rfl (fun i => rfl) x set_option linter.uppercaseLean3 false in #align group_cohomology.resolution.Action_diagonal_succ_hom_apply groupCohomology.resolution.actionDiagonalSucc_hom_apply
Mathlib/RepresentationTheory/GroupCohomology/Resolution.lean
128
153
theorem actionDiagonalSucc_inv_apply {G : Type u} [Group G] {n : β„•} (g : G) (f : Fin n β†’ G) : (actionDiagonalSucc G n).inv.hom (g, f) = (g β€’ Fin.partialProd f : Fin (n + 1) β†’ G) := by
revert g induction' n with n hn Β· intro g funext (x : Fin 1) simp only [Subsingleton.elim x 0, Pi.smul_apply, Fin.partialProd_zero, smul_eq_mul, mul_one] rfl Β· intro g /- Porting note (#11039): broken proof was ext dsimp only [actionDiagonalSucc] simp only [Iso.trans_inv, comp_hom, hn, diagonalSucc_inv_hom, types_comp_apply, tensorIso_inv, Iso.refl_inv, Action.tensorHom, id_hom, tensor_apply, types_id_apply, leftRegularTensorIso_inv_hom, tensor_rho, leftRegular_ρ_apply, Pi.smul_apply, smul_eq_mul] refine' Fin.cases _ _ x Β· simp only [Fin.cons_zero, Fin.partialProd_zero, mul_one] Β· intro i simpa only [Fin.cons_succ, Pi.smul_apply, smul_eq_mul, Fin.partialProd_succ', mul_assoc] -/ funext x dsimp [actionDiagonalSucc] erw [hn, Equiv.piFinSuccAbove_symm_apply] refine Fin.cases ?_ (fun i => ?_) x Β· simp only [Fin.insertNth_zero, Fin.cons_zero, Fin.partialProd_zero, mul_one] Β· simp only [Fin.cons_succ, Pi.smul_apply, smul_eq_mul, Fin.partialProd_succ', ← mul_assoc] rfl
1,666
import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.FinsuppVectorSpace #align_import linear_algebra.tensor_product_basis from "leanprover-community/mathlib"@"f784cc6142443d9ee623a20788c282112c322081" noncomputable section open Set LinearMap Submodule section CommSemiring variable {R : Type*} {S : Type*} {M : Type*} {N : Type*} {ΞΉ : Type*} {ΞΊ : Type*} [CommSemiring R] [Semiring S] [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] [AddCommMonoid N] [Module R N] def Basis.tensorProduct (b : Basis ΞΉ S M) (c : Basis ΞΊ R N) : Basis (ΞΉ Γ— ΞΊ) S (TensorProduct R M N) := Finsupp.basisSingleOne.map ((TensorProduct.AlgebraTensorModule.congr b.repr c.repr).trans <| (finsuppTensorFinsupp R S _ _ _ _).trans <| Finsupp.lcongr (Equiv.refl _) (TensorProduct.AlgebraTensorModule.rid R S S)).symm #align basis.tensor_product Basis.tensorProduct @[simp]
Mathlib/LinearAlgebra/TensorProduct/Basis.lean
39
41
theorem Basis.tensorProduct_apply (b : Basis ΞΉ R M) (c : Basis ΞΊ R N) (i : ΞΉ) (j : ΞΊ) : Basis.tensorProduct b c (i, j) = b i βŠ—β‚œ c j := by
simp [Basis.tensorProduct]
1,667
import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.FinsuppVectorSpace #align_import linear_algebra.tensor_product_basis from "leanprover-community/mathlib"@"f784cc6142443d9ee623a20788c282112c322081" noncomputable section open Set LinearMap Submodule section CommSemiring variable {R : Type*} {S : Type*} {M : Type*} {N : Type*} {ΞΉ : Type*} {ΞΊ : Type*} [CommSemiring R] [Semiring S] [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] [AddCommMonoid N] [Module R N] def Basis.tensorProduct (b : Basis ΞΉ S M) (c : Basis ΞΊ R N) : Basis (ΞΉ Γ— ΞΊ) S (TensorProduct R M N) := Finsupp.basisSingleOne.map ((TensorProduct.AlgebraTensorModule.congr b.repr c.repr).trans <| (finsuppTensorFinsupp R S _ _ _ _).trans <| Finsupp.lcongr (Equiv.refl _) (TensorProduct.AlgebraTensorModule.rid R S S)).symm #align basis.tensor_product Basis.tensorProduct @[simp] theorem Basis.tensorProduct_apply (b : Basis ΞΉ R M) (c : Basis ΞΊ R N) (i : ΞΉ) (j : ΞΊ) : Basis.tensorProduct b c (i, j) = b i βŠ—β‚œ c j := by simp [Basis.tensorProduct] #align basis.tensor_product_apply Basis.tensorProduct_apply
Mathlib/LinearAlgebra/TensorProduct/Basis.lean
44
46
theorem Basis.tensorProduct_apply' (b : Basis ΞΉ R M) (c : Basis ΞΊ R N) (i : ΞΉ Γ— ΞΊ) : Basis.tensorProduct b c i = b i.1 βŠ—β‚œ c i.2 := by
simp [Basis.tensorProduct]
1,667