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.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set open Pointwise Topology variable {𝕜 E : Type*} variable [NormedField 𝕜] section SeminormedAddCommGroup variable [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp [← div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smul₀] #align smul_ball smul_ball theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖ := by rw [_root_.smul_ball hc, smul_zero, mul_one] #align smul_unit_ball smul_unitBall
Mathlib/Analysis/NormedSpace/Pointwise.lean
95
101
theorem smul_sphere' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • sphere x r = sphere (c • x) (‖c‖ * r) := by
ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne', mul_comm r]
292
import Mathlib.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set open Pointwise Topology variable {𝕜 E : Type*} variable [NormedField 𝕜] section SeminormedAddCommGroup variable [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp [← div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smul₀] #align smul_ball smul_ball theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖ := by rw [_root_.smul_ball hc, smul_zero, mul_one] #align smul_unit_ball smul_unitBall theorem smul_sphere' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • sphere x r = sphere (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne', mul_comm r] #align smul_sphere' smul_sphere'
Mathlib/Analysis/NormedSpace/Pointwise.lean
104
106
theorem smul_closedBall' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • closedBall x r = closedBall (c • x) (‖c‖ * r) := by
simp only [← ball_union_sphere, Set.smul_set_union, _root_.smul_ball hc, smul_sphere' hc]
292
import Mathlib.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set open Pointwise Topology variable {𝕜 E : Type*} variable [NormedField 𝕜] section SeminormedAddCommGroup variable [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp [← div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smul₀] #align smul_ball smul_ball theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖ := by rw [_root_.smul_ball hc, smul_zero, mul_one] #align smul_unit_ball smul_unitBall theorem smul_sphere' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • sphere x r = sphere (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne', mul_comm r] #align smul_sphere' smul_sphere' theorem smul_closedBall' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • closedBall x r = closedBall (c • x) (‖c‖ * r) := by simp only [← ball_union_sphere, Set.smul_set_union, _root_.smul_ball hc, smul_sphere' hc] #align smul_closed_ball' smul_closedBall'
Mathlib/Analysis/NormedSpace/Pointwise.lean
109
115
theorem set_smul_sphere_zero {s : Set 𝕜} (hs : 0 ∉ s) (r : ℝ) : s • sphere (0 : E) r = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := calc s • sphere (0 : E) r = ⋃ c ∈ s, c • sphere (0 : E) r := iUnion_smul_left_image.symm _ = ⋃ c ∈ s, sphere (0 : E) (‖c‖ * r) := iUnion₂_congr fun c hc ↦ by rw [smul_sphere' (ne_of_mem_of_not_mem hc hs), smul_zero] _ = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := by
ext; simp [eq_comm]
292
import Mathlib.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set open Pointwise Topology variable {𝕜 E : Type*} variable [NormedField 𝕜] section SeminormedAddCommGroup variable [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp [← div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smul₀] #align smul_ball smul_ball theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖ := by rw [_root_.smul_ball hc, smul_zero, mul_one] #align smul_unit_ball smul_unitBall theorem smul_sphere' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • sphere x r = sphere (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne', mul_comm r] #align smul_sphere' smul_sphere' theorem smul_closedBall' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • closedBall x r = closedBall (c • x) (‖c‖ * r) := by simp only [← ball_union_sphere, Set.smul_set_union, _root_.smul_ball hc, smul_sphere' hc] #align smul_closed_ball' smul_closedBall' theorem set_smul_sphere_zero {s : Set 𝕜} (hs : 0 ∉ s) (r : ℝ) : s • sphere (0 : E) r = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := calc s • sphere (0 : E) r = ⋃ c ∈ s, c • sphere (0 : E) r := iUnion_smul_left_image.symm _ = ⋃ c ∈ s, sphere (0 : E) (‖c‖ * r) := iUnion₂_congr fun c hc ↦ by rw [smul_sphere' (ne_of_mem_of_not_mem hc hs), smul_zero] _ = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := by ext; simp [eq_comm] theorem Bornology.IsBounded.smul₀ {s : Set E} (hs : IsBounded s) (c : 𝕜) : IsBounded (c • s) := (lipschitzWith_smul c).isBounded_image hs #align metric.bounded.smul Bornology.IsBounded.smul₀
Mathlib/Analysis/NormedSpace/Pointwise.lean
125
143
theorem eventually_singleton_add_smul_subset {x : E} {s : Set E} (hs : Bornology.IsBounded s) {u : Set E} (hu : u ∈ 𝓝 x) : ∀ᶠ r in 𝓝 (0 : 𝕜), {x} + r • s ⊆ u := by
obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ closedBall x ε ⊆ u := nhds_basis_closedBall.mem_iff.1 hu obtain ⟨R, Rpos, hR⟩ : ∃ R : ℝ, 0 < R ∧ s ⊆ closedBall 0 R := hs.subset_closedBall_lt 0 0 have : Metric.closedBall (0 : 𝕜) (ε / R) ∈ 𝓝 (0 : 𝕜) := closedBall_mem_nhds _ (div_pos εpos Rpos) filter_upwards [this] with r hr simp only [image_add_left, singleton_add] intro y hy obtain ⟨z, zs, hz⟩ : ∃ z : E, z ∈ s ∧ r • z = -x + y := by simpa [mem_smul_set] using hy have I : ‖r • z‖ ≤ ε := calc ‖r • z‖ = ‖r‖ * ‖z‖ := norm_smul _ _ _ ≤ ε / R * R := (mul_le_mul (mem_closedBall_zero_iff.1 hr) (mem_closedBall_zero_iff.1 (hR zs)) (norm_nonneg _) (div_pos εpos Rpos).le) _ = ε := by field_simp have : y = x + r • z := by simp only [hz, add_neg_cancel_left] apply hε simpa only [this, dist_eq_norm, add_sub_cancel_left, mem_closedBall] using I
292
import Mathlib.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set open Pointwise Topology variable {𝕜 E : Type*} variable [NormedField 𝕜] section SeminormedAddCommGroup variable [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp [← div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smul₀] #align smul_ball smul_ball theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖ := by rw [_root_.smul_ball hc, smul_zero, mul_one] #align smul_unit_ball smul_unitBall theorem smul_sphere' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • sphere x r = sphere (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne', mul_comm r] #align smul_sphere' smul_sphere' theorem smul_closedBall' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • closedBall x r = closedBall (c • x) (‖c‖ * r) := by simp only [← ball_union_sphere, Set.smul_set_union, _root_.smul_ball hc, smul_sphere' hc] #align smul_closed_ball' smul_closedBall' theorem set_smul_sphere_zero {s : Set 𝕜} (hs : 0 ∉ s) (r : ℝ) : s • sphere (0 : E) r = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := calc s • sphere (0 : E) r = ⋃ c ∈ s, c • sphere (0 : E) r := iUnion_smul_left_image.symm _ = ⋃ c ∈ s, sphere (0 : E) (‖c‖ * r) := iUnion₂_congr fun c hc ↦ by rw [smul_sphere' (ne_of_mem_of_not_mem hc hs), smul_zero] _ = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := by ext; simp [eq_comm] theorem Bornology.IsBounded.smul₀ {s : Set E} (hs : IsBounded s) (c : 𝕜) : IsBounded (c • s) := (lipschitzWith_smul c).isBounded_image hs #align metric.bounded.smul Bornology.IsBounded.smul₀ theorem eventually_singleton_add_smul_subset {x : E} {s : Set E} (hs : Bornology.IsBounded s) {u : Set E} (hu : u ∈ 𝓝 x) : ∀ᶠ r in 𝓝 (0 : 𝕜), {x} + r • s ⊆ u := by obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ closedBall x ε ⊆ u := nhds_basis_closedBall.mem_iff.1 hu obtain ⟨R, Rpos, hR⟩ : ∃ R : ℝ, 0 < R ∧ s ⊆ closedBall 0 R := hs.subset_closedBall_lt 0 0 have : Metric.closedBall (0 : 𝕜) (ε / R) ∈ 𝓝 (0 : 𝕜) := closedBall_mem_nhds _ (div_pos εpos Rpos) filter_upwards [this] with r hr simp only [image_add_left, singleton_add] intro y hy obtain ⟨z, zs, hz⟩ : ∃ z : E, z ∈ s ∧ r • z = -x + y := by simpa [mem_smul_set] using hy have I : ‖r • z‖ ≤ ε := calc ‖r • z‖ = ‖r‖ * ‖z‖ := norm_smul _ _ _ ≤ ε / R * R := (mul_le_mul (mem_closedBall_zero_iff.1 hr) (mem_closedBall_zero_iff.1 (hR zs)) (norm_nonneg _) (div_pos εpos Rpos).le) _ = ε := by field_simp have : y = x + r • z := by simp only [hz, add_neg_cancel_left] apply hε simpa only [this, dist_eq_norm, add_sub_cancel_left, mem_closedBall] using I #align eventually_singleton_add_smul_subset eventually_singleton_add_smul_subset variable [NormedSpace ℝ E] {x y z : E} {δ ε : ℝ}
Mathlib/Analysis/NormedSpace/Pointwise.lean
150
151
theorem smul_unitBall_of_pos {r : ℝ} (hr : 0 < r) : r • ball (0 : E) 1 = ball (0 : E) r := by
rw [smul_unitBall hr.ne', Real.norm_of_nonneg hr.le]
292
import Mathlib.Analysis.Normed.Group.Pointwise import Mathlib.Analysis.NormedSpace.Real #align_import analysis.normed_space.pointwise from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set open Pointwise Topology variable {𝕜 E : Type*} variable [NormedField 𝕜] section SeminormedAddCommGroup variable [SeminormedAddCommGroup E] [NormedSpace 𝕜 E] theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp [← div_eq_inv_mul, div_lt_iff (norm_pos_iff.2 hc), mul_comm _ r, dist_smul₀] #align smul_ball smul_ball theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖ := by rw [_root_.smul_ball hc, smul_zero, mul_one] #align smul_unit_ball smul_unitBall theorem smul_sphere' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • sphere x r = sphere (c • x) (‖c‖ * r) := by ext y rw [mem_smul_set_iff_inv_smul_mem₀ hc] conv_lhs => rw [← inv_smul_smul₀ hc x] simp only [mem_sphere, dist_smul₀, norm_inv, ← div_eq_inv_mul, div_eq_iff (norm_pos_iff.2 hc).ne', mul_comm r] #align smul_sphere' smul_sphere' theorem smul_closedBall' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • closedBall x r = closedBall (c • x) (‖c‖ * r) := by simp only [← ball_union_sphere, Set.smul_set_union, _root_.smul_ball hc, smul_sphere' hc] #align smul_closed_ball' smul_closedBall' theorem set_smul_sphere_zero {s : Set 𝕜} (hs : 0 ∉ s) (r : ℝ) : s • sphere (0 : E) r = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := calc s • sphere (0 : E) r = ⋃ c ∈ s, c • sphere (0 : E) r := iUnion_smul_left_image.symm _ = ⋃ c ∈ s, sphere (0 : E) (‖c‖ * r) := iUnion₂_congr fun c hc ↦ by rw [smul_sphere' (ne_of_mem_of_not_mem hc hs), smul_zero] _ = (‖·‖) ⁻¹' ((‖·‖ * r) '' s) := by ext; simp [eq_comm] theorem Bornology.IsBounded.smul₀ {s : Set E} (hs : IsBounded s) (c : 𝕜) : IsBounded (c • s) := (lipschitzWith_smul c).isBounded_image hs #align metric.bounded.smul Bornology.IsBounded.smul₀ theorem eventually_singleton_add_smul_subset {x : E} {s : Set E} (hs : Bornology.IsBounded s) {u : Set E} (hu : u ∈ 𝓝 x) : ∀ᶠ r in 𝓝 (0 : 𝕜), {x} + r • s ⊆ u := by obtain ⟨ε, εpos, hε⟩ : ∃ ε : ℝ, 0 < ε ∧ closedBall x ε ⊆ u := nhds_basis_closedBall.mem_iff.1 hu obtain ⟨R, Rpos, hR⟩ : ∃ R : ℝ, 0 < R ∧ s ⊆ closedBall 0 R := hs.subset_closedBall_lt 0 0 have : Metric.closedBall (0 : 𝕜) (ε / R) ∈ 𝓝 (0 : 𝕜) := closedBall_mem_nhds _ (div_pos εpos Rpos) filter_upwards [this] with r hr simp only [image_add_left, singleton_add] intro y hy obtain ⟨z, zs, hz⟩ : ∃ z : E, z ∈ s ∧ r • z = -x + y := by simpa [mem_smul_set] using hy have I : ‖r • z‖ ≤ ε := calc ‖r • z‖ = ‖r‖ * ‖z‖ := norm_smul _ _ _ ≤ ε / R * R := (mul_le_mul (mem_closedBall_zero_iff.1 hr) (mem_closedBall_zero_iff.1 (hR zs)) (norm_nonneg _) (div_pos εpos Rpos).le) _ = ε := by field_simp have : y = x + r • z := by simp only [hz, add_neg_cancel_left] apply hε simpa only [this, dist_eq_norm, add_sub_cancel_left, mem_closedBall] using I #align eventually_singleton_add_smul_subset eventually_singleton_add_smul_subset variable [NormedSpace ℝ E] {x y z : E} {δ ε : ℝ} theorem smul_unitBall_of_pos {r : ℝ} (hr : 0 < r) : r • ball (0 : E) 1 = ball (0 : E) r := by rw [smul_unitBall hr.ne', Real.norm_of_nonneg hr.le] #align smul_unit_ball_of_pos smul_unitBall_of_pos lemma Ioo_smul_sphere_zero {a b r : ℝ} (ha : 0 ≤ a) (hr : 0 < r) : Ioo a b • sphere (0 : E) r = ball 0 (b * r) \ closedBall 0 (a * r) := by have : EqOn (‖·‖) id (Ioo a b) := fun x hx ↦ abs_of_pos (ha.trans_lt hx.1) rw [set_smul_sphere_zero (by simp [ha.not_lt]), ← image_image (· * r), this.image_eq, image_id, image_mul_right_Ioo _ _ hr] ext x; simp [and_comm] -- This is also true for `ℚ`-normed spaces
Mathlib/Analysis/NormedSpace/Pointwise.lean
162
167
theorem exists_dist_eq (x z : E) {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) : ∃ y, dist x y = b * dist x z ∧ dist y z = a * dist x z := by
use a • x + b • z nth_rw 1 [← one_smul ℝ x] nth_rw 4 [← one_smul ℝ z] simp [dist_eq_norm, ← hab, add_smul, ← smul_sub, norm_smul_of_nonneg, ha, hb]
292
import Mathlib.CategoryTheory.EpiMono import Mathlib.CategoryTheory.Limits.HasLimits #align_import category_theory.limits.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba" section open CategoryTheory Opposite namespace CategoryTheory.Limits -- attribute [local tidy] tactic.case_bash -- Porting note: no tidy nor cases_bash universe v v₂ u u₂ inductive WalkingParallelPair : Type | zero | one deriving DecidableEq, Inhabited #align category_theory.limits.walking_parallel_pair CategoryTheory.Limits.WalkingParallelPair open WalkingParallelPair inductive WalkingParallelPairHom : WalkingParallelPair → WalkingParallelPair → Type | left : WalkingParallelPairHom zero one | right : WalkingParallelPairHom zero one | id (X : WalkingParallelPair) : WalkingParallelPairHom X X deriving DecidableEq #align category_theory.limits.walking_parallel_pair_hom CategoryTheory.Limits.WalkingParallelPairHom attribute [-simp, nolint simpNF] WalkingParallelPairHom.id.sizeOf_spec instance : Inhabited (WalkingParallelPairHom zero one) where default := WalkingParallelPairHom.left open WalkingParallelPairHom def WalkingParallelPairHom.comp : -- Porting note: changed X Y Z to implicit to match comp fields in precategory ∀ { X Y Z : WalkingParallelPair } (_ : WalkingParallelPairHom X Y) (_ : WalkingParallelPairHom Y Z), WalkingParallelPairHom X Z | _, _, _, id _, h => h | _, _, _, left, id one => left | _, _, _, right, id one => right #align category_theory.limits.walking_parallel_pair_hom.comp CategoryTheory.Limits.WalkingParallelPairHom.comp -- Porting note: adding these since they are simple and aesop couldn't directly prove them theorem WalkingParallelPairHom.id_comp {X Y : WalkingParallelPair} (g : WalkingParallelPairHom X Y) : comp (id X) g = g := rfl
Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean
101
103
theorem WalkingParallelPairHom.comp_id {X Y : WalkingParallelPair} (f : WalkingParallelPairHom X Y) : comp f (id Y) = f := by
cases f <;> rfl
293
import Mathlib.CategoryTheory.EpiMono import Mathlib.CategoryTheory.Limits.HasLimits #align_import category_theory.limits.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba" section open CategoryTheory Opposite namespace CategoryTheory.Limits -- attribute [local tidy] tactic.case_bash -- Porting note: no tidy nor cases_bash universe v v₂ u u₂ inductive WalkingParallelPair : Type | zero | one deriving DecidableEq, Inhabited #align category_theory.limits.walking_parallel_pair CategoryTheory.Limits.WalkingParallelPair open WalkingParallelPair inductive WalkingParallelPairHom : WalkingParallelPair → WalkingParallelPair → Type | left : WalkingParallelPairHom zero one | right : WalkingParallelPairHom zero one | id (X : WalkingParallelPair) : WalkingParallelPairHom X X deriving DecidableEq #align category_theory.limits.walking_parallel_pair_hom CategoryTheory.Limits.WalkingParallelPairHom attribute [-simp, nolint simpNF] WalkingParallelPairHom.id.sizeOf_spec instance : Inhabited (WalkingParallelPairHom zero one) where default := WalkingParallelPairHom.left open WalkingParallelPairHom def WalkingParallelPairHom.comp : -- Porting note: changed X Y Z to implicit to match comp fields in precategory ∀ { X Y Z : WalkingParallelPair } (_ : WalkingParallelPairHom X Y) (_ : WalkingParallelPairHom Y Z), WalkingParallelPairHom X Z | _, _, _, id _, h => h | _, _, _, left, id one => left | _, _, _, right, id one => right #align category_theory.limits.walking_parallel_pair_hom.comp CategoryTheory.Limits.WalkingParallelPairHom.comp -- Porting note: adding these since they are simple and aesop couldn't directly prove them theorem WalkingParallelPairHom.id_comp {X Y : WalkingParallelPair} (g : WalkingParallelPairHom X Y) : comp (id X) g = g := rfl theorem WalkingParallelPairHom.comp_id {X Y : WalkingParallelPair} (f : WalkingParallelPairHom X Y) : comp f (id Y) = f := by cases f <;> rfl
Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean
105
108
theorem WalkingParallelPairHom.assoc {X Y Z W : WalkingParallelPair} (f : WalkingParallelPairHom X Y) (g: WalkingParallelPairHom Y Z) (h : WalkingParallelPairHom Z W) : comp (comp f g) h = comp f (comp g h) := by
cases f <;> cases g <;> cases h <;> rfl
293
import Mathlib.CategoryTheory.EpiMono import Mathlib.CategoryTheory.Limits.HasLimits #align_import category_theory.limits.shapes.equalizers from "leanprover-community/mathlib"@"4698e35ca56a0d4fa53aa5639c3364e0a77f4eba" section open CategoryTheory Opposite namespace CategoryTheory.Limits -- attribute [local tidy] tactic.case_bash -- Porting note: no tidy nor cases_bash universe v v₂ u u₂ inductive WalkingParallelPair : Type | zero | one deriving DecidableEq, Inhabited #align category_theory.limits.walking_parallel_pair CategoryTheory.Limits.WalkingParallelPair open WalkingParallelPair inductive WalkingParallelPairHom : WalkingParallelPair → WalkingParallelPair → Type | left : WalkingParallelPairHom zero one | right : WalkingParallelPairHom zero one | id (X : WalkingParallelPair) : WalkingParallelPairHom X X deriving DecidableEq #align category_theory.limits.walking_parallel_pair_hom CategoryTheory.Limits.WalkingParallelPairHom attribute [-simp, nolint simpNF] WalkingParallelPairHom.id.sizeOf_spec instance : Inhabited (WalkingParallelPairHom zero one) where default := WalkingParallelPairHom.left open WalkingParallelPairHom def WalkingParallelPairHom.comp : -- Porting note: changed X Y Z to implicit to match comp fields in precategory ∀ { X Y Z : WalkingParallelPair } (_ : WalkingParallelPairHom X Y) (_ : WalkingParallelPairHom Y Z), WalkingParallelPairHom X Z | _, _, _, id _, h => h | _, _, _, left, id one => left | _, _, _, right, id one => right #align category_theory.limits.walking_parallel_pair_hom.comp CategoryTheory.Limits.WalkingParallelPairHom.comp -- Porting note: adding these since they are simple and aesop couldn't directly prove them theorem WalkingParallelPairHom.id_comp {X Y : WalkingParallelPair} (g : WalkingParallelPairHom X Y) : comp (id X) g = g := rfl theorem WalkingParallelPairHom.comp_id {X Y : WalkingParallelPair} (f : WalkingParallelPairHom X Y) : comp f (id Y) = f := by cases f <;> rfl theorem WalkingParallelPairHom.assoc {X Y Z W : WalkingParallelPair} (f : WalkingParallelPairHom X Y) (g: WalkingParallelPairHom Y Z) (h : WalkingParallelPairHom Z W) : comp (comp f g) h = comp f (comp g h) := by cases f <;> cases g <;> cases h <;> rfl instance walkingParallelPairHomCategory : SmallCategory WalkingParallelPair where Hom := WalkingParallelPairHom id := id comp := comp comp_id := comp_id id_comp := id_comp assoc := assoc #align category_theory.limits.walking_parallel_pair_hom_category CategoryTheory.Limits.walkingParallelPairHomCategory @[simp] theorem walkingParallelPairHom_id (X : WalkingParallelPair) : WalkingParallelPairHom.id X = 𝟙 X := rfl #align category_theory.limits.walking_parallel_pair_hom_id CategoryTheory.Limits.walkingParallelPairHom_id -- Porting note: simpNF asked me to do this because the LHS of the non-primed version reduced @[simp]
Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean
126
127
theorem WalkingParallelPairHom.id.sizeOf_spec' (X : WalkingParallelPair) : (WalkingParallelPairHom._sizeOf_inst X X).sizeOf (𝟙 X) = 1 + sizeOf X := by
cases X <;> rfl
293
import Mathlib.CategoryTheory.Limits.Shapes.Equalizers import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts #align_import category_theory.limits.constructions.equalizers from "leanprover-community/mathlib"@"3424a5932a77dcec2c177ce7d805acace6149299" noncomputable section universe v v' u u' open CategoryTheory CategoryTheory.Category namespace CategoryTheory.Limits variable {C : Type u} [Category.{v} C] variable {D : Type u'} [Category.{v'} D] (G : C ⥤ D) -- We hide the "implementation details" inside a namespace namespace HasEqualizersOfHasPullbacksAndBinaryProducts variable [HasBinaryProducts C] [HasPullbacks C] abbrev constructEqualizer (F : WalkingParallelPair ⥤ C) : C := pullback (prod.lift (𝟙 _) (F.map WalkingParallelPairHom.left)) (prod.lift (𝟙 _) (F.map WalkingParallelPairHom.right)) #align category_theory.limits.has_equalizers_of_has_pullbacks_and_binary_products.construct_equalizer CategoryTheory.Limits.HasEqualizersOfHasPullbacksAndBinaryProducts.constructEqualizer abbrev pullbackFst (F : WalkingParallelPair ⥤ C) : constructEqualizer F ⟶ F.obj WalkingParallelPair.zero := pullback.fst #align category_theory.limits.has_equalizers_of_has_pullbacks_and_binary_products.pullback_fst CategoryTheory.Limits.HasEqualizersOfHasPullbacksAndBinaryProducts.pullbackFst
Mathlib/CategoryTheory/Limits/Constructions/Equalizers.lean
51
54
theorem pullbackFst_eq_pullback_snd (F : WalkingParallelPair ⥤ C) : pullbackFst F = pullback.snd := by
convert (eq_whisker pullback.condition Limits.prod.fst : (_ : constructEqualizer F ⟶ F.obj WalkingParallelPair.zero) = _) <;> simp
294
import Mathlib.CategoryTheory.Limits.HasLimits import Mathlib.CategoryTheory.Limits.Shapes.Equalizers #align_import category_theory.limits.shapes.wide_equalizers from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section namespace CategoryTheory.Limits open CategoryTheory universe w v u u₂ variable {J : Type w} inductive WalkingParallelFamily (J : Type w) : Type w | zero : WalkingParallelFamily J | one : WalkingParallelFamily J #align category_theory.limits.walking_parallel_family CategoryTheory.Limits.WalkingParallelFamily open WalkingParallelFamily instance : DecidableEq (WalkingParallelFamily J) | zero, zero => isTrue rfl | zero, one => isFalse fun t => WalkingParallelFamily.noConfusion t | one, zero => isFalse fun t => WalkingParallelFamily.noConfusion t | one, one => isTrue rfl instance : Inhabited (WalkingParallelFamily J) := ⟨zero⟩ inductive WalkingParallelFamily.Hom (J : Type w) : WalkingParallelFamily J → WalkingParallelFamily J → Type w | id : ∀ X : WalkingParallelFamily.{w} J, WalkingParallelFamily.Hom J X X | line : J → WalkingParallelFamily.Hom J zero one deriving DecidableEq #align category_theory.limits.walking_parallel_family.hom CategoryTheory.Limits.WalkingParallelFamily.Hom instance (J : Type v) : Inhabited (WalkingParallelFamily.Hom J zero zero) where default := Hom.id _ open WalkingParallelFamily.Hom def WalkingParallelFamily.Hom.comp : ∀ {X Y Z : WalkingParallelFamily J} (_ : WalkingParallelFamily.Hom J X Y) (_ : WalkingParallelFamily.Hom J Y Z), WalkingParallelFamily.Hom J X Z | _, _, _, id _, h => h | _, _, _, line j, id one => line j #align category_theory.limits.walking_parallel_family.hom.comp CategoryTheory.Limits.WalkingParallelFamily.Hom.comp -- attribute [local tidy] tactic.case_bash Porting note: no tidy, no local instance WalkingParallelFamily.category : SmallCategory (WalkingParallelFamily J) where Hom := WalkingParallelFamily.Hom J id := WalkingParallelFamily.Hom.id comp := WalkingParallelFamily.Hom.comp assoc f g h := by cases f <;> cases g <;> cases h <;> aesop_cat comp_id f := by cases f <;> aesop_cat #align category_theory.limits.walking_parallel_family.category CategoryTheory.Limits.WalkingParallelFamily.category @[simp] theorem WalkingParallelFamily.hom_id (X : WalkingParallelFamily J) : WalkingParallelFamily.Hom.id X = 𝟙 X := rfl #align category_theory.limits.walking_parallel_family.hom_id CategoryTheory.Limits.WalkingParallelFamily.hom_id variable {C : Type u} [Category.{v} C] variable {X Y : C} (f : J → (X ⟶ Y)) def parallelFamily : WalkingParallelFamily J ⥤ C where obj x := WalkingParallelFamily.casesOn x X Y map {x y} h := match x, y, h with | _, _, Hom.id _ => 𝟙 _ | _, _, line j => f j map_comp := by rintro _ _ _ ⟨⟩ ⟨⟩ <;> · aesop_cat #align category_theory.limits.parallel_family CategoryTheory.Limits.parallelFamily @[simp] theorem parallelFamily_obj_zero : (parallelFamily f).obj zero = X := rfl #align category_theory.limits.parallel_family_obj_zero CategoryTheory.Limits.parallelFamily_obj_zero @[simp] theorem parallelFamily_obj_one : (parallelFamily f).obj one = Y := rfl #align category_theory.limits.parallel_family_obj_one CategoryTheory.Limits.parallelFamily_obj_one @[simp] theorem parallelFamily_map_left {j : J} : (parallelFamily f).map (line j) = f j := rfl #align category_theory.limits.parallel_family_map_left CategoryTheory.Limits.parallelFamily_map_left @[simps!] def diagramIsoParallelFamily (F : WalkingParallelFamily J ⥤ C) : F ≅ parallelFamily fun j => F.map (line j) := NatIso.ofComponents (fun j => eqToIso <| by cases j <;> aesop_cat) <| by rintro _ _ (_|_) <;> aesop_cat #align category_theory.limits.diagram_iso_parallel_family CategoryTheory.Limits.diagramIsoParallelFamily @[simps!] def walkingParallelFamilyEquivWalkingParallelPair : WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair where functor := parallelFamily fun p => cond p.down WalkingParallelPairHom.left WalkingParallelPairHom.right inverse := parallelPair (line (ULift.up true)) (line (ULift.up false)) unitIso := NatIso.ofComponents (fun X => eqToIso (by cases X <;> rfl)) (by rintro _ _ (_|⟨_|_⟩) <;> aesop_cat) counitIso := NatIso.ofComponents (fun X => eqToIso (by cases X <;> rfl)) (by rintro _ _ (_|_|_) <;> aesop_cat) functor_unitIso_comp := by rintro (_|_) <;> aesop_cat #align category_theory.limits.walking_parallel_family_equiv_walking_parallel_pair CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair abbrev Trident := Cone (parallelFamily f) #align category_theory.limits.trident CategoryTheory.Limits.Trident abbrev Cotrident := Cocone (parallelFamily f) #align category_theory.limits.cotrident CategoryTheory.Limits.Cotrident variable {f} abbrev Trident.ι (t : Trident f) := t.π.app zero #align category_theory.limits.trident.ι CategoryTheory.Limits.Trident.ι abbrev Cotrident.π (t : Cotrident f) := t.ι.app one #align category_theory.limits.cotrident.π CategoryTheory.Limits.Cotrident.π @[simp] theorem Trident.ι_eq_app_zero (t : Trident f) : t.ι = t.π.app zero := rfl #align category_theory.limits.trident.ι_eq_app_zero CategoryTheory.Limits.Trident.ι_eq_app_zero @[simp] theorem Cotrident.π_eq_app_one (t : Cotrident f) : t.π = t.ι.app one := rfl #align category_theory.limits.cotrident.π_eq_app_one CategoryTheory.Limits.Cotrident.π_eq_app_one @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean
218
219
theorem Trident.app_zero (s : Trident f) (j : J) : s.π.app zero ≫ f j = s.π.app one := by
rw [← s.w (line j), parallelFamily_map_left]
295
import Mathlib.CategoryTheory.Limits.HasLimits import Mathlib.CategoryTheory.Limits.Shapes.Equalizers #align_import category_theory.limits.shapes.wide_equalizers from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section namespace CategoryTheory.Limits open CategoryTheory universe w v u u₂ variable {J : Type w} inductive WalkingParallelFamily (J : Type w) : Type w | zero : WalkingParallelFamily J | one : WalkingParallelFamily J #align category_theory.limits.walking_parallel_family CategoryTheory.Limits.WalkingParallelFamily open WalkingParallelFamily instance : DecidableEq (WalkingParallelFamily J) | zero, zero => isTrue rfl | zero, one => isFalse fun t => WalkingParallelFamily.noConfusion t | one, zero => isFalse fun t => WalkingParallelFamily.noConfusion t | one, one => isTrue rfl instance : Inhabited (WalkingParallelFamily J) := ⟨zero⟩ inductive WalkingParallelFamily.Hom (J : Type w) : WalkingParallelFamily J → WalkingParallelFamily J → Type w | id : ∀ X : WalkingParallelFamily.{w} J, WalkingParallelFamily.Hom J X X | line : J → WalkingParallelFamily.Hom J zero one deriving DecidableEq #align category_theory.limits.walking_parallel_family.hom CategoryTheory.Limits.WalkingParallelFamily.Hom instance (J : Type v) : Inhabited (WalkingParallelFamily.Hom J zero zero) where default := Hom.id _ open WalkingParallelFamily.Hom def WalkingParallelFamily.Hom.comp : ∀ {X Y Z : WalkingParallelFamily J} (_ : WalkingParallelFamily.Hom J X Y) (_ : WalkingParallelFamily.Hom J Y Z), WalkingParallelFamily.Hom J X Z | _, _, _, id _, h => h | _, _, _, line j, id one => line j #align category_theory.limits.walking_parallel_family.hom.comp CategoryTheory.Limits.WalkingParallelFamily.Hom.comp -- attribute [local tidy] tactic.case_bash Porting note: no tidy, no local instance WalkingParallelFamily.category : SmallCategory (WalkingParallelFamily J) where Hom := WalkingParallelFamily.Hom J id := WalkingParallelFamily.Hom.id comp := WalkingParallelFamily.Hom.comp assoc f g h := by cases f <;> cases g <;> cases h <;> aesop_cat comp_id f := by cases f <;> aesop_cat #align category_theory.limits.walking_parallel_family.category CategoryTheory.Limits.WalkingParallelFamily.category @[simp] theorem WalkingParallelFamily.hom_id (X : WalkingParallelFamily J) : WalkingParallelFamily.Hom.id X = 𝟙 X := rfl #align category_theory.limits.walking_parallel_family.hom_id CategoryTheory.Limits.WalkingParallelFamily.hom_id variable {C : Type u} [Category.{v} C] variable {X Y : C} (f : J → (X ⟶ Y)) def parallelFamily : WalkingParallelFamily J ⥤ C where obj x := WalkingParallelFamily.casesOn x X Y map {x y} h := match x, y, h with | _, _, Hom.id _ => 𝟙 _ | _, _, line j => f j map_comp := by rintro _ _ _ ⟨⟩ ⟨⟩ <;> · aesop_cat #align category_theory.limits.parallel_family CategoryTheory.Limits.parallelFamily @[simp] theorem parallelFamily_obj_zero : (parallelFamily f).obj zero = X := rfl #align category_theory.limits.parallel_family_obj_zero CategoryTheory.Limits.parallelFamily_obj_zero @[simp] theorem parallelFamily_obj_one : (parallelFamily f).obj one = Y := rfl #align category_theory.limits.parallel_family_obj_one CategoryTheory.Limits.parallelFamily_obj_one @[simp] theorem parallelFamily_map_left {j : J} : (parallelFamily f).map (line j) = f j := rfl #align category_theory.limits.parallel_family_map_left CategoryTheory.Limits.parallelFamily_map_left @[simps!] def diagramIsoParallelFamily (F : WalkingParallelFamily J ⥤ C) : F ≅ parallelFamily fun j => F.map (line j) := NatIso.ofComponents (fun j => eqToIso <| by cases j <;> aesop_cat) <| by rintro _ _ (_|_) <;> aesop_cat #align category_theory.limits.diagram_iso_parallel_family CategoryTheory.Limits.diagramIsoParallelFamily @[simps!] def walkingParallelFamilyEquivWalkingParallelPair : WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair where functor := parallelFamily fun p => cond p.down WalkingParallelPairHom.left WalkingParallelPairHom.right inverse := parallelPair (line (ULift.up true)) (line (ULift.up false)) unitIso := NatIso.ofComponents (fun X => eqToIso (by cases X <;> rfl)) (by rintro _ _ (_|⟨_|_⟩) <;> aesop_cat) counitIso := NatIso.ofComponents (fun X => eqToIso (by cases X <;> rfl)) (by rintro _ _ (_|_|_) <;> aesop_cat) functor_unitIso_comp := by rintro (_|_) <;> aesop_cat #align category_theory.limits.walking_parallel_family_equiv_walking_parallel_pair CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair abbrev Trident := Cone (parallelFamily f) #align category_theory.limits.trident CategoryTheory.Limits.Trident abbrev Cotrident := Cocone (parallelFamily f) #align category_theory.limits.cotrident CategoryTheory.Limits.Cotrident variable {f} abbrev Trident.ι (t : Trident f) := t.π.app zero #align category_theory.limits.trident.ι CategoryTheory.Limits.Trident.ι abbrev Cotrident.π (t : Cotrident f) := t.ι.app one #align category_theory.limits.cotrident.π CategoryTheory.Limits.Cotrident.π @[simp] theorem Trident.ι_eq_app_zero (t : Trident f) : t.ι = t.π.app zero := rfl #align category_theory.limits.trident.ι_eq_app_zero CategoryTheory.Limits.Trident.ι_eq_app_zero @[simp] theorem Cotrident.π_eq_app_one (t : Cotrident f) : t.π = t.ι.app one := rfl #align category_theory.limits.cotrident.π_eq_app_one CategoryTheory.Limits.Cotrident.π_eq_app_one @[reassoc (attr := simp)] theorem Trident.app_zero (s : Trident f) (j : J) : s.π.app zero ≫ f j = s.π.app one := by rw [← s.w (line j), parallelFamily_map_left] #align category_theory.limits.trident.app_zero CategoryTheory.Limits.Trident.app_zero @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean
223
224
theorem Cotrident.app_one (s : Cotrident f) (j : J) : f j ≫ s.ι.app one = s.ι.app zero := by
rw [← s.w (line j), parallelFamily_map_left]
295
import Mathlib.CategoryTheory.Limits.Shapes.Equalizers import Mathlib.CategoryTheory.Limits.Shapes.Products import Mathlib.Topology.Sheaves.SheafCondition.PairwiseIntersections #align_import topology.sheaves.sheaf_condition.equalizer_products from "leanprover-community/mathlib"@"85d6221d32c37e68f05b2e42cde6cee658dae5e9" universe v' v u noncomputable section open CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite TopologicalSpace.Opens namespace TopCat variable {C : Type u} [Category.{v} C] [HasProducts.{v'} C] variable {X : TopCat.{v'}} (F : Presheaf C X) {ι : Type v'} (U : ι → Opens X) namespace Presheaf namespace SheafConditionEqualizerProducts def piOpens : C := ∏ᶜ fun i : ι => F.obj (op (U i)) set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.pi_opens TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens def piInters : C := ∏ᶜ fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2)) set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.pi_inters TopCat.Presheaf.SheafConditionEqualizerProducts.piInters def leftRes : piOpens F U ⟶ piInters.{v'} F U := Pi.lift fun p : ι × ι => Pi.π _ p.1 ≫ F.map (infLELeft (U p.1) (U p.2)).op set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.left_res TopCat.Presheaf.SheafConditionEqualizerProducts.leftRes def rightRes : piOpens F U ⟶ piInters.{v'} F U := Pi.lift fun p : ι × ι => Pi.π _ p.2 ≫ F.map (infLERight (U p.1) (U p.2)).op set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.right_res TopCat.Presheaf.SheafConditionEqualizerProducts.rightRes def res : F.obj (op (iSup U)) ⟶ piOpens.{v'} F U := Pi.lift fun i : ι => F.map (TopologicalSpace.Opens.leSupr U i).op set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.res TopCat.Presheaf.SheafConditionEqualizerProducts.res @[simp, elementwise]
Mathlib/Topology/Sheaves/SheafCondition/EqualizerProducts.lean
80
81
theorem res_π (i : ι) : res F U ≫ limit.π _ ⟨i⟩ = F.map (Opens.leSupr U i).op := by
rw [res, limit.lift_π, Fan.mk_π_app]
296
import Mathlib.CategoryTheory.Limits.Shapes.Equalizers import Mathlib.CategoryTheory.Limits.Shapes.Products import Mathlib.Topology.Sheaves.SheafCondition.PairwiseIntersections #align_import topology.sheaves.sheaf_condition.equalizer_products from "leanprover-community/mathlib"@"85d6221d32c37e68f05b2e42cde6cee658dae5e9" universe v' v u noncomputable section open CategoryTheory CategoryTheory.Limits TopologicalSpace Opposite TopologicalSpace.Opens namespace TopCat variable {C : Type u} [Category.{v} C] [HasProducts.{v'} C] variable {X : TopCat.{v'}} (F : Presheaf C X) {ι : Type v'} (U : ι → Opens X) namespace Presheaf namespace SheafConditionEqualizerProducts def piOpens : C := ∏ᶜ fun i : ι => F.obj (op (U i)) set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.pi_opens TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens def piInters : C := ∏ᶜ fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2)) set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.pi_inters TopCat.Presheaf.SheafConditionEqualizerProducts.piInters def leftRes : piOpens F U ⟶ piInters.{v'} F U := Pi.lift fun p : ι × ι => Pi.π _ p.1 ≫ F.map (infLELeft (U p.1) (U p.2)).op set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.left_res TopCat.Presheaf.SheafConditionEqualizerProducts.leftRes def rightRes : piOpens F U ⟶ piInters.{v'} F U := Pi.lift fun p : ι × ι => Pi.π _ p.2 ≫ F.map (infLERight (U p.1) (U p.2)).op set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.right_res TopCat.Presheaf.SheafConditionEqualizerProducts.rightRes def res : F.obj (op (iSup U)) ⟶ piOpens.{v'} F U := Pi.lift fun i : ι => F.map (TopologicalSpace.Opens.leSupr U i).op set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.res TopCat.Presheaf.SheafConditionEqualizerProducts.res @[simp, elementwise] theorem res_π (i : ι) : res F U ≫ limit.π _ ⟨i⟩ = F.map (Opens.leSupr U i).op := by rw [res, limit.lift_π, Fan.mk_π_app] set_option linter.uppercaseLean3 false in #align Top.presheaf.sheaf_condition_equalizer_products.res_π TopCat.Presheaf.SheafConditionEqualizerProducts.res_π @[elementwise]
Mathlib/Topology/Sheaves/SheafCondition/EqualizerProducts.lean
86
94
theorem w : res F U ≫ leftRes F U = res F U ≫ rightRes F U := by
dsimp [res, leftRes, rightRes] -- Porting note: `ext` can't see `limit.hom_ext` applies here: -- See https://github.com/leanprover-community/mathlib4/issues/5229 refine limit.hom_ext (fun _ => ?_) simp only [limit.lift_π, limit.lift_π_assoc, Fan.mk_π_app, Category.assoc] rw [← F.map_comp] rw [← F.map_comp] congr 1
296
import Mathlib.RingTheory.FiniteType #align_import ring_theory.rees_algebra from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) open Polynomial open Polynomial def reesAlgebra : Subalgebra R R[X] where carrier := { f | ∀ i, f.coeff i ∈ I ^ i } mul_mem' hf hg i := by rw [coeff_mul] apply Ideal.sum_mem rintro ⟨j, k⟩ e rw [← Finset.mem_antidiagonal.mp e, pow_add] exact Ideal.mul_mem_mul (hf j) (hg k) one_mem' i := by rw [coeff_one] split_ifs with h · subst h simp · simp add_mem' hf hg i := by rw [coeff_add] exact Ideal.add_mem _ (hf i) (hg i) zero_mem' i := Ideal.zero_mem _ algebraMap_mem' r i := by rw [algebraMap_apply, coeff_C] split_ifs with h · subst h simp · simp #align rees_algebra reesAlgebra theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i := Iff.rfl #align mem_rees_algebra_iff mem_reesAlgebra_iff
Mathlib/RingTheory/ReesAlgebra.lean
68
73
theorem mem_reesAlgebra_iff_support (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i ∈ f.support, f.coeff i ∈ I ^ i := by
apply forall_congr' intro a rw [mem_support_iff, Iff.comm, Classical.imp_iff_right_iff, Ne, ← imp_iff_not_or] exact fun e => e.symm ▸ (I ^ a).zero_mem
297
import Mathlib.RingTheory.FiniteType #align_import ring_theory.rees_algebra from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) open Polynomial open Polynomial def reesAlgebra : Subalgebra R R[X] where carrier := { f | ∀ i, f.coeff i ∈ I ^ i } mul_mem' hf hg i := by rw [coeff_mul] apply Ideal.sum_mem rintro ⟨j, k⟩ e rw [← Finset.mem_antidiagonal.mp e, pow_add] exact Ideal.mul_mem_mul (hf j) (hg k) one_mem' i := by rw [coeff_one] split_ifs with h · subst h simp · simp add_mem' hf hg i := by rw [coeff_add] exact Ideal.add_mem _ (hf i) (hg i) zero_mem' i := Ideal.zero_mem _ algebraMap_mem' r i := by rw [algebraMap_apply, coeff_C] split_ifs with h · subst h simp · simp #align rees_algebra reesAlgebra theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i := Iff.rfl #align mem_rees_algebra_iff mem_reesAlgebra_iff theorem mem_reesAlgebra_iff_support (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i ∈ f.support, f.coeff i ∈ I ^ i := by apply forall_congr' intro a rw [mem_support_iff, Iff.comm, Classical.imp_iff_right_iff, Ne, ← imp_iff_not_or] exact fun e => e.symm ▸ (I ^ a).zero_mem #align mem_rees_algebra_iff_support mem_reesAlgebra_iff_support
Mathlib/RingTheory/ReesAlgebra.lean
76
79
theorem reesAlgebra.monomial_mem {I : Ideal R} {i : ℕ} {r : R} : monomial i r ∈ reesAlgebra I ↔ r ∈ I ^ i := by
simp (config := { contextual := true }) [mem_reesAlgebra_iff_support, coeff_monomial, ← imp_iff_not_or]
297
import Mathlib.RingTheory.FiniteType #align_import ring_theory.rees_algebra from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) open Polynomial open Polynomial def reesAlgebra : Subalgebra R R[X] where carrier := { f | ∀ i, f.coeff i ∈ I ^ i } mul_mem' hf hg i := by rw [coeff_mul] apply Ideal.sum_mem rintro ⟨j, k⟩ e rw [← Finset.mem_antidiagonal.mp e, pow_add] exact Ideal.mul_mem_mul (hf j) (hg k) one_mem' i := by rw [coeff_one] split_ifs with h · subst h simp · simp add_mem' hf hg i := by rw [coeff_add] exact Ideal.add_mem _ (hf i) (hg i) zero_mem' i := Ideal.zero_mem _ algebraMap_mem' r i := by rw [algebraMap_apply, coeff_C] split_ifs with h · subst h simp · simp #align rees_algebra reesAlgebra theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i := Iff.rfl #align mem_rees_algebra_iff mem_reesAlgebra_iff theorem mem_reesAlgebra_iff_support (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i ∈ f.support, f.coeff i ∈ I ^ i := by apply forall_congr' intro a rw [mem_support_iff, Iff.comm, Classical.imp_iff_right_iff, Ne, ← imp_iff_not_or] exact fun e => e.symm ▸ (I ^ a).zero_mem #align mem_rees_algebra_iff_support mem_reesAlgebra_iff_support theorem reesAlgebra.monomial_mem {I : Ideal R} {i : ℕ} {r : R} : monomial i r ∈ reesAlgebra I ↔ r ∈ I ^ i := by simp (config := { contextual := true }) [mem_reesAlgebra_iff_support, coeff_monomial, ← imp_iff_not_or] #align rees_algebra.monomial_mem reesAlgebra.monomial_mem
Mathlib/RingTheory/ReesAlgebra.lean
82
95
theorem monomial_mem_adjoin_monomial {I : Ideal R} {n : ℕ} {r : R} (hr : r ∈ I ^ n) : monomial n r ∈ Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) := by
induction' n with n hn generalizing r · exact Subalgebra.algebraMap_mem _ _ · rw [pow_succ'] at hr apply Submodule.smul_induction_on -- Porting note: did not need help with motive previously (p := fun r => (monomial (Nat.succ n)) r ∈ Algebra.adjoin R (Submodule.map (monomial 1) I)) hr · intro r hr s hs rw [Nat.succ_eq_one_add, smul_eq_mul, ← monomial_mul_monomial] exact Subalgebra.mul_mem _ (Algebra.subset_adjoin (Set.mem_image_of_mem _ hr)) (hn hs) · intro x y hx hy rw [monomial_add] exact Subalgebra.add_mem _ hx hy
297
import Mathlib.RingTheory.FiniteType #align_import ring_theory.rees_algebra from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) open Polynomial open Polynomial def reesAlgebra : Subalgebra R R[X] where carrier := { f | ∀ i, f.coeff i ∈ I ^ i } mul_mem' hf hg i := by rw [coeff_mul] apply Ideal.sum_mem rintro ⟨j, k⟩ e rw [← Finset.mem_antidiagonal.mp e, pow_add] exact Ideal.mul_mem_mul (hf j) (hg k) one_mem' i := by rw [coeff_one] split_ifs with h · subst h simp · simp add_mem' hf hg i := by rw [coeff_add] exact Ideal.add_mem _ (hf i) (hg i) zero_mem' i := Ideal.zero_mem _ algebraMap_mem' r i := by rw [algebraMap_apply, coeff_C] split_ifs with h · subst h simp · simp #align rees_algebra reesAlgebra theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i := Iff.rfl #align mem_rees_algebra_iff mem_reesAlgebra_iff theorem mem_reesAlgebra_iff_support (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i ∈ f.support, f.coeff i ∈ I ^ i := by apply forall_congr' intro a rw [mem_support_iff, Iff.comm, Classical.imp_iff_right_iff, Ne, ← imp_iff_not_or] exact fun e => e.symm ▸ (I ^ a).zero_mem #align mem_rees_algebra_iff_support mem_reesAlgebra_iff_support theorem reesAlgebra.monomial_mem {I : Ideal R} {i : ℕ} {r : R} : monomial i r ∈ reesAlgebra I ↔ r ∈ I ^ i := by simp (config := { contextual := true }) [mem_reesAlgebra_iff_support, coeff_monomial, ← imp_iff_not_or] #align rees_algebra.monomial_mem reesAlgebra.monomial_mem theorem monomial_mem_adjoin_monomial {I : Ideal R} {n : ℕ} {r : R} (hr : r ∈ I ^ n) : monomial n r ∈ Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) := by induction' n with n hn generalizing r · exact Subalgebra.algebraMap_mem _ _ · rw [pow_succ'] at hr apply Submodule.smul_induction_on -- Porting note: did not need help with motive previously (p := fun r => (monomial (Nat.succ n)) r ∈ Algebra.adjoin R (Submodule.map (monomial 1) I)) hr · intro r hr s hs rw [Nat.succ_eq_one_add, smul_eq_mul, ← monomial_mul_monomial] exact Subalgebra.mul_mem _ (Algebra.subset_adjoin (Set.mem_image_of_mem _ hr)) (hn hs) · intro x y hx hy rw [monomial_add] exact Subalgebra.add_mem _ hx hy #align monomial_mem_adjoin_monomial monomial_mem_adjoin_monomial
Mathlib/RingTheory/ReesAlgebra.lean
98
108
theorem adjoin_monomial_eq_reesAlgebra : Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) = reesAlgebra I := by
apply le_antisymm · apply Algebra.adjoin_le _ rintro _ ⟨r, hr, rfl⟩ exact reesAlgebra.monomial_mem.mpr (by rwa [pow_one]) · intro p hp rw [p.as_sum_support] apply Subalgebra.sum_mem _ _ rintro i - exact monomial_mem_adjoin_monomial (hp i)
297
import Mathlib.RingTheory.FiniteType #align_import ring_theory.rees_algebra from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u v variable {R M : Type u} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) open Polynomial open Polynomial def reesAlgebra : Subalgebra R R[X] where carrier := { f | ∀ i, f.coeff i ∈ I ^ i } mul_mem' hf hg i := by rw [coeff_mul] apply Ideal.sum_mem rintro ⟨j, k⟩ e rw [← Finset.mem_antidiagonal.mp e, pow_add] exact Ideal.mul_mem_mul (hf j) (hg k) one_mem' i := by rw [coeff_one] split_ifs with h · subst h simp · simp add_mem' hf hg i := by rw [coeff_add] exact Ideal.add_mem _ (hf i) (hg i) zero_mem' i := Ideal.zero_mem _ algebraMap_mem' r i := by rw [algebraMap_apply, coeff_C] split_ifs with h · subst h simp · simp #align rees_algebra reesAlgebra theorem mem_reesAlgebra_iff (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i, f.coeff i ∈ I ^ i := Iff.rfl #align mem_rees_algebra_iff mem_reesAlgebra_iff theorem mem_reesAlgebra_iff_support (f : R[X]) : f ∈ reesAlgebra I ↔ ∀ i ∈ f.support, f.coeff i ∈ I ^ i := by apply forall_congr' intro a rw [mem_support_iff, Iff.comm, Classical.imp_iff_right_iff, Ne, ← imp_iff_not_or] exact fun e => e.symm ▸ (I ^ a).zero_mem #align mem_rees_algebra_iff_support mem_reesAlgebra_iff_support theorem reesAlgebra.monomial_mem {I : Ideal R} {i : ℕ} {r : R} : monomial i r ∈ reesAlgebra I ↔ r ∈ I ^ i := by simp (config := { contextual := true }) [mem_reesAlgebra_iff_support, coeff_monomial, ← imp_iff_not_or] #align rees_algebra.monomial_mem reesAlgebra.monomial_mem theorem monomial_mem_adjoin_monomial {I : Ideal R} {n : ℕ} {r : R} (hr : r ∈ I ^ n) : monomial n r ∈ Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) := by induction' n with n hn generalizing r · exact Subalgebra.algebraMap_mem _ _ · rw [pow_succ'] at hr apply Submodule.smul_induction_on -- Porting note: did not need help with motive previously (p := fun r => (monomial (Nat.succ n)) r ∈ Algebra.adjoin R (Submodule.map (monomial 1) I)) hr · intro r hr s hs rw [Nat.succ_eq_one_add, smul_eq_mul, ← monomial_mul_monomial] exact Subalgebra.mul_mem _ (Algebra.subset_adjoin (Set.mem_image_of_mem _ hr)) (hn hs) · intro x y hx hy rw [monomial_add] exact Subalgebra.add_mem _ hx hy #align monomial_mem_adjoin_monomial monomial_mem_adjoin_monomial theorem adjoin_monomial_eq_reesAlgebra : Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) I : Set R[X]) = reesAlgebra I := by apply le_antisymm · apply Algebra.adjoin_le _ rintro _ ⟨r, hr, rfl⟩ exact reesAlgebra.monomial_mem.mpr (by rwa [pow_one]) · intro p hp rw [p.as_sum_support] apply Subalgebra.sum_mem _ _ rintro i - exact monomial_mem_adjoin_monomial (hp i) #align adjoin_monomial_eq_rees_algebra adjoin_monomial_eq_reesAlgebra variable {I}
Mathlib/RingTheory/ReesAlgebra.lean
113
123
theorem reesAlgebra.fg (hI : I.FG) : (reesAlgebra I).FG := by
classical obtain ⟨s, hs⟩ := hI rw [← adjoin_monomial_eq_reesAlgebra, ← hs] use s.image (monomial 1) rw [Finset.coe_image] change _ = Algebra.adjoin R (Submodule.map (monomial 1 : R →ₗ[R] R[X]) (Submodule.span R ↑s) : Set R[X]) rw [Submodule.map_span, Algebra.adjoin_span]
297
import Mathlib.Topology.Sets.Opens #align_import topology.sets.closeds from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" open Order OrderDual Set variable {ι α β : Type*} [TopologicalSpace α] [TopologicalSpace β] namespace TopologicalSpace structure Closeds (α : Type*) [TopologicalSpace α] where carrier : Set α closed' : IsClosed carrier #align topological_space.closeds TopologicalSpace.Closeds namespace Closeds instance : SetLike (Closeds α) α where coe := Closeds.carrier coe_injective' s t h := by cases s; cases t; congr instance : CanLift (Set α) (Closeds α) (↑) IsClosed where prf s hs := ⟨⟨s, hs⟩, rfl⟩ theorem closed (s : Closeds α) : IsClosed (s : Set α) := s.closed' #align topological_space.closeds.closed TopologicalSpace.Closeds.closed def Simps.coe (s : Closeds α) : Set α := s initialize_simps_projections Closeds (carrier → coe, as_prefix coe) @[ext] protected theorem ext {s t : Closeds α} (h : (s : Set α) = t) : s = t := SetLike.ext' h #align topological_space.closeds.ext TopologicalSpace.Closeds.ext @[simp] theorem coe_mk (s : Set α) (h) : (mk s h : Set α) = s := rfl #align topological_space.closeds.coe_mk TopologicalSpace.Closeds.coe_mk @[simps] protected def closure (s : Set α) : Closeds α := ⟨closure s, isClosed_closure⟩ #align topological_space.closeds.closure TopologicalSpace.Closeds.closure theorem gc : GaloisConnection Closeds.closure ((↑) : Closeds α → Set α) := fun _ U => ⟨subset_closure.trans, fun h => closure_minimal h U.closed⟩ #align topological_space.closeds.gc TopologicalSpace.Closeds.gc def gi : GaloisInsertion (@Closeds.closure α _) (↑) where choice s hs := ⟨s, closure_eq_iff_isClosed.1 <| hs.antisymm subset_closure⟩ gc := gc le_l_u _ := subset_closure choice_eq _s hs := SetLike.coe_injective <| subset_closure.antisymm hs #align topological_space.closeds.gi TopologicalSpace.Closeds.gi instance completeLattice : CompleteLattice (Closeds α) := CompleteLattice.copy (GaloisInsertion.liftCompleteLattice gi) -- le _ rfl -- top ⟨univ, isClosed_univ⟩ rfl -- bot ⟨∅, isClosed_empty⟩ (SetLike.coe_injective closure_empty.symm) -- sup (fun s t => ⟨s ∪ t, s.2.union t.2⟩) (funext fun s => funext fun t => SetLike.coe_injective (s.2.union t.2).closure_eq.symm) -- inf (fun s t => ⟨s ∩ t, s.2.inter t.2⟩) rfl -- sSup _ rfl -- sInf (fun S => ⟨⋂ s ∈ S, ↑s, isClosed_biInter fun s _ => s.2⟩) (funext fun _ => SetLike.coe_injective sInf_image.symm) instance : Inhabited (Closeds α) := ⟨⊥⟩ @[simp, norm_cast]
Mathlib/Topology/Sets/Closeds.lean
110
111
theorem coe_sup (s t : Closeds α) : (↑(s ⊔ t) : Set α) = ↑s ∪ ↑t := by
rfl
298
import Batteries.Control.ForInStep.Lemmas import Batteries.Data.List.Basic import Batteries.Tactic.Init import Batteries.Tactic.Alias namespace List open Nat @[simp] theorem mem_toArray {a : α} {l : List α} : a ∈ l.toArray ↔ a ∈ l := by simp [Array.mem_def] @[simp] theorem drop_one : ∀ l : List α, drop 1 l = tail l | [] | _ :: _ => rfl
.lake/packages/batteries/Batteries/Data/List/Lemmas.lean
28
29
theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail := by
rw [← drop_one]; simp [zipWith_distrib_drop]
299
import Batteries.Control.ForInStep.Lemmas import Batteries.Data.List.Basic import Batteries.Tactic.Init import Batteries.Tactic.Alias namespace List open Nat @[simp] theorem mem_toArray {a : α} {l : List α} : a ∈ l.toArray ↔ a ∈ l := by simp [Array.mem_def] @[simp] theorem drop_one : ∀ l : List α, drop 1 l = tail l | [] | _ :: _ => rfl theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail := by rw [← drop_one]; simp [zipWith_distrib_drop] theorem subset_def {l₁ l₂ : List α} : l₁ ⊆ l₂ ↔ ∀ {a : α}, a ∈ l₁ → a ∈ l₂ := .rfl @[simp] theorem nil_subset (l : List α) : [] ⊆ l := nofun @[simp] theorem Subset.refl (l : List α) : l ⊆ l := fun _ i => i theorem Subset.trans {l₁ l₂ l₃ : List α} (h₁ : l₁ ⊆ l₂) (h₂ : l₂ ⊆ l₃) : l₁ ⊆ l₃ := fun _ i => h₂ (h₁ i) instance : Trans (Membership.mem : α → List α → Prop) Subset Membership.mem := ⟨fun h₁ h₂ => h₂ h₁⟩ instance : Trans (Subset : List α → List α → Prop) Subset Subset := ⟨Subset.trans⟩ @[simp] theorem subset_cons (a : α) (l : List α) : l ⊆ a :: l := fun _ => Mem.tail _ theorem subset_of_cons_subset {a : α} {l₁ l₂ : List α} : a :: l₁ ⊆ l₂ → l₁ ⊆ l₂ := fun s _ i => s (mem_cons_of_mem _ i) theorem subset_cons_of_subset (a : α) {l₁ l₂ : List α} : l₁ ⊆ l₂ → l₁ ⊆ a :: l₂ := fun s _ i => .tail _ (s i) theorem cons_subset_cons {l₁ l₂ : List α} (a : α) (s : l₁ ⊆ l₂) : a :: l₁ ⊆ a :: l₂ := fun _ => by simp only [mem_cons]; exact Or.imp_right (@s _) @[simp] theorem subset_append_left (l₁ l₂ : List α) : l₁ ⊆ l₁ ++ l₂ := fun _ => mem_append_left _ @[simp] theorem subset_append_right (l₁ l₂ : List α) : l₂ ⊆ l₁ ++ l₂ := fun _ => mem_append_right _ theorem subset_append_of_subset_left (l₂ : List α) : l ⊆ l₁ → l ⊆ l₁ ++ l₂ := fun s => Subset.trans s <| subset_append_left _ _ theorem subset_append_of_subset_right (l₁ : List α) : l ⊆ l₂ → l ⊆ l₁ ++ l₂ := fun s => Subset.trans s <| subset_append_right _ _ @[simp] theorem cons_subset : a :: l ⊆ m ↔ a ∈ m ∧ l ⊆ m := by simp only [subset_def, mem_cons, or_imp, forall_and, forall_eq] @[simp] theorem append_subset {l₁ l₂ l : List α} : l₁ ++ l₂ ⊆ l ↔ l₁ ⊆ l ∧ l₂ ⊆ l := by simp [subset_def, or_imp, forall_and] theorem subset_nil {l : List α} : l ⊆ [] ↔ l = [] := ⟨fun h => match l with | [] => rfl | _::_ => (nomatch h (.head ..)), fun | rfl => Subset.refl _⟩ theorem map_subset {l₁ l₂ : List α} (f : α → β) (H : l₁ ⊆ l₂) : map f l₁ ⊆ map f l₂ := fun x => by simp only [mem_map]; exact .imp fun a => .imp_left (@H _) @[simp] theorem nil_sublist : ∀ l : List α, [] <+ l | [] => .slnil | a :: l => (nil_sublist l).cons a @[simp] theorem Sublist.refl : ∀ l : List α, l <+ l | [] => .slnil | a :: l => (Sublist.refl l).cons₂ a
.lake/packages/batteries/Batteries/Data/List/Lemmas.lean
91
100
theorem Sublist.trans {l₁ l₂ l₃ : List α} (h₁ : l₁ <+ l₂) (h₂ : l₂ <+ l₃) : l₁ <+ l₃ := by
induction h₂ generalizing l₁ with | slnil => exact h₁ | cons _ _ IH => exact (IH h₁).cons _ | @cons₂ l₂ _ a _ IH => generalize e : a :: l₂ = l₂' match e ▸ h₁ with | .slnil => apply nil_sublist | .cons a' h₁' => cases e; apply (IH h₁').cons | .cons₂ a' h₁' => cases e; apply (IH h₁').cons₂
299
import Mathlib.CategoryTheory.Adjunction.Whiskering import Mathlib.CategoryTheory.Sites.PreservesSheafification #align_import category_theory.sites.adjunction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace CategoryTheory open GrothendieckTopology CategoryTheory Limits Opposite universe v u variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) variable {D : Type*} [Category D] variable {E : Type*} [Category E] variable {F : D ⥤ E} {G : E ⥤ D} variable [HasWeakSheafify J D] abbrev sheafForget [ConcreteCategory D] [HasSheafCompose J (forget D)] : Sheaf J D ⥤ SheafOfTypes J := sheafCompose J (forget D) ⋙ (sheafEquivSheafOfTypes J).functor set_option linter.uppercaseLean3 false in #align category_theory.Sheaf_forget CategoryTheory.sheafForget namespace Sheaf noncomputable section @[simps] def composeEquiv [HasSheafCompose J F] (adj : G ⊣ F) (X : Sheaf J E) (Y : Sheaf J D) : ((composeAndSheafify J G).obj X ⟶ Y) ≃ (X ⟶ (sheafCompose J F).obj Y) := let A := adj.whiskerRight Cᵒᵖ { toFun := fun η => ⟨A.homEquiv _ _ (toSheafify J _ ≫ η.val)⟩ invFun := fun γ => ⟨sheafifyLift J ((A.homEquiv _ _).symm ((sheafToPresheaf _ _).map γ)) Y.2⟩ left_inv := by intro η ext1 dsimp symm apply sheafifyLift_unique rw [Equiv.symm_apply_apply] right_inv := by intro γ ext1 dsimp -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [toSheafify_sheafifyLift, Equiv.apply_symm_apply] } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_equiv CategoryTheory.Sheaf.composeEquiv -- These lemmas have always been bad (#7657), but leanprover/lean4#2644 made `simp` start noticing attribute [nolint simpNF] CategoryTheory.Sheaf.composeEquiv_apply_val CategoryTheory.Sheaf.composeEquiv_symm_apply_val @[simps! unit_app_val counit_app_val] def adjunction [HasSheafCompose J F] (adj : G ⊣ F) : composeAndSheafify J G ⊣ sheafCompose J F := Adjunction.mkOfHomEquiv { homEquiv := composeEquiv J adj homEquiv_naturality_left_symm := fun f g => by ext1 dsimp [composeEquiv] rw [sheafifyMap_sheafifyLift] erw [Adjunction.homEquiv_naturality_left_symm] rw [whiskeringRight_obj_map] rfl homEquiv_naturality_right := fun f g => by ext dsimp [composeEquiv] erw [Adjunction.homEquiv_unit, Adjunction.homEquiv_unit] dsimp simp } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction CategoryTheory.Sheaf.adjunction instance [F.IsRightAdjoint] : (sheafCompose J F).IsRightAdjoint := (adjunction J (Adjunction.ofIsRightAdjoint F)).isRightAdjoint instance [G.IsLeftAdjoint] : (composeAndSheafify J G).IsLeftAdjoint := (adjunction J (Adjunction.ofIsLeftAdjoint G)).isLeftAdjoint lemma preservesSheafification_of_adjunction (adj : G ⊣ F) : J.PreservesSheafification G where le P Q f hf := by have := adj.isRightAdjoint rw [MorphismProperty.inverseImage_iff] dsimp intro R hR rw [← ((adj.whiskerRight Cᵒᵖ).homEquiv P R).comp_bijective] convert (((adj.whiskerRight Cᵒᵖ).homEquiv Q R).trans (hf.homEquiv (R ⋙ F) ((sheafCompose J F).obj ⟨R, hR⟩).cond)).bijective ext g X dsimp [Adjunction.whiskerRight, Adjunction.mkOfUnitCounit] simp instance [G.IsLeftAdjoint] : J.PreservesSheafification G := preservesSheafification_of_adjunction J (Adjunction.ofIsLeftAdjoint G) section ForgetToType variable [ConcreteCategory D] [HasSheafCompose J (forget D)] abbrev composeAndSheafifyFromTypes (G : Type max v u ⥤ D) : SheafOfTypes J ⥤ Sheaf J D := (sheafEquivSheafOfTypes J).inverse ⋙ composeAndSheafify _ G set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_and_sheafify_from_types CategoryTheory.Sheaf.composeAndSheafifyFromTypes def adjunctionToTypes {G : Type max v u ⥤ D} (adj : G ⊣ forget D) : composeAndSheafifyFromTypes J G ⊣ sheafForget J := (sheafEquivSheafOfTypes J).symm.toAdjunction.comp (adjunction J adj) set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction_to_types CategoryTheory.Sheaf.adjunctionToTypes @[simp]
Mathlib/CategoryTheory/Sites/Adjunction.lean
136
143
theorem adjunctionToTypes_unit_app_val {G : Type max v u ⥤ D} (adj : G ⊣ forget D) (Y : SheafOfTypes J) : ((adjunctionToTypes J adj).unit.app Y).val = (adj.whiskerRight _).unit.app ((sheafOfTypesToPresheaf J).obj Y) ≫ whiskerRight (toSheafify J _) (forget D) := by
dsimp [adjunctionToTypes, Adjunction.comp] simp rfl
300
import Mathlib.CategoryTheory.Adjunction.Whiskering import Mathlib.CategoryTheory.Sites.PreservesSheafification #align_import category_theory.sites.adjunction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace CategoryTheory open GrothendieckTopology CategoryTheory Limits Opposite universe v u variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) variable {D : Type*} [Category D] variable {E : Type*} [Category E] variable {F : D ⥤ E} {G : E ⥤ D} variable [HasWeakSheafify J D] abbrev sheafForget [ConcreteCategory D] [HasSheafCompose J (forget D)] : Sheaf J D ⥤ SheafOfTypes J := sheafCompose J (forget D) ⋙ (sheafEquivSheafOfTypes J).functor set_option linter.uppercaseLean3 false in #align category_theory.Sheaf_forget CategoryTheory.sheafForget namespace Sheaf noncomputable section @[simps] def composeEquiv [HasSheafCompose J F] (adj : G ⊣ F) (X : Sheaf J E) (Y : Sheaf J D) : ((composeAndSheafify J G).obj X ⟶ Y) ≃ (X ⟶ (sheafCompose J F).obj Y) := let A := adj.whiskerRight Cᵒᵖ { toFun := fun η => ⟨A.homEquiv _ _ (toSheafify J _ ≫ η.val)⟩ invFun := fun γ => ⟨sheafifyLift J ((A.homEquiv _ _).symm ((sheafToPresheaf _ _).map γ)) Y.2⟩ left_inv := by intro η ext1 dsimp symm apply sheafifyLift_unique rw [Equiv.symm_apply_apply] right_inv := by intro γ ext1 dsimp -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [toSheafify_sheafifyLift, Equiv.apply_symm_apply] } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_equiv CategoryTheory.Sheaf.composeEquiv -- These lemmas have always been bad (#7657), but leanprover/lean4#2644 made `simp` start noticing attribute [nolint simpNF] CategoryTheory.Sheaf.composeEquiv_apply_val CategoryTheory.Sheaf.composeEquiv_symm_apply_val @[simps! unit_app_val counit_app_val] def adjunction [HasSheafCompose J F] (adj : G ⊣ F) : composeAndSheafify J G ⊣ sheafCompose J F := Adjunction.mkOfHomEquiv { homEquiv := composeEquiv J adj homEquiv_naturality_left_symm := fun f g => by ext1 dsimp [composeEquiv] rw [sheafifyMap_sheafifyLift] erw [Adjunction.homEquiv_naturality_left_symm] rw [whiskeringRight_obj_map] rfl homEquiv_naturality_right := fun f g => by ext dsimp [composeEquiv] erw [Adjunction.homEquiv_unit, Adjunction.homEquiv_unit] dsimp simp } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction CategoryTheory.Sheaf.adjunction instance [F.IsRightAdjoint] : (sheafCompose J F).IsRightAdjoint := (adjunction J (Adjunction.ofIsRightAdjoint F)).isRightAdjoint instance [G.IsLeftAdjoint] : (composeAndSheafify J G).IsLeftAdjoint := (adjunction J (Adjunction.ofIsLeftAdjoint G)).isLeftAdjoint lemma preservesSheafification_of_adjunction (adj : G ⊣ F) : J.PreservesSheafification G where le P Q f hf := by have := adj.isRightAdjoint rw [MorphismProperty.inverseImage_iff] dsimp intro R hR rw [← ((adj.whiskerRight Cᵒᵖ).homEquiv P R).comp_bijective] convert (((adj.whiskerRight Cᵒᵖ).homEquiv Q R).trans (hf.homEquiv (R ⋙ F) ((sheafCompose J F).obj ⟨R, hR⟩).cond)).bijective ext g X dsimp [Adjunction.whiskerRight, Adjunction.mkOfUnitCounit] simp instance [G.IsLeftAdjoint] : J.PreservesSheafification G := preservesSheafification_of_adjunction J (Adjunction.ofIsLeftAdjoint G) section ForgetToType variable [ConcreteCategory D] [HasSheafCompose J (forget D)] abbrev composeAndSheafifyFromTypes (G : Type max v u ⥤ D) : SheafOfTypes J ⥤ Sheaf J D := (sheafEquivSheafOfTypes J).inverse ⋙ composeAndSheafify _ G set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_and_sheafify_from_types CategoryTheory.Sheaf.composeAndSheafifyFromTypes def adjunctionToTypes {G : Type max v u ⥤ D} (adj : G ⊣ forget D) : composeAndSheafifyFromTypes J G ⊣ sheafForget J := (sheafEquivSheafOfTypes J).symm.toAdjunction.comp (adjunction J adj) set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction_to_types CategoryTheory.Sheaf.adjunctionToTypes @[simp] theorem adjunctionToTypes_unit_app_val {G : Type max v u ⥤ D} (adj : G ⊣ forget D) (Y : SheafOfTypes J) : ((adjunctionToTypes J adj).unit.app Y).val = (adj.whiskerRight _).unit.app ((sheafOfTypesToPresheaf J).obj Y) ≫ whiskerRight (toSheafify J _) (forget D) := by dsimp [adjunctionToTypes, Adjunction.comp] simp rfl set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction_to_types_unit_app_val CategoryTheory.Sheaf.adjunctionToTypes_unit_app_val @[simp]
Mathlib/CategoryTheory/Sites/Adjunction.lean
148
160
theorem adjunctionToTypes_counit_app_val {G : Type max v u ⥤ D} (adj : G ⊣ forget D) (X : Sheaf J D) : ((adjunctionToTypes J adj).counit.app X).val = sheafifyLift J ((Functor.associator _ _ _).hom ≫ (adj.whiskerRight _).counit.app _) X.2 := by
apply sheafifyLift_unique dsimp only [adjunctionToTypes, Adjunction.comp, NatTrans.comp_app, instCategorySheaf_comp_val, instCategorySheaf_id_val] rw [adjunction_counit_app_val] erw [Category.id_comp, sheafifyMap_sheafifyLift, toSheafify_sheafifyLift] ext dsimp [sheafEquivSheafOfTypes, Equivalence.symm, Equivalence.toAdjunction, NatIso.ofComponents, Adjunction.whiskerRight, Adjunction.mkOfUnitCounit] simp
300
import Batteries.Data.List.Lemmas namespace List universe u v variable {α : Type u} {β : Type v} @[simp] theorem eraseIdx_zero (l : List α) : eraseIdx l 0 = tail l := by cases l <;> rfl theorem eraseIdx_eq_take_drop_succ : ∀ (l : List α) (i : Nat), l.eraseIdx i = l.take i ++ l.drop (i + 1) | nil, _ => by simp | a::l, 0 => by simp | a::l, i + 1 => by simp [eraseIdx_eq_take_drop_succ l i] theorem eraseIdx_sublist : ∀ (l : List α) (k : Nat), eraseIdx l k <+ l | [], _ => by simp | a::l, 0 => by simp | a::l, k + 1 => by simp [eraseIdx_sublist l k] theorem eraseIdx_subset (l : List α) (k : Nat) : eraseIdx l k ⊆ l := (eraseIdx_sublist l k).subset @[simp] theorem eraseIdx_eq_self : ∀ {l : List α} {k : Nat}, eraseIdx l k = l ↔ length l ≤ k | [], _ => by simp | a::l, 0 => by simp [(cons_ne_self _ _).symm] | a::l, k + 1 => by simp [eraseIdx_eq_self] alias ⟨_, eraseIdx_of_length_le⟩ := eraseIdx_eq_self
.lake/packages/batteries/Batteries/Data/List/EraseIdx.lean
43
47
theorem eraseIdx_append_of_lt_length {l : List α} {k : Nat} (hk : k < length l) (l' : List α) : eraseIdx (l ++ l') k = eraseIdx l k ++ l' := by
rw [eraseIdx_eq_take_drop_succ, take_append_of_le_length, drop_append_of_le_length, eraseIdx_eq_take_drop_succ, append_assoc] all_goals omega
301
import Batteries.Data.List.Lemmas namespace List universe u v variable {α : Type u} {β : Type v} @[simp] theorem eraseIdx_zero (l : List α) : eraseIdx l 0 = tail l := by cases l <;> rfl theorem eraseIdx_eq_take_drop_succ : ∀ (l : List α) (i : Nat), l.eraseIdx i = l.take i ++ l.drop (i + 1) | nil, _ => by simp | a::l, 0 => by simp | a::l, i + 1 => by simp [eraseIdx_eq_take_drop_succ l i] theorem eraseIdx_sublist : ∀ (l : List α) (k : Nat), eraseIdx l k <+ l | [], _ => by simp | a::l, 0 => by simp | a::l, k + 1 => by simp [eraseIdx_sublist l k] theorem eraseIdx_subset (l : List α) (k : Nat) : eraseIdx l k ⊆ l := (eraseIdx_sublist l k).subset @[simp] theorem eraseIdx_eq_self : ∀ {l : List α} {k : Nat}, eraseIdx l k = l ↔ length l ≤ k | [], _ => by simp | a::l, 0 => by simp [(cons_ne_self _ _).symm] | a::l, k + 1 => by simp [eraseIdx_eq_self] alias ⟨_, eraseIdx_of_length_le⟩ := eraseIdx_eq_self theorem eraseIdx_append_of_lt_length {l : List α} {k : Nat} (hk : k < length l) (l' : List α) : eraseIdx (l ++ l') k = eraseIdx l k ++ l' := by rw [eraseIdx_eq_take_drop_succ, take_append_of_le_length, drop_append_of_le_length, eraseIdx_eq_take_drop_succ, append_assoc] all_goals omega
.lake/packages/batteries/Batteries/Data/List/EraseIdx.lean
49
55
theorem eraseIdx_append_of_length_le {l : List α} {k : Nat} (hk : length l ≤ k) (l' : List α) : eraseIdx (l ++ l') k = l ++ eraseIdx l' (k - length l) := by
rw [eraseIdx_eq_take_drop_succ, eraseIdx_eq_take_drop_succ, take_append_eq_append_take, drop_append_eq_append_drop, take_all_of_le hk, drop_eq_nil_of_le (by omega), nil_append, append_assoc] congr omega
301
import Batteries.Data.List.Lemmas namespace List universe u v variable {α : Type u} {β : Type v} @[simp] theorem eraseIdx_zero (l : List α) : eraseIdx l 0 = tail l := by cases l <;> rfl theorem eraseIdx_eq_take_drop_succ : ∀ (l : List α) (i : Nat), l.eraseIdx i = l.take i ++ l.drop (i + 1) | nil, _ => by simp | a::l, 0 => by simp | a::l, i + 1 => by simp [eraseIdx_eq_take_drop_succ l i] theorem eraseIdx_sublist : ∀ (l : List α) (k : Nat), eraseIdx l k <+ l | [], _ => by simp | a::l, 0 => by simp | a::l, k + 1 => by simp [eraseIdx_sublist l k] theorem eraseIdx_subset (l : List α) (k : Nat) : eraseIdx l k ⊆ l := (eraseIdx_sublist l k).subset @[simp] theorem eraseIdx_eq_self : ∀ {l : List α} {k : Nat}, eraseIdx l k = l ↔ length l ≤ k | [], _ => by simp | a::l, 0 => by simp [(cons_ne_self _ _).symm] | a::l, k + 1 => by simp [eraseIdx_eq_self] alias ⟨_, eraseIdx_of_length_le⟩ := eraseIdx_eq_self theorem eraseIdx_append_of_lt_length {l : List α} {k : Nat} (hk : k < length l) (l' : List α) : eraseIdx (l ++ l') k = eraseIdx l k ++ l' := by rw [eraseIdx_eq_take_drop_succ, take_append_of_le_length, drop_append_of_le_length, eraseIdx_eq_take_drop_succ, append_assoc] all_goals omega theorem eraseIdx_append_of_length_le {l : List α} {k : Nat} (hk : length l ≤ k) (l' : List α) : eraseIdx (l ++ l') k = l ++ eraseIdx l' (k - length l) := by rw [eraseIdx_eq_take_drop_succ, eraseIdx_eq_take_drop_succ, take_append_eq_append_take, drop_append_eq_append_drop, take_all_of_le hk, drop_eq_nil_of_le (by omega), nil_append, append_assoc] congr omega protected theorem IsPrefix.eraseIdx {l l' : List α} (h : l <+: l') (k : Nat) : eraseIdx l k <+: eraseIdx l' k := by rcases h with ⟨t, rfl⟩ if hkl : k < length l then simp [eraseIdx_append_of_lt_length hkl] else rw [Nat.not_lt] at hkl simp [eraseIdx_append_of_length_le hkl, eraseIdx_of_length_le hkl] theorem mem_eraseIdx_iff_get {x : α} : ∀ {l} {k}, x ∈ eraseIdx l k ↔ ∃ i : Fin l.length, ↑i ≠ k ∧ l.get i = x | [], _ => by simp only [eraseIdx, Fin.exists_iff, not_mem_nil, false_iff] rintro ⟨i, h, -⟩ exact Nat.not_lt_zero _ h | a::l, 0 => by simp [Fin.exists_fin_succ, mem_iff_get] | a::l, k+1 => by simp [Fin.exists_fin_succ, mem_eraseIdx_iff_get, @eq_comm _ a, k.succ_ne_zero.symm]
.lake/packages/batteries/Batteries/Data/List/EraseIdx.lean
76
80
theorem mem_eraseIdx_iff_get? {x : α} {l} {k} : x ∈ eraseIdx l k ↔ ∃ i ≠ k, l.get? i = x := by
simp only [mem_eraseIdx_iff_get, Fin.exists_iff, exists_and_left, get_eq_iff, exists_prop] refine exists_congr fun i => and_congr_right' <| and_iff_right_of_imp fun h => ?_ obtain ⟨h, -⟩ := get?_eq_some.1 h exact h
301
import Mathlib.Init.Control.Combinators import Mathlib.Init.Function import Mathlib.Tactic.CasesM import Mathlib.Tactic.Attr.Core #align_import control.basic from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" universe u v w variable {α β γ : Type u} section Applicative variable {F : Type u → Type v} [Applicative F] def zipWithM {α₁ α₂ φ : Type u} (f : α₁ → α₂ → F φ) : ∀ (_ : List α₁) (_ : List α₂), F (List φ) | x :: xs, y :: ys => (· :: ·) <$> f x y <*> zipWithM f xs ys | _, _ => pure [] #align mzip_with zipWithM def zipWithM' (f : α → β → F γ) : List α → List β → F PUnit | x :: xs, y :: ys => f x y *> zipWithM' f xs ys | [], _ => pure PUnit.unit | _, [] => pure PUnit.unit #align mzip_with' zipWithM' variable [LawfulApplicative F] @[simp] theorem pure_id'_seq (x : F α) : (pure fun x => x) <*> x = x := pure_id_seq x #align pure_id'_seq pure_id'_seq @[functor_norm]
Mathlib/Control/Basic.lean
60
64
theorem seq_map_assoc (x : F (α → β)) (f : γ → α) (y : F γ) : x <*> f <$> y = (· ∘ f) <$> x <*> y := by
simp only [← pure_seq] simp only [seq_assoc, Function.comp, seq_pure, ← comp_map] simp [pure_seq]
302
import Mathlib.Init.Control.Combinators import Mathlib.Init.Function import Mathlib.Tactic.CasesM import Mathlib.Tactic.Attr.Core #align_import control.basic from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" universe u v w variable {α β γ : Type u} section Applicative variable {F : Type u → Type v} [Applicative F] def zipWithM {α₁ α₂ φ : Type u} (f : α₁ → α₂ → F φ) : ∀ (_ : List α₁) (_ : List α₂), F (List φ) | x :: xs, y :: ys => (· :: ·) <$> f x y <*> zipWithM f xs ys | _, _ => pure [] #align mzip_with zipWithM def zipWithM' (f : α → β → F γ) : List α → List β → F PUnit | x :: xs, y :: ys => f x y *> zipWithM' f xs ys | [], _ => pure PUnit.unit | _, [] => pure PUnit.unit #align mzip_with' zipWithM' variable [LawfulApplicative F] @[simp] theorem pure_id'_seq (x : F α) : (pure fun x => x) <*> x = x := pure_id_seq x #align pure_id'_seq pure_id'_seq @[functor_norm] theorem seq_map_assoc (x : F (α → β)) (f : γ → α) (y : F γ) : x <*> f <$> y = (· ∘ f) <$> x <*> y := by simp only [← pure_seq] simp only [seq_assoc, Function.comp, seq_pure, ← comp_map] simp [pure_seq] #align seq_map_assoc seq_map_assoc @[functor_norm]
Mathlib/Control/Basic.lean
68
70
theorem map_seq (f : β → γ) (x : F (α → β)) (y : F α) : f <$> (x <*> y) = (f ∘ ·) <$> x <*> y := by
simp only [← pure_seq]; simp [seq_assoc]
302
import Mathlib.Init.Control.Combinators import Mathlib.Init.Function import Mathlib.Tactic.CasesM import Mathlib.Tactic.Attr.Core #align_import control.basic from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" universe u v w variable {α β γ : Type u} section Monad variable {m : Type u → Type v} [Monad m] [LawfulMonad m] open List #align list.mpartition List.partitionM
Mathlib/Control/Basic.lean
83
85
theorem map_bind (x : m α) {g : α → m β} {f : β → γ} : f <$> (x >>= g) = x >>= fun a => f <$> g a := by
rw [← bind_pure_comp, bind_assoc]; simp [bind_pure_comp]
302
import Mathlib.AlgebraicTopology.FundamentalGroupoid.FundamentalGroup import Mathlib.GroupTheory.EckmannHilton import Mathlib.Logic.Equiv.TransferInstance import Mathlib.Algebra.Group.Ext #align_import topology.homotopy.homotopy_group from "leanprover-community/mathlib"@"4c3e1721c58ef9087bbc2c8c38b540f70eda2e53" open scoped unitInterval Topology open Homeomorph noncomputable section scoped[Topology] notation "I^" N => N → I namespace Cube def boundary (N : Type*) : Set (I^N) := {y | ∃ i, y i = 0 ∨ y i = 1} #align cube.boundary Cube.boundary variable {N : Type*} [DecidableEq N] abbrev splitAt (i : N) : (I^N) ≃ₜ I × I^{ j // j ≠ i } := funSplitAt I i #align cube.split_at Cube.splitAt abbrev insertAt (i : N) : (I × I^{ j // j ≠ i }) ≃ₜ I^N := (funSplitAt I i).symm #align cube.insert_at Cube.insertAt
Mathlib/Topology/Homotopy/HomotopyGroup.lean
74
78
theorem insertAt_boundary (i : N) {t₀ : I} {t} (H : (t₀ = 0 ∨ t₀ = 1) ∨ t ∈ boundary { j // j ≠ i }) : insertAt i ⟨t₀, t⟩ ∈ boundary N := by
obtain H | ⟨j, H⟩ := H · use i; rwa [funSplitAt_symm_apply, dif_pos rfl] · use j; rwa [funSplitAt_symm_apply, dif_neg j.prop, Subtype.coe_eta]
303
import Mathlib.Data.Fin.VecNotation import Mathlib.SetTheory.Cardinal.Basic #align_import model_theory.basic from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768" set_option autoImplicit true universe u v u' v' w w' open Cardinal open Cardinal namespace FirstOrder -- intended to be used with explicit universe parameters @[nolint checkUnivs] structure Language where Functions : ℕ → Type u Relations : ℕ → Type v #align first_order.language FirstOrder.Language --@[simp] def Sequence₂ (a₀ a₁ a₂ : Type u) : ℕ → Type u | 0 => a₀ | 1 => a₁ | 2 => a₂ | _ => PEmpty #align first_order.sequence₂ FirstOrder.Sequence₂ namespace Sequence₂ variable (a₀ a₁ a₂ : Type u) instance inhabited₀ [h : Inhabited a₀] : Inhabited (Sequence₂ a₀ a₁ a₂ 0) := h #align first_order.sequence₂.inhabited₀ FirstOrder.Sequence₂.inhabited₀ instance inhabited₁ [h : Inhabited a₁] : Inhabited (Sequence₂ a₀ a₁ a₂ 1) := h #align first_order.sequence₂.inhabited₁ FirstOrder.Sequence₂.inhabited₁ instance inhabited₂ [h : Inhabited a₂] : Inhabited (Sequence₂ a₀ a₁ a₂ 2) := h #align first_order.sequence₂.inhabited₂ FirstOrder.Sequence₂.inhabited₂ instance {n : ℕ} : IsEmpty (Sequence₂ a₀ a₁ a₂ (n + 3)) := inferInstanceAs (IsEmpty PEmpty) @[simp]
Mathlib/ModelTheory/Basic.lean
95
100
theorem lift_mk {i : ℕ} : Cardinal.lift.{v,u} #(Sequence₂ a₀ a₁ a₂ i) = #(Sequence₂ (ULift.{v,u} a₀) (ULift.{v,u} a₁) (ULift.{v,u} a₂) i) := by
rcases i with (_ | _ | _ | i) <;> simp only [Sequence₂, mk_uLift, Nat.succ_ne_zero, IsEmpty.forall_iff, Nat.succ.injEq, add_eq_zero, OfNat.ofNat_ne_zero, and_false, one_ne_zero, mk_eq_zero, lift_zero]
304
import Mathlib.Data.Fin.VecNotation import Mathlib.SetTheory.Cardinal.Basic #align_import model_theory.basic from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768" set_option autoImplicit true universe u v u' v' w w' open Cardinal open Cardinal namespace FirstOrder -- intended to be used with explicit universe parameters @[nolint checkUnivs] structure Language where Functions : ℕ → Type u Relations : ℕ → Type v #align first_order.language FirstOrder.Language --@[simp] def Sequence₂ (a₀ a₁ a₂ : Type u) : ℕ → Type u | 0 => a₀ | 1 => a₁ | 2 => a₂ | _ => PEmpty #align first_order.sequence₂ FirstOrder.Sequence₂ namespace Sequence₂ variable (a₀ a₁ a₂ : Type u) instance inhabited₀ [h : Inhabited a₀] : Inhabited (Sequence₂ a₀ a₁ a₂ 0) := h #align first_order.sequence₂.inhabited₀ FirstOrder.Sequence₂.inhabited₀ instance inhabited₁ [h : Inhabited a₁] : Inhabited (Sequence₂ a₀ a₁ a₂ 1) := h #align first_order.sequence₂.inhabited₁ FirstOrder.Sequence₂.inhabited₁ instance inhabited₂ [h : Inhabited a₂] : Inhabited (Sequence₂ a₀ a₁ a₂ 2) := h #align first_order.sequence₂.inhabited₂ FirstOrder.Sequence₂.inhabited₂ instance {n : ℕ} : IsEmpty (Sequence₂ a₀ a₁ a₂ (n + 3)) := inferInstanceAs (IsEmpty PEmpty) @[simp] theorem lift_mk {i : ℕ} : Cardinal.lift.{v,u} #(Sequence₂ a₀ a₁ a₂ i) = #(Sequence₂ (ULift.{v,u} a₀) (ULift.{v,u} a₁) (ULift.{v,u} a₂) i) := by rcases i with (_ | _ | _ | i) <;> simp only [Sequence₂, mk_uLift, Nat.succ_ne_zero, IsEmpty.forall_iff, Nat.succ.injEq, add_eq_zero, OfNat.ofNat_ne_zero, and_false, one_ne_zero, mk_eq_zero, lift_zero] #align first_order.sequence₂.lift_mk FirstOrder.Sequence₂.lift_mk @[simp]
Mathlib/ModelTheory/Basic.lean
104
106
theorem sum_card : Cardinal.sum (fun i => #(Sequence₂ a₀ a₁ a₂ i)) = #a₀ + #a₁ + #a₂ := by
rw [sum_nat_eq_add_sum_succ, sum_nat_eq_add_sum_succ, sum_nat_eq_add_sum_succ] simp [add_assoc, Sequence₂]
304
import Mathlib.Data.Fin.VecNotation import Mathlib.SetTheory.Cardinal.Basic #align_import model_theory.basic from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768" set_option autoImplicit true universe u v u' v' w w' open Cardinal open Cardinal namespace FirstOrder -- intended to be used with explicit universe parameters @[nolint checkUnivs] structure Language where Functions : ℕ → Type u Relations : ℕ → Type v #align first_order.language FirstOrder.Language --@[simp] def Sequence₂ (a₀ a₁ a₂ : Type u) : ℕ → Type u | 0 => a₀ | 1 => a₁ | 2 => a₂ | _ => PEmpty #align first_order.sequence₂ FirstOrder.Sequence₂ namespace Language @[simps] protected def mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : Language := ⟨Sequence₂ c f₁ f₂, Sequence₂ PEmpty r₁ r₂⟩ #align first_order.language.mk₂ FirstOrder.Language.mk₂ protected def empty : Language := ⟨fun _ => Empty, fun _ => Empty⟩ #align first_order.language.empty FirstOrder.Language.empty instance : Inhabited Language := ⟨Language.empty⟩ protected def sum (L : Language.{u, v}) (L' : Language.{u', v'}) : Language := ⟨fun n => Sum (L.Functions n) (L'.Functions n), fun n => Sum (L.Relations n) (L'.Relations n)⟩ #align first_order.language.sum FirstOrder.Language.sum variable (L : Language.{u, v}) -- Porting note(#5171): this linter isn't ported yet. -- @[nolint has_nonempty_instance] protected def Constants := L.Functions 0 #align first_order.language.constants FirstOrder.Language.Constants @[simp] theorem constants_mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : (Language.mk₂ c f₁ f₂ r₁ r₂).Constants = c := rfl #align first_order.language.constants_mk₂ FirstOrder.Language.constants_mk₂ -- Porting note(#5171): this linter isn't ported yet. -- @[nolint has_nonempty_instance] def Symbols := Sum (Σl, L.Functions l) (Σl, L.Relations l) #align first_order.language.symbols FirstOrder.Language.Symbols def card : Cardinal := #L.Symbols #align first_order.language.card FirstOrder.Language.card class IsRelational : Prop where empty_functions : ∀ n, IsEmpty (L.Functions n) #align first_order.language.is_relational FirstOrder.Language.IsRelational class IsAlgebraic : Prop where empty_relations : ∀ n, IsEmpty (L.Relations n) #align first_order.language.is_algebraic FirstOrder.Language.IsAlgebraic variable {L} {L' : Language.{u', v'}}
Mathlib/ModelTheory/Basic.lean
174
178
theorem card_eq_card_functions_add_card_relations : L.card = (Cardinal.sum fun l => Cardinal.lift.{v} #(L.Functions l)) + Cardinal.sum fun l => Cardinal.lift.{u} #(L.Relations l) := by
simp [card, Symbols]
304
import Mathlib.ModelTheory.Basic #align_import model_theory.language_map from "leanprover-community/mathlib"@"b3951c65c6e797ff162ae8b69eab0063bcfb3d73" universe u v u' v' w w' namespace FirstOrder set_option linter.uppercaseLean3 false namespace Language open Structure Cardinal open Cardinal variable (L : Language.{u, v}) (L' : Language.{u', v'}) {M : Type w} [L.Structure M] structure LHom where onFunction : ∀ ⦃n⦄, L.Functions n → L'.Functions n onRelation : ∀ ⦃n⦄, L.Relations n → L'.Relations n #align first_order.language.Lhom FirstOrder.Language.LHom @[inherit_doc FirstOrder.Language.LHom] infixl:10 " →ᴸ " => LHom -- \^L variable {L L'} namespace LHom protected def mk₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} (φ₀ : c → L'.Constants) (φ₁ : f₁ → L'.Functions 1) (φ₂ : f₂ → L'.Functions 2) (φ₁' : r₁ → L'.Relations 1) (φ₂' : r₂ → L'.Relations 2) : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L' := ⟨fun n => Nat.casesOn n φ₀ fun n => Nat.casesOn n φ₁ fun n => Nat.casesOn n φ₂ fun _ => PEmpty.elim, fun n => Nat.casesOn n PEmpty.elim fun n => Nat.casesOn n φ₁' fun n => Nat.casesOn n φ₂' fun _ => PEmpty.elim⟩ #align first_order.language.Lhom.mk₂ FirstOrder.Language.LHom.mk₂ variable (ϕ : L →ᴸ L') def reduct (M : Type*) [L'.Structure M] : L.Structure M where funMap f xs := funMap (ϕ.onFunction f) xs RelMap r xs := RelMap (ϕ.onRelation r) xs #align first_order.language.Lhom.reduct FirstOrder.Language.LHom.reduct @[simps] protected def id (L : Language) : L →ᴸ L := ⟨fun _n => id, fun _n => id⟩ #align first_order.language.Lhom.id FirstOrder.Language.LHom.id instance : Inhabited (L →ᴸ L) := ⟨LHom.id L⟩ @[simps] protected def sumInl : L →ᴸ L.sum L' := ⟨fun _n => Sum.inl, fun _n => Sum.inl⟩ #align first_order.language.Lhom.sum_inl FirstOrder.Language.LHom.sumInl @[simps] protected def sumInr : L' →ᴸ L.sum L' := ⟨fun _n => Sum.inr, fun _n => Sum.inr⟩ #align first_order.language.Lhom.sum_inr FirstOrder.Language.LHom.sumInr variable (L L') @[simps] protected def ofIsEmpty [L.IsAlgebraic] [L.IsRelational] : L →ᴸ L' := ⟨fun n => (IsRelational.empty_functions n).elim, fun n => (IsAlgebraic.empty_relations n).elim⟩ #align first_order.language.Lhom.of_is_empty FirstOrder.Language.LHom.ofIsEmpty variable {L L'} {L'' : Language} @[ext] protected theorem funext {F G : L →ᴸ L'} (h_fun : F.onFunction = G.onFunction) (h_rel : F.onRelation = G.onRelation) : F = G := by cases' F with Ff Fr cases' G with Gf Gr simp only [mk.injEq] exact And.intro h_fun h_rel #align first_order.language.Lhom.funext FirstOrder.Language.LHom.funext instance [L.IsAlgebraic] [L.IsRelational] : Unique (L →ᴸ L') := ⟨⟨LHom.ofIsEmpty L L'⟩, fun _ => LHom.funext (Subsingleton.elim _ _) (Subsingleton.elim _ _)⟩ theorem mk₂_funext {c f₁ f₂ : Type u} {r₁ r₂ : Type v} {F G : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L'} (h0 : ∀ c : (Language.mk₂ c f₁ f₂ r₁ r₂).Constants, F.onFunction c = G.onFunction c) (h1 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 1, F.onFunction f = G.onFunction f) (h2 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 2, F.onFunction f = G.onFunction f) (h1' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 1, F.onRelation r = G.onRelation r) (h2' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 2, F.onRelation r = G.onRelation r) : F = G := LHom.funext (funext fun n => Nat.casesOn n (funext h0) fun n => Nat.casesOn n (funext h1) fun n => Nat.casesOn n (funext h2) fun _n => funext fun f => PEmpty.elim f) (funext fun n => Nat.casesOn n (funext fun r => PEmpty.elim r) fun n => Nat.casesOn n (funext h1') fun n => Nat.casesOn n (funext h2') fun _n => funext fun r => PEmpty.elim r) #align first_order.language.Lhom.mk₂_funext FirstOrder.Language.LHom.mk₂_funext @[simps] def comp (g : L' →ᴸ L'') (f : L →ᴸ L') : L →ᴸ L'' := ⟨fun _n F => g.1 (f.1 F), fun _ R => g.2 (f.2 R)⟩ #align first_order.language.Lhom.comp FirstOrder.Language.LHom.comp -- Porting note: added ᴸ to avoid clash with function composition @[inherit_doc] local infixl:60 " ∘ᴸ " => LHom.comp @[simp]
Mathlib/ModelTheory/LanguageMap.lean
153
155
theorem id_comp (F : L →ᴸ L') : LHom.id L' ∘ᴸ F = F := by
cases F rfl
305
import Mathlib.ModelTheory.Basic #align_import model_theory.language_map from "leanprover-community/mathlib"@"b3951c65c6e797ff162ae8b69eab0063bcfb3d73" universe u v u' v' w w' namespace FirstOrder set_option linter.uppercaseLean3 false namespace Language open Structure Cardinal open Cardinal variable (L : Language.{u, v}) (L' : Language.{u', v'}) {M : Type w} [L.Structure M] structure LHom where onFunction : ∀ ⦃n⦄, L.Functions n → L'.Functions n onRelation : ∀ ⦃n⦄, L.Relations n → L'.Relations n #align first_order.language.Lhom FirstOrder.Language.LHom @[inherit_doc FirstOrder.Language.LHom] infixl:10 " →ᴸ " => LHom -- \^L variable {L L'} namespace LHom protected def mk₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} (φ₀ : c → L'.Constants) (φ₁ : f₁ → L'.Functions 1) (φ₂ : f₂ → L'.Functions 2) (φ₁' : r₁ → L'.Relations 1) (φ₂' : r₂ → L'.Relations 2) : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L' := ⟨fun n => Nat.casesOn n φ₀ fun n => Nat.casesOn n φ₁ fun n => Nat.casesOn n φ₂ fun _ => PEmpty.elim, fun n => Nat.casesOn n PEmpty.elim fun n => Nat.casesOn n φ₁' fun n => Nat.casesOn n φ₂' fun _ => PEmpty.elim⟩ #align first_order.language.Lhom.mk₂ FirstOrder.Language.LHom.mk₂ variable (ϕ : L →ᴸ L') def reduct (M : Type*) [L'.Structure M] : L.Structure M where funMap f xs := funMap (ϕ.onFunction f) xs RelMap r xs := RelMap (ϕ.onRelation r) xs #align first_order.language.Lhom.reduct FirstOrder.Language.LHom.reduct @[simps] protected def id (L : Language) : L →ᴸ L := ⟨fun _n => id, fun _n => id⟩ #align first_order.language.Lhom.id FirstOrder.Language.LHom.id instance : Inhabited (L →ᴸ L) := ⟨LHom.id L⟩ @[simps] protected def sumInl : L →ᴸ L.sum L' := ⟨fun _n => Sum.inl, fun _n => Sum.inl⟩ #align first_order.language.Lhom.sum_inl FirstOrder.Language.LHom.sumInl @[simps] protected def sumInr : L' →ᴸ L.sum L' := ⟨fun _n => Sum.inr, fun _n => Sum.inr⟩ #align first_order.language.Lhom.sum_inr FirstOrder.Language.LHom.sumInr variable (L L') @[simps] protected def ofIsEmpty [L.IsAlgebraic] [L.IsRelational] : L →ᴸ L' := ⟨fun n => (IsRelational.empty_functions n).elim, fun n => (IsAlgebraic.empty_relations n).elim⟩ #align first_order.language.Lhom.of_is_empty FirstOrder.Language.LHom.ofIsEmpty variable {L L'} {L'' : Language} @[ext] protected theorem funext {F G : L →ᴸ L'} (h_fun : F.onFunction = G.onFunction) (h_rel : F.onRelation = G.onRelation) : F = G := by cases' F with Ff Fr cases' G with Gf Gr simp only [mk.injEq] exact And.intro h_fun h_rel #align first_order.language.Lhom.funext FirstOrder.Language.LHom.funext instance [L.IsAlgebraic] [L.IsRelational] : Unique (L →ᴸ L') := ⟨⟨LHom.ofIsEmpty L L'⟩, fun _ => LHom.funext (Subsingleton.elim _ _) (Subsingleton.elim _ _)⟩ theorem mk₂_funext {c f₁ f₂ : Type u} {r₁ r₂ : Type v} {F G : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L'} (h0 : ∀ c : (Language.mk₂ c f₁ f₂ r₁ r₂).Constants, F.onFunction c = G.onFunction c) (h1 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 1, F.onFunction f = G.onFunction f) (h2 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 2, F.onFunction f = G.onFunction f) (h1' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 1, F.onRelation r = G.onRelation r) (h2' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 2, F.onRelation r = G.onRelation r) : F = G := LHom.funext (funext fun n => Nat.casesOn n (funext h0) fun n => Nat.casesOn n (funext h1) fun n => Nat.casesOn n (funext h2) fun _n => funext fun f => PEmpty.elim f) (funext fun n => Nat.casesOn n (funext fun r => PEmpty.elim r) fun n => Nat.casesOn n (funext h1') fun n => Nat.casesOn n (funext h2') fun _n => funext fun r => PEmpty.elim r) #align first_order.language.Lhom.mk₂_funext FirstOrder.Language.LHom.mk₂_funext @[simps] def comp (g : L' →ᴸ L'') (f : L →ᴸ L') : L →ᴸ L'' := ⟨fun _n F => g.1 (f.1 F), fun _ R => g.2 (f.2 R)⟩ #align first_order.language.Lhom.comp FirstOrder.Language.LHom.comp -- Porting note: added ᴸ to avoid clash with function composition @[inherit_doc] local infixl:60 " ∘ᴸ " => LHom.comp @[simp] theorem id_comp (F : L →ᴸ L') : LHom.id L' ∘ᴸ F = F := by cases F rfl #align first_order.language.Lhom.id_comp FirstOrder.Language.LHom.id_comp @[simp]
Mathlib/ModelTheory/LanguageMap.lean
159
161
theorem comp_id (F : L →ᴸ L') : F ∘ᴸ LHom.id L = F := by
cases F rfl
305
import Mathlib.Algebra.BigOperators.Group.List import Mathlib.Algebra.Group.Action.Defs import Mathlib.Algebra.Group.Units #align_import algebra.free_monoid.basic from "leanprover-community/mathlib"@"657df4339ae6ceada048c8a2980fb10e393143ec" variable {α : Type*} {β : Type*} {γ : Type*} {M : Type*} [Monoid M] {N : Type*} [Monoid N] @[to_additive "Free nonabelian additive monoid over a given alphabet"] def FreeMonoid (α) := List α #align free_monoid FreeMonoid #align free_add_monoid FreeAddMonoid namespace FreeMonoid @[to_additive "The identity equivalence between `FreeAddMonoid α` and `List α`."] def toList : FreeMonoid α ≃ List α := Equiv.refl _ #align free_monoid.to_list FreeMonoid.toList #align free_add_monoid.to_list FreeAddMonoid.toList @[to_additive "The identity equivalence between `List α` and `FreeAddMonoid α`."] def ofList : List α ≃ FreeMonoid α := Equiv.refl _ #align free_monoid.of_list FreeMonoid.ofList #align free_add_monoid.of_list FreeAddMonoid.ofList @[to_additive (attr := simp)] theorem toList_symm : (@toList α).symm = ofList := rfl #align free_monoid.to_list_symm FreeMonoid.toList_symm #align free_add_monoid.to_list_symm FreeAddMonoid.toList_symm @[to_additive (attr := simp)] theorem ofList_symm : (@ofList α).symm = toList := rfl #align free_monoid.of_list_symm FreeMonoid.ofList_symm #align free_add_monoid.of_list_symm FreeAddMonoid.ofList_symm @[to_additive (attr := simp)] theorem toList_ofList (l : List α) : toList (ofList l) = l := rfl #align free_monoid.to_list_of_list FreeMonoid.toList_ofList #align free_add_monoid.to_list_of_list FreeAddMonoid.toList_ofList @[to_additive (attr := simp)] theorem ofList_toList (xs : FreeMonoid α) : ofList (toList xs) = xs := rfl #align free_monoid.of_list_to_list FreeMonoid.ofList_toList #align free_add_monoid.of_list_to_list FreeAddMonoid.ofList_toList @[to_additive (attr := simp)] theorem toList_comp_ofList : @toList α ∘ ofList = id := rfl #align free_monoid.to_list_comp_of_list FreeMonoid.toList_comp_ofList #align free_add_monoid.to_list_comp_of_list FreeAddMonoid.toList_comp_ofList @[to_additive (attr := simp)] theorem ofList_comp_toList : @ofList α ∘ toList = id := rfl #align free_monoid.of_list_comp_to_list FreeMonoid.ofList_comp_toList #align free_add_monoid.of_list_comp_to_list FreeAddMonoid.ofList_comp_toList @[to_additive] instance : CancelMonoid (FreeMonoid α) where one := ofList [] mul x y := ofList (toList x ++ toList y) mul_one := List.append_nil one_mul := List.nil_append mul_assoc := List.append_assoc mul_left_cancel _ _ _ := List.append_cancel_left mul_right_cancel _ _ _ := List.append_cancel_right @[to_additive] instance : Inhabited (FreeMonoid α) := ⟨1⟩ @[to_additive (attr := simp)] theorem toList_one : toList (1 : FreeMonoid α) = [] := rfl #align free_monoid.to_list_one FreeMonoid.toList_one #align free_add_monoid.to_list_zero FreeAddMonoid.toList_zero @[to_additive (attr := simp)] theorem ofList_nil : ofList ([] : List α) = 1 := rfl #align free_monoid.of_list_nil FreeMonoid.ofList_nil #align free_add_monoid.of_list_nil FreeAddMonoid.ofList_nil @[to_additive (attr := simp)] theorem toList_mul (xs ys : FreeMonoid α) : toList (xs * ys) = toList xs ++ toList ys := rfl #align free_monoid.to_list_mul FreeMonoid.toList_mul #align free_add_monoid.to_list_add FreeAddMonoid.toList_add @[to_additive (attr := simp)] theorem ofList_append (xs ys : List α) : ofList (xs ++ ys) = ofList xs * ofList ys := rfl #align free_monoid.of_list_append FreeMonoid.ofList_append #align free_add_monoid.of_list_append FreeAddMonoid.ofList_append @[to_additive (attr := simp)]
Mathlib/Algebra/FreeMonoid/Basic.lean
111
112
theorem toList_prod (xs : List (FreeMonoid α)) : toList xs.prod = (xs.map toList).join := by
induction xs <;> simp [*, List.join]
306
import Mathlib.Algebra.FreeMonoid.Basic #align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"a2d2e18906e2b62627646b5d5be856e6a642062f" variable {α : Type*} (p : α → Prop) [DecidablePred p] namespace FreeAddMonoid def countP : FreeAddMonoid α →+ ℕ where toFun := List.countP p map_zero' := List.countP_nil _ map_add' := List.countP_append _ #align free_add_monoid.countp FreeAddMonoid.countP
Mathlib/Algebra/FreeMonoid/Count.lean
31
32
theorem countP_of (x : α) : countP p (of x) = if p x = true then 1 else 0 := by
simp [countP, List.countP, List.countP.go]
307
import Mathlib.Algebra.FreeMonoid.Basic #align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"a2d2e18906e2b62627646b5d5be856e6a642062f" variable {α : Type*} (p : α → Prop) [DecidablePred p] namespace FreeAddMonoid def countP : FreeAddMonoid α →+ ℕ where toFun := List.countP p map_zero' := List.countP_nil _ map_add' := List.countP_append _ #align free_add_monoid.countp FreeAddMonoid.countP theorem countP_of (x : α) : countP p (of x) = if p x = true then 1 else 0 := by simp [countP, List.countP, List.countP.go] #align free_add_monoid.countp_of FreeAddMonoid.countP_of theorem countP_apply (l : FreeAddMonoid α) : countP p l = List.countP p l := rfl #align free_add_monoid.countp_apply FreeAddMonoid.countP_apply -- Porting note: was (x = ·) def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ := countP (· = x) #align free_add_monoid.count FreeAddMonoid.count
Mathlib/Algebra/FreeMonoid/Count.lean
43
45
theorem count_of [DecidableEq α] (x y : α) : count x (of y) = (Pi.single x 1 : α → ℕ) y := by
simp [Pi.single, Function.update, count, countP, List.countP, List.countP.go, Bool.beq_eq_decide_eq]
307
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
198
207
theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by
refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ · exact hι.elim fun i ↦ ⟨i, (S i).one_mem⟩ · rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive] theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ · exact hι.elim fun i ↦ ⟨i, (S i).one_mem⟩ · rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩ #align submonoid.mem_supr_of_directed Submonoid.mem_iSup_of_directed #align add_submonoid.mem_supr_of_directed AddSubmonoid.mem_iSup_of_directed @[to_additive] theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) : ((⨆ i, S i : Submonoid M) : Set M) = ⋃ i, S i := Set.ext fun x ↦ by simp [mem_iSup_of_directed hS] #align submonoid.coe_supr_of_directed Submonoid.coe_iSup_of_directed #align add_submonoid.coe_supr_of_directed AddSubmonoid.coe_iSup_of_directed @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
219
222
theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by
haveI : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk]
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive] theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ · exact hι.elim fun i ↦ ⟨i, (S i).one_mem⟩ · rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩ #align submonoid.mem_supr_of_directed Submonoid.mem_iSup_of_directed #align add_submonoid.mem_supr_of_directed AddSubmonoid.mem_iSup_of_directed @[to_additive] theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) : ((⨆ i, S i : Submonoid M) : Set M) = ⋃ i, S i := Set.ext fun x ↦ by simp [mem_iSup_of_directed hS] #align submonoid.coe_supr_of_directed Submonoid.coe_iSup_of_directed #align add_submonoid.coe_supr_of_directed AddSubmonoid.coe_iSup_of_directed @[to_additive] theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by haveI : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk] #align submonoid.mem_Sup_of_directed_on Submonoid.mem_sSup_of_directedOn #align add_submonoid.mem_Sup_of_directed_on AddSubmonoid.mem_sSup_of_directedOn @[to_additive] theorem coe_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s := Set.ext fun x => by simp [mem_sSup_of_directedOn Sne hS] #align submonoid.coe_Sup_of_directed_on Submonoid.coe_sSup_of_directedOn #align add_submonoid.coe_Sup_of_directed_on AddSubmonoid.coe_sSup_of_directedOn @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
234
236
theorem mem_sup_left {S T : Submonoid M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T := by
rw [← SetLike.le_def] exact le_sup_left
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive] theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ · exact hι.elim fun i ↦ ⟨i, (S i).one_mem⟩ · rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩ #align submonoid.mem_supr_of_directed Submonoid.mem_iSup_of_directed #align add_submonoid.mem_supr_of_directed AddSubmonoid.mem_iSup_of_directed @[to_additive] theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) : ((⨆ i, S i : Submonoid M) : Set M) = ⋃ i, S i := Set.ext fun x ↦ by simp [mem_iSup_of_directed hS] #align submonoid.coe_supr_of_directed Submonoid.coe_iSup_of_directed #align add_submonoid.coe_supr_of_directed AddSubmonoid.coe_iSup_of_directed @[to_additive] theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by haveI : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk] #align submonoid.mem_Sup_of_directed_on Submonoid.mem_sSup_of_directedOn #align add_submonoid.mem_Sup_of_directed_on AddSubmonoid.mem_sSup_of_directedOn @[to_additive] theorem coe_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s := Set.ext fun x => by simp [mem_sSup_of_directedOn Sne hS] #align submonoid.coe_Sup_of_directed_on Submonoid.coe_sSup_of_directedOn #align add_submonoid.coe_Sup_of_directed_on AddSubmonoid.coe_sSup_of_directedOn @[to_additive] theorem mem_sup_left {S T : Submonoid M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T := by rw [← SetLike.le_def] exact le_sup_left #align submonoid.mem_sup_left Submonoid.mem_sup_left #align add_submonoid.mem_sup_left AddSubmonoid.mem_sup_left @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
241
243
theorem mem_sup_right {S T : Submonoid M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T := by
rw [← SetLike.le_def] exact le_sup_right
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive] theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ · exact hι.elim fun i ↦ ⟨i, (S i).one_mem⟩ · rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩ #align submonoid.mem_supr_of_directed Submonoid.mem_iSup_of_directed #align add_submonoid.mem_supr_of_directed AddSubmonoid.mem_iSup_of_directed @[to_additive] theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) : ((⨆ i, S i : Submonoid M) : Set M) = ⋃ i, S i := Set.ext fun x ↦ by simp [mem_iSup_of_directed hS] #align submonoid.coe_supr_of_directed Submonoid.coe_iSup_of_directed #align add_submonoid.coe_supr_of_directed AddSubmonoid.coe_iSup_of_directed @[to_additive] theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by haveI : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk] #align submonoid.mem_Sup_of_directed_on Submonoid.mem_sSup_of_directedOn #align add_submonoid.mem_Sup_of_directed_on AddSubmonoid.mem_sSup_of_directedOn @[to_additive] theorem coe_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s := Set.ext fun x => by simp [mem_sSup_of_directedOn Sne hS] #align submonoid.coe_Sup_of_directed_on Submonoid.coe_sSup_of_directedOn #align add_submonoid.coe_Sup_of_directed_on AddSubmonoid.coe_sSup_of_directedOn @[to_additive] theorem mem_sup_left {S T : Submonoid M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T := by rw [← SetLike.le_def] exact le_sup_left #align submonoid.mem_sup_left Submonoid.mem_sup_left #align add_submonoid.mem_sup_left AddSubmonoid.mem_sup_left @[to_additive] theorem mem_sup_right {S T : Submonoid M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T := by rw [← SetLike.le_def] exact le_sup_right #align submonoid.mem_sup_right Submonoid.mem_sup_right #align add_submonoid.mem_sup_right AddSubmonoid.mem_sup_right @[to_additive] theorem mul_mem_sup {S T : Submonoid M} {x y : M} (hx : x ∈ S) (hy : y ∈ T) : x * y ∈ S ⊔ T := (S ⊔ T).mul_mem (mem_sup_left hx) (mem_sup_right hy) #align submonoid.mul_mem_sup Submonoid.mul_mem_sup #align add_submonoid.add_mem_sup AddSubmonoid.add_mem_sup @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
254
257
theorem mem_iSup_of_mem {ι : Sort*} {S : ι → Submonoid M} (i : ι) : ∀ {x : M}, x ∈ S i → x ∈ iSup S := by
rw [← SetLike.le_def] exact le_iSup _ _
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive] theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i := by refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) → ∃ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ · exact hι.elim fun i ↦ ⟨i, (S i).one_mem⟩ · rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩ #align submonoid.mem_supr_of_directed Submonoid.mem_iSup_of_directed #align add_submonoid.mem_supr_of_directed AddSubmonoid.mem_iSup_of_directed @[to_additive] theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Submonoid M} (hS : Directed (· ≤ ·) S) : ((⨆ i, S i : Submonoid M) : Set M) = ⋃ i, S i := Set.ext fun x ↦ by simp [mem_iSup_of_directed hS] #align submonoid.coe_supr_of_directed Submonoid.coe_iSup_of_directed #align add_submonoid.coe_supr_of_directed AddSubmonoid.coe_iSup_of_directed @[to_additive] theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by haveI : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk] #align submonoid.mem_Sup_of_directed_on Submonoid.mem_sSup_of_directedOn #align add_submonoid.mem_Sup_of_directed_on AddSubmonoid.mem_sSup_of_directedOn @[to_additive] theorem coe_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s := Set.ext fun x => by simp [mem_sSup_of_directedOn Sne hS] #align submonoid.coe_Sup_of_directed_on Submonoid.coe_sSup_of_directedOn #align add_submonoid.coe_Sup_of_directed_on AddSubmonoid.coe_sSup_of_directedOn @[to_additive] theorem mem_sup_left {S T : Submonoid M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T := by rw [← SetLike.le_def] exact le_sup_left #align submonoid.mem_sup_left Submonoid.mem_sup_left #align add_submonoid.mem_sup_left AddSubmonoid.mem_sup_left @[to_additive] theorem mem_sup_right {S T : Submonoid M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T := by rw [← SetLike.le_def] exact le_sup_right #align submonoid.mem_sup_right Submonoid.mem_sup_right #align add_submonoid.mem_sup_right AddSubmonoid.mem_sup_right @[to_additive] theorem mul_mem_sup {S T : Submonoid M} {x y : M} (hx : x ∈ S) (hy : y ∈ T) : x * y ∈ S ⊔ T := (S ⊔ T).mul_mem (mem_sup_left hx) (mem_sup_right hy) #align submonoid.mul_mem_sup Submonoid.mul_mem_sup #align add_submonoid.add_mem_sup AddSubmonoid.add_mem_sup @[to_additive] theorem mem_iSup_of_mem {ι : Sort*} {S : ι → Submonoid M} (i : ι) : ∀ {x : M}, x ∈ S i → x ∈ iSup S := by rw [← SetLike.le_def] exact le_iSup _ _ #align submonoid.mem_supr_of_mem Submonoid.mem_iSup_of_mem #align add_submonoid.mem_supr_of_mem AddSubmonoid.mem_iSup_of_mem @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
262
265
theorem mem_sSup_of_mem {S : Set (Submonoid M)} {s : Submonoid M} (hs : s ∈ S) : ∀ {x : M}, x ∈ s → x ∈ sSup S := by
rw [← SetLike.le_def] exact le_sSup hs
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} namespace Submonoid variable [Monoid M] {a : M} open MonoidHom theorem closure_singleton_eq (x : M) : closure ({x} : Set M) = mrange (powersHom M x) := closure_eq_of_le (Set.singleton_subset_iff.2 ⟨Multiplicative.ofAdd 1, pow_one x⟩) fun _ ⟨_, hn⟩ => hn ▸ pow_mem (subset_closure <| Set.mem_singleton _) _ #align submonoid.closure_singleton_eq Submonoid.closure_singleton_eq
Mathlib/Algebra/Group/Submonoid/Membership.lean
332
333
theorem mem_closure_singleton {x y : M} : y ∈ closure ({x} : Set M) ↔ ∃ n : ℕ, x ^ n = y := by
rw [closure_singleton_eq, mem_mrange]; rfl
308
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} namespace Submonoid variable [Monoid M] {a : M} open MonoidHom theorem closure_singleton_eq (x : M) : closure ({x} : Set M) = mrange (powersHom M x) := closure_eq_of_le (Set.singleton_subset_iff.2 ⟨Multiplicative.ofAdd 1, pow_one x⟩) fun _ ⟨_, hn⟩ => hn ▸ pow_mem (subset_closure <| Set.mem_singleton _) _ #align submonoid.closure_singleton_eq Submonoid.closure_singleton_eq theorem mem_closure_singleton {x y : M} : y ∈ closure ({x} : Set M) ↔ ∃ n : ℕ, x ^ n = y := by rw [closure_singleton_eq, mem_mrange]; rfl #align submonoid.mem_closure_singleton Submonoid.mem_closure_singleton theorem mem_closure_singleton_self {y : M} : y ∈ closure ({y} : Set M) := mem_closure_singleton.2 ⟨1, pow_one y⟩ #align submonoid.mem_closure_singleton_self Submonoid.mem_closure_singleton_self
Mathlib/Algebra/Group/Submonoid/Membership.lean
340
341
theorem closure_singleton_one : closure ({1} : Set M) = ⊥ := by
simp [eq_bot_iff_forall, mem_closure_singleton]
308
import Mathlib.Algebra.Group.Submonoid.Membership import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Ring.Action.Subobjects import Mathlib.Algebra.Ring.Equiv import Mathlib.Algebra.Ring.Prod import Mathlib.Data.Set.Finite import Mathlib.GroupTheory.Submonoid.Centralizer import Mathlib.RingTheory.NonUnitalSubsemiring.Basic #align_import ring_theory.subsemiring.basic from "leanprover-community/mathlib"@"b915e9392ecb2a861e1e766f0e1df6ac481188ca" universe u v w section AddSubmonoidWithOneClass class AddSubmonoidWithOneClass (S R : Type*) [AddMonoidWithOne R] [SetLike S R] extends AddSubmonoidClass S R, OneMemClass S R : Prop #align add_submonoid_with_one_class AddSubmonoidWithOneClass variable {S R : Type*} [AddMonoidWithOne R] [SetLike S R] (s : S) @[aesop safe apply (rule_sets := [SetLike])]
Mathlib/Algebra/Ring/Subsemiring/Basic.lean
39
40
theorem natCast_mem [AddSubmonoidWithOneClass S R] (n : ℕ) : (n : R) ∈ s := by
induction n <;> simp [zero_mem, add_mem, one_mem, *]
309
import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential import Mathlib.Geometry.Manifold.ContMDiffMap #align_import geometry.manifold.cont_mdiff_mfderiv from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833" open Set Function Filter ChartedSpace SmoothManifoldWithCorners Bundle open scoped Topology Manifold Bundle variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] -- declare a smooth manifold `M` over the pair `(E, H)`. {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] {I : ModelWithCorners 𝕜 E H} {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [Is : SmoothManifoldWithCorners I M] -- declare a smooth manifold `M'` over the pair `(E', H')`. {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] {I' : ModelWithCorners 𝕜 E' H'} {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [I's : SmoothManifoldWithCorners I' M'] -- declare a smooth manifold `N` over the pair `(F, G)`. {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [TopologicalSpace G] {J : ModelWithCorners 𝕜 F G} {N : Type*} [TopologicalSpace N] [ChartedSpace G N] [Js : SmoothManifoldWithCorners J N] -- declare a smooth manifold `N'` over the pair `(F', G')`. {F' : Type*} [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] {G' : Type*} [TopologicalSpace G'] {J' : ModelWithCorners 𝕜 F' G'} {N' : Type*} [TopologicalSpace N'] [ChartedSpace G' N'] [J's : SmoothManifoldWithCorners J' N'] -- declare some additional normed spaces, used for fibers of vector bundles {F₁ : Type*} [NormedAddCommGroup F₁] [NormedSpace 𝕜 F₁] {F₂ : Type*} [NormedAddCommGroup F₂] [NormedSpace 𝕜 F₂] -- declare functions, sets, points and smoothness indices {f f₁ : M → M'} {s s₁ t : Set M} {x : M} {m n : ℕ∞} -- Porting note: section about deducing differentiability from smoothness moved to -- `Geometry.Manifold.MFDeriv.Basic` section tangentMap
Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean
227
280
theorem ContMDiffOn.continuousOn_tangentMapWithin_aux {f : H → H'} {s : Set H} (hf : ContMDiffOn I I' n f s) (hn : 1 ≤ n) (hs : UniqueMDiffOn I s) : ContinuousOn (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s) := by
suffices h : ContinuousOn (fun p : H × E => (f p.fst, (fderivWithin 𝕜 (writtenInExtChartAt I I' p.fst f) (I.symm ⁻¹' s ∩ range I) ((extChartAt I p.fst) p.fst) : E →L[𝕜] E') p.snd)) (Prod.fst ⁻¹' s) by have A := (tangentBundleModelSpaceHomeomorph H I).continuous rw [continuous_iff_continuousOn_univ] at A have B := ((tangentBundleModelSpaceHomeomorph H' I').symm.continuous.comp_continuousOn h).comp' A have : univ ∩ tangentBundleModelSpaceHomeomorph H I ⁻¹' (Prod.fst ⁻¹' s) = π E (TangentSpace I) ⁻¹' s := by ext ⟨x, v⟩; simp only [mfld_simps] rw [this] at B apply B.congr rintro ⟨x, v⟩ hx dsimp [tangentMapWithin] ext; · rfl simp only [mfld_simps] apply congr_fun apply congr_arg rw [MDifferentiableWithinAt.mfderivWithin (hf.mdifferentiableOn hn x hx)] rfl suffices h : ContinuousOn (fun p : H × E => (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I p.fst) : E →L[𝕜] E') p.snd) (Prod.fst ⁻¹' s) by dsimp [writtenInExtChartAt, extChartAt] exact (ContinuousOn.comp hf.continuousOn continuous_fst.continuousOn Subset.rfl).prod h suffices h : ContinuousOn (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I)) (I '' s) by have C := ContinuousOn.comp h I.continuous_toFun.continuousOn Subset.rfl have A : Continuous fun q : (E →L[𝕜] E') × E => q.1 q.2 := isBoundedBilinearMap_apply.continuous have B : ContinuousOn (fun p : H × E => (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I p.1), p.2)) (Prod.fst ⁻¹' s) := by apply ContinuousOn.prod _ continuous_snd.continuousOn refine C.comp continuousOn_fst ?_ exact preimage_mono (subset_preimage_image _ _) exact A.comp_continuousOn B rw [contMDiffOn_iff] at hf let x : H := I.symm (0 : E) let y : H' := I'.symm (0 : E') have A := hf.2 x y simp only [I.image_eq, inter_comm, mfld_simps] at A ⊢ apply A.continuousOn_fderivWithin _ hn convert hs.uniqueDiffOn_target_inter x using 1 simp only [inter_comm, mfld_simps]
310
import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential import Mathlib.Geometry.Manifold.ContMDiffMap #align_import geometry.manifold.cont_mdiff_mfderiv from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833" open Set Function Filter ChartedSpace SmoothManifoldWithCorners Bundle open scoped Topology Manifold Bundle variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] -- declare a smooth manifold `M` over the pair `(E, H)`. {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] {I : ModelWithCorners 𝕜 E H} {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [Is : SmoothManifoldWithCorners I M] -- declare a smooth manifold `M'` over the pair `(E', H')`. {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] {I' : ModelWithCorners 𝕜 E' H'} {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [I's : SmoothManifoldWithCorners I' M'] -- declare a smooth manifold `N` over the pair `(F, G)`. {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [TopologicalSpace G] {J : ModelWithCorners 𝕜 F G} {N : Type*} [TopologicalSpace N] [ChartedSpace G N] [Js : SmoothManifoldWithCorners J N] -- declare a smooth manifold `N'` over the pair `(F', G')`. {F' : Type*} [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] {G' : Type*} [TopologicalSpace G'] {J' : ModelWithCorners 𝕜 F' G'} {N' : Type*} [TopologicalSpace N'] [ChartedSpace G' N'] [J's : SmoothManifoldWithCorners J' N'] -- declare some additional normed spaces, used for fibers of vector bundles {F₁ : Type*} [NormedAddCommGroup F₁] [NormedSpace 𝕜 F₁] {F₂ : Type*} [NormedAddCommGroup F₂] [NormedSpace 𝕜 F₂] -- declare functions, sets, points and smoothness indices {f f₁ : M → M'} {s s₁ t : Set M} {x : M} {m n : ℕ∞} -- Porting note: section about deducing differentiability from smoothness moved to -- `Geometry.Manifold.MFDeriv.Basic` section tangentMap theorem ContMDiffOn.continuousOn_tangentMapWithin_aux {f : H → H'} {s : Set H} (hf : ContMDiffOn I I' n f s) (hn : 1 ≤ n) (hs : UniqueMDiffOn I s) : ContinuousOn (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s) := by suffices h : ContinuousOn (fun p : H × E => (f p.fst, (fderivWithin 𝕜 (writtenInExtChartAt I I' p.fst f) (I.symm ⁻¹' s ∩ range I) ((extChartAt I p.fst) p.fst) : E →L[𝕜] E') p.snd)) (Prod.fst ⁻¹' s) by have A := (tangentBundleModelSpaceHomeomorph H I).continuous rw [continuous_iff_continuousOn_univ] at A have B := ((tangentBundleModelSpaceHomeomorph H' I').symm.continuous.comp_continuousOn h).comp' A have : univ ∩ tangentBundleModelSpaceHomeomorph H I ⁻¹' (Prod.fst ⁻¹' s) = π E (TangentSpace I) ⁻¹' s := by ext ⟨x, v⟩; simp only [mfld_simps] rw [this] at B apply B.congr rintro ⟨x, v⟩ hx dsimp [tangentMapWithin] ext; · rfl simp only [mfld_simps] apply congr_fun apply congr_arg rw [MDifferentiableWithinAt.mfderivWithin (hf.mdifferentiableOn hn x hx)] rfl suffices h : ContinuousOn (fun p : H × E => (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I p.fst) : E →L[𝕜] E') p.snd) (Prod.fst ⁻¹' s) by dsimp [writtenInExtChartAt, extChartAt] exact (ContinuousOn.comp hf.continuousOn continuous_fst.continuousOn Subset.rfl).prod h suffices h : ContinuousOn (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I)) (I '' s) by have C := ContinuousOn.comp h I.continuous_toFun.continuousOn Subset.rfl have A : Continuous fun q : (E →L[𝕜] E') × E => q.1 q.2 := isBoundedBilinearMap_apply.continuous have B : ContinuousOn (fun p : H × E => (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I p.1), p.2)) (Prod.fst ⁻¹' s) := by apply ContinuousOn.prod _ continuous_snd.continuousOn refine C.comp continuousOn_fst ?_ exact preimage_mono (subset_preimage_image _ _) exact A.comp_continuousOn B rw [contMDiffOn_iff] at hf let x : H := I.symm (0 : E) let y : H' := I'.symm (0 : E') have A := hf.2 x y simp only [I.image_eq, inter_comm, mfld_simps] at A ⊢ apply A.continuousOn_fderivWithin _ hn convert hs.uniqueDiffOn_target_inter x using 1 simp only [inter_comm, mfld_simps] #align cont_mdiff_on.continuous_on_tangent_map_within_aux ContMDiffOn.continuousOn_tangentMapWithin_aux
Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean
287
339
theorem ContMDiffOn.contMDiffOn_tangentMapWithin_aux {f : H → H'} {s : Set H} (hf : ContMDiffOn I I' n f s) (hmn : m + 1 ≤ n) (hs : UniqueMDiffOn I s) : ContMDiffOn I.tangent I'.tangent m (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s) := by
have m_le_n : m ≤ n := (le_add_right le_rfl).trans hmn have one_le_n : 1 ≤ n := (le_add_left le_rfl).trans hmn have U' : UniqueDiffOn 𝕜 (range I ∩ I.symm ⁻¹' s) := fun y hy ↦ by simpa only [UniqueMDiffOn, UniqueMDiffWithinAt, hy.1, inter_comm, mfld_simps] using hs (I.symm y) hy.2 rw [contMDiffOn_iff] refine ⟨hf.continuousOn_tangentMapWithin_aux one_le_n hs, fun p q => ?_⟩ suffices h : ContDiffOn 𝕜 m (((fun p : H' × E' => (I' p.fst, p.snd)) ∘ TotalSpace.toProd H' E') ∘ tangentMapWithin I I' f s ∘ (TotalSpace.toProd H E).symm ∘ fun p : E × E => (I.symm p.fst, p.snd)) ((range I ∩ I.symm ⁻¹' s) ×ˢ univ) by -- Porting note: was `simpa [(· ∘ ·)] using h` convert h using 1 · ext1 ⟨x, y⟩ simp only [mfld_simps]; rfl · simp only [mfld_simps] rw [inter_prod, prod_univ, prod_univ] rfl change ContDiffOn 𝕜 m (fun p : E × E => ((I' (f (I.symm p.fst)), (mfderivWithin I I' f s (I.symm p.fst) : E → E') p.snd) : E' × E')) ((range I ∩ I.symm ⁻¹' s) ×ˢ univ) -- check that all bits in this formula are `C^n` have hf' := contMDiffOn_iff.1 hf have A : ContDiffOn 𝕜 m (I' ∘ f ∘ I.symm) (range I ∩ I.symm ⁻¹' s) := by simpa only [mfld_simps] using (hf'.2 (I.symm 0) (I'.symm 0)).of_le m_le_n have B : ContDiffOn 𝕜 m ((I' ∘ f ∘ I.symm) ∘ Prod.fst) ((range I ∩ I.symm ⁻¹' s) ×ˢ (univ : Set E)) := A.comp contDiff_fst.contDiffOn (prod_subset_preimage_fst _ _) suffices C : ContDiffOn 𝕜 m (fun p : E × E => (fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) p.1 : _) p.2) ((range I ∩ I.symm ⁻¹' s) ×ˢ (univ : Set E)) by refine ContDiffOn.prod B ?_ refine C.congr fun p hp => ?_ simp only [mfld_simps] at hp simp only [mfderivWithin, hf.mdifferentiableOn one_le_n _ hp.2, hp.1, if_pos, mfld_simps] rfl have D : ContDiffOn 𝕜 m (fun x => fderivWithin 𝕜 (I' ∘ f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) x) (range I ∩ I.symm ⁻¹' s) := by have : ContDiffOn 𝕜 n (I' ∘ f ∘ I.symm) (range I ∩ I.symm ⁻¹' s) := by simpa only [mfld_simps] using hf'.2 (I.symm 0) (I'.symm 0) simpa only [inter_comm] using this.fderivWithin U' hmn refine ContDiffOn.clm_apply ?_ contDiffOn_snd exact D.comp contDiff_fst.contDiffOn (prod_subset_preimage_fst _ _)
310
import Mathlib.Geometry.Manifold.MFDeriv.UniqueDifferential import Mathlib.Geometry.Manifold.ContMDiffMap #align_import geometry.manifold.cont_mdiff_mfderiv from "leanprover-community/mathlib"@"e473c3198bb41f68560cab68a0529c854b618833" open Set Function Filter ChartedSpace SmoothManifoldWithCorners Bundle open scoped Topology Manifold Bundle variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] -- declare a smooth manifold `M` over the pair `(E, H)`. {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] {I : ModelWithCorners 𝕜 E H} {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [Is : SmoothManifoldWithCorners I M] -- declare a smooth manifold `M'` over the pair `(E', H')`. {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] {I' : ModelWithCorners 𝕜 E' H'} {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [I's : SmoothManifoldWithCorners I' M'] -- declare a smooth manifold `N` over the pair `(F, G)`. {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [TopologicalSpace G] {J : ModelWithCorners 𝕜 F G} {N : Type*} [TopologicalSpace N] [ChartedSpace G N] [Js : SmoothManifoldWithCorners J N] -- declare a smooth manifold `N'` over the pair `(F', G')`. {F' : Type*} [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] {G' : Type*} [TopologicalSpace G'] {J' : ModelWithCorners 𝕜 F' G'} {N' : Type*} [TopologicalSpace N'] [ChartedSpace G' N'] [J's : SmoothManifoldWithCorners J' N'] -- declare some additional normed spaces, used for fibers of vector bundles {F₁ : Type*} [NormedAddCommGroup F₁] [NormedSpace 𝕜 F₁] {F₂ : Type*} [NormedAddCommGroup F₂] [NormedSpace 𝕜 F₂] -- declare functions, sets, points and smoothness indices {f f₁ : M → M'} {s s₁ t : Set M} {x : M} {m n : ℕ∞} -- Porting note: section about deducing differentiability from smoothness moved to -- `Geometry.Manifold.MFDeriv.Basic` namespace TangentBundle variable (I M) open Bundle
Mathlib/Geometry/Manifold/ContMDiffMFDeriv.lean
571
599
theorem tangentMap_tangentBundle_pure (p : TangentBundle I M) : tangentMap I I.tangent (zeroSection E (TangentSpace I)) p = ⟨⟨p.proj, 0⟩, ⟨p.2, 0⟩⟩ := by
rcases p with ⟨x, v⟩ have N : I.symm ⁻¹' (chartAt H x).target ∈ 𝓝 (I ((chartAt H x) x)) := by apply IsOpen.mem_nhds · apply (PartialHomeomorph.open_target _).preimage I.continuous_invFun · simp only [mfld_simps] have A : MDifferentiableAt I I.tangent (fun x => @TotalSpace.mk M E (TangentSpace I) x 0) x := haveI : Smooth I (I.prod 𝓘(𝕜, E)) (zeroSection E (TangentSpace I : M → Type _)) := Bundle.smooth_zeroSection 𝕜 (TangentSpace I : M → Type _) this.mdifferentiableAt have B : fderivWithin 𝕜 (fun x' : E ↦ (x', (0 : E))) (Set.range I) (I ((chartAt H x) x)) v = (v, 0) := by rw [fderivWithin_eq_fderiv, DifferentiableAt.fderiv_prod] · simp · exact differentiableAt_id' · exact differentiableAt_const _ · exact ModelWithCorners.unique_diff_at_image I · exact differentiableAt_id'.prod (differentiableAt_const _) simp (config := { unfoldPartialApp := true }) only [Bundle.zeroSection, tangentMap, mfderiv, A, if_pos, chartAt, FiberBundle.chartedSpace_chartAt, TangentBundle.trivializationAt_apply, tangentBundleCore, Function.comp_def, ContinuousLinearMap.map_zero, mfld_simps] rw [← fderivWithin_inter N] at B rw [← fderivWithin_inter N, ← B] congr 1 refine fderivWithin_congr (fun y hy => ?_) ?_ · simp only [mfld_simps] at hy simp only [hy, Prod.mk.inj_iff, mfld_simps] · simp only [Prod.mk.inj_iff, mfld_simps]
310
import Mathlib.Algebra.Group.Units.Equiv import Mathlib.CategoryTheory.Endomorphism #align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" universe v u namespace CategoryTheory namespace Iso variable {C : Type u} [Category.{v} C] def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where toFun f := α.inv ≫ f ≫ β.hom invFun f := α.hom ≫ f ≫ β.inv left_inv f := show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id] right_inv f := show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id] #align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr -- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this @[simp]
Mathlib/CategoryTheory/Conj.lean
50
52
theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) : α.homCongr β f = α.inv ≫ f ≫ β.hom := by
rfl
311
import Mathlib.Algebra.Group.Units.Equiv import Mathlib.CategoryTheory.Endomorphism #align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" universe v u namespace CategoryTheory namespace Iso variable {C : Type u} [Category.{v} C] def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where toFun f := α.inv ≫ f ≫ β.hom invFun f := α.hom ≫ f ≫ β.inv left_inv f := show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id] right_inv f := show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id] #align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr -- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this @[simp] theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) : α.homCongr β f = α.inv ≫ f ≫ β.hom := by rfl #align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply
Mathlib/CategoryTheory/Conj.lean
55
56
theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y) (g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by
simp
311
import Mathlib.Algebra.Group.Units.Equiv import Mathlib.CategoryTheory.Endomorphism #align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" universe v u namespace CategoryTheory namespace Iso variable {C : Type u} [Category.{v} C] def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where toFun f := α.inv ≫ f ≫ β.hom invFun f := α.hom ≫ f ≫ β.inv left_inv f := show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id] right_inv f := show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id] #align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr -- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this @[simp] theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) : α.homCongr β f = α.inv ≫ f ≫ β.hom := by rfl #align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y) (g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by simp #align category_theory.iso.hom_congr_comp CategoryTheory.Iso.homCongr_comp
Mathlib/CategoryTheory/Conj.lean
60
60
theorem homCongr_refl {X Y : C} (f : X ⟶ Y) : (Iso.refl X).homCongr (Iso.refl Y) f = f := by
simp
311
import Mathlib.Algebra.Group.Units.Equiv import Mathlib.CategoryTheory.Endomorphism #align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" universe v u namespace CategoryTheory namespace Iso variable {C : Type u} [Category.{v} C] def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where toFun f := α.inv ≫ f ≫ β.hom invFun f := α.hom ≫ f ≫ β.inv left_inv f := show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id] right_inv f := show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id] #align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr -- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this @[simp] theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) : α.homCongr β f = α.inv ≫ f ≫ β.hom := by rfl #align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y) (g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by simp #align category_theory.iso.hom_congr_comp CategoryTheory.Iso.homCongr_comp theorem homCongr_refl {X Y : C} (f : X ⟶ Y) : (Iso.refl X).homCongr (Iso.refl Y) f = f := by simp #align category_theory.iso.hom_congr_refl CategoryTheory.Iso.homCongr_refl
Mathlib/CategoryTheory/Conj.lean
64
66
theorem homCongr_trans {X₁ Y₁ X₂ Y₂ X₃ Y₃ : C} (α₁ : X₁ ≅ X₂) (β₁ : Y₁ ≅ Y₂) (α₂ : X₂ ≅ X₃) (β₂ : Y₂ ≅ Y₃) (f : X₁ ⟶ Y₁) : (α₁ ≪≫ α₂).homCongr (β₁ ≪≫ β₂) f = (α₁.homCongr β₁).trans (α₂.homCongr β₂) f := by
simp
311
import Mathlib.Algebra.Group.Units.Equiv import Mathlib.CategoryTheory.Endomorphism #align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" universe v u namespace CategoryTheory namespace Iso variable {C : Type u} [Category.{v} C] def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where toFun f := α.inv ≫ f ≫ β.hom invFun f := α.hom ≫ f ≫ β.inv left_inv f := show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id] right_inv f := show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id] #align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr -- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this @[simp] theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) : α.homCongr β f = α.inv ≫ f ≫ β.hom := by rfl #align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y) (g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by simp #align category_theory.iso.hom_congr_comp CategoryTheory.Iso.homCongr_comp theorem homCongr_refl {X Y : C} (f : X ⟶ Y) : (Iso.refl X).homCongr (Iso.refl Y) f = f := by simp #align category_theory.iso.hom_congr_refl CategoryTheory.Iso.homCongr_refl theorem homCongr_trans {X₁ Y₁ X₂ Y₂ X₃ Y₃ : C} (α₁ : X₁ ≅ X₂) (β₁ : Y₁ ≅ Y₂) (α₂ : X₂ ≅ X₃) (β₂ : Y₂ ≅ Y₃) (f : X₁ ⟶ Y₁) : (α₁ ≪≫ α₂).homCongr (β₁ ≪≫ β₂) f = (α₁.homCongr β₁).trans (α₂.homCongr β₂) f := by simp #align category_theory.iso.hom_congr_trans CategoryTheory.Iso.homCongr_trans @[simp] theorem homCongr_symm {X₁ Y₁ X₂ Y₂ : C} (α : X₁ ≅ X₂) (β : Y₁ ≅ Y₂) : (α.homCongr β).symm = α.symm.homCongr β.symm := rfl #align category_theory.iso.hom_congr_symm CategoryTheory.Iso.homCongr_symm def isoCongr {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ≅ X₂) (g : Y₁ ≅ Y₂) : (X₁ ≅ Y₁) ≃ (X₂ ≅ Y₂) where toFun h := f.symm.trans <| h.trans <| g invFun h := f.trans <| h.trans <| g.symm left_inv := by aesop_cat right_inv := by aesop_cat def isoCongrLeft {X₁ X₂ Y : C} (f : X₁ ≅ X₂) : (X₁ ≅ Y) ≃ (X₂ ≅ Y) := isoCongr f (Iso.refl _) def isoCongrRight {X Y₁ Y₂ : C} (g : Y₁ ≅ Y₂) : (X ≅ Y₁) ≃ (X ≅ Y₂) := isoCongr (Iso.refl _) g variable {X Y : C} (α : X ≅ Y) def conj : End X ≃* End Y := { homCongr α α with map_mul' := fun f g => homCongr_comp α α α g f } #align category_theory.iso.conj CategoryTheory.Iso.conj theorem conj_apply (f : End X) : α.conj f = α.inv ≫ f ≫ α.hom := rfl #align category_theory.iso.conj_apply CategoryTheory.Iso.conj_apply @[simp] theorem conj_comp (f g : End X) : α.conj (f ≫ g) = α.conj f ≫ α.conj g := α.conj.map_mul g f #align category_theory.iso.conj_comp CategoryTheory.Iso.conj_comp @[simp] theorem conj_id : α.conj (𝟙 X) = 𝟙 Y := α.conj.map_one #align category_theory.iso.conj_id CategoryTheory.Iso.conj_id @[simp]
Mathlib/CategoryTheory/Conj.lean
114
115
theorem refl_conj (f : End X) : (Iso.refl X).conj f = f := by
rw [conj_apply, Iso.refl_inv, Iso.refl_hom, Category.id_comp, Category.comp_id]
311
import Mathlib.Algebra.Group.Units.Equiv import Mathlib.CategoryTheory.Endomorphism #align_import category_theory.conj from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" universe v u namespace CategoryTheory namespace Iso variable {C : Type u} [Category.{v} C] def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁) where toFun f := α.inv ≫ f ≫ β.hom invFun f := α.hom ≫ f ≫ β.inv left_inv f := show α.hom ≫ (α.inv ≫ f ≫ β.hom) ≫ β.inv = f by rw [Category.assoc, Category.assoc, β.hom_inv_id, α.hom_inv_id_assoc, Category.comp_id] right_inv f := show α.inv ≫ (α.hom ≫ f ≫ β.inv) ≫ β.hom = f by rw [Category.assoc, Category.assoc, β.inv_hom_id, α.inv_hom_id_assoc, Category.comp_id] #align category_theory.iso.hom_congr CategoryTheory.Iso.homCongr -- @[simp, nolint simpNF] Porting note (#10675): dsimp can not prove this @[simp] theorem homCongr_apply {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) : α.homCongr β f = α.inv ≫ f ≫ β.hom := by rfl #align category_theory.iso.hom_congr_apply CategoryTheory.Iso.homCongr_apply theorem homCongr_comp {X Y Z X₁ Y₁ Z₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (γ : Z ≅ Z₁) (f : X ⟶ Y) (g : Y ⟶ Z) : α.homCongr γ (f ≫ g) = α.homCongr β f ≫ β.homCongr γ g := by simp #align category_theory.iso.hom_congr_comp CategoryTheory.Iso.homCongr_comp theorem homCongr_refl {X Y : C} (f : X ⟶ Y) : (Iso.refl X).homCongr (Iso.refl Y) f = f := by simp #align category_theory.iso.hom_congr_refl CategoryTheory.Iso.homCongr_refl theorem homCongr_trans {X₁ Y₁ X₂ Y₂ X₃ Y₃ : C} (α₁ : X₁ ≅ X₂) (β₁ : Y₁ ≅ Y₂) (α₂ : X₂ ≅ X₃) (β₂ : Y₂ ≅ Y₃) (f : X₁ ⟶ Y₁) : (α₁ ≪≫ α₂).homCongr (β₁ ≪≫ β₂) f = (α₁.homCongr β₁).trans (α₂.homCongr β₂) f := by simp #align category_theory.iso.hom_congr_trans CategoryTheory.Iso.homCongr_trans @[simp] theorem homCongr_symm {X₁ Y₁ X₂ Y₂ : C} (α : X₁ ≅ X₂) (β : Y₁ ≅ Y₂) : (α.homCongr β).symm = α.symm.homCongr β.symm := rfl #align category_theory.iso.hom_congr_symm CategoryTheory.Iso.homCongr_symm def isoCongr {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ≅ X₂) (g : Y₁ ≅ Y₂) : (X₁ ≅ Y₁) ≃ (X₂ ≅ Y₂) where toFun h := f.symm.trans <| h.trans <| g invFun h := f.trans <| h.trans <| g.symm left_inv := by aesop_cat right_inv := by aesop_cat def isoCongrLeft {X₁ X₂ Y : C} (f : X₁ ≅ X₂) : (X₁ ≅ Y) ≃ (X₂ ≅ Y) := isoCongr f (Iso.refl _) def isoCongrRight {X Y₁ Y₂ : C} (g : Y₁ ≅ Y₂) : (X ≅ Y₁) ≃ (X ≅ Y₂) := isoCongr (Iso.refl _) g variable {X Y : C} (α : X ≅ Y) def conj : End X ≃* End Y := { homCongr α α with map_mul' := fun f g => homCongr_comp α α α g f } #align category_theory.iso.conj CategoryTheory.Iso.conj theorem conj_apply (f : End X) : α.conj f = α.inv ≫ f ≫ α.hom := rfl #align category_theory.iso.conj_apply CategoryTheory.Iso.conj_apply @[simp] theorem conj_comp (f g : End X) : α.conj (f ≫ g) = α.conj f ≫ α.conj g := α.conj.map_mul g f #align category_theory.iso.conj_comp CategoryTheory.Iso.conj_comp @[simp] theorem conj_id : α.conj (𝟙 X) = 𝟙 Y := α.conj.map_one #align category_theory.iso.conj_id CategoryTheory.Iso.conj_id @[simp] theorem refl_conj (f : End X) : (Iso.refl X).conj f = f := by rw [conj_apply, Iso.refl_inv, Iso.refl_hom, Category.id_comp, Category.comp_id] #align category_theory.iso.refl_conj CategoryTheory.Iso.refl_conj @[simp] theorem trans_conj {Z : C} (β : Y ≅ Z) (f : End X) : (α ≪≫ β).conj f = β.conj (α.conj f) := homCongr_trans α α β β f #align category_theory.iso.trans_conj CategoryTheory.Iso.trans_conj @[simp]
Mathlib/CategoryTheory/Conj.lean
124
125
theorem symm_self_conj (f : End X) : α.symm.conj (α.conj f) = f := by
rw [← trans_conj, α.self_symm_id, refl_conj]
311
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Conj import Mathlib.CategoryTheory.Functor.ReflectsIso #align_import category_theory.adjunction.reflective from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ noncomputable section namespace CategoryTheory open Category Adjunction variable {C : Type u₁} {D : Type u₂} {E : Type u₃} variable [Category.{v₁} C] [Category.{v₂} D] [Category.{v₃} E] class Reflective (R : D ⥤ C) extends R.Full, R.Faithful where L : C ⥤ D adj : L ⊣ R #align category_theory.reflective CategoryTheory.Reflective variable (i : D ⥤ C) def reflector [Reflective i] : C ⥤ D := Reflective.L (R := i) def reflectorAdjunction [Reflective i] : reflector i ⊣ i := Reflective.adj instance [Reflective i] : i.IsRightAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ instance [Reflective i] : (reflector i).IsLeftAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ def Functor.fullyFaithfulOfReflective [Reflective i] : i.FullyFaithful := (reflectorAdjunction i).fullyFaithfulROfIsIsoCounit -- TODO: This holds more generally for idempotent adjunctions, not just reflective adjunctions.
Mathlib/CategoryTheory/Adjunction/Reflective.lean
62
67
theorem unit_obj_eq_map_unit [Reflective i] (X : C) : (reflectorAdjunction i).unit.app (i.obj ((reflector i).obj X)) = i.map ((reflector i).map ((reflectorAdjunction i).unit.app X)) := by
rw [← cancel_mono (i.map ((reflectorAdjunction i).counit.app ((reflector i).obj X))), ← i.map_comp] simp
312
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Conj import Mathlib.CategoryTheory.Functor.ReflectsIso #align_import category_theory.adjunction.reflective from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ noncomputable section namespace CategoryTheory open Category Adjunction variable {C : Type u₁} {D : Type u₂} {E : Type u₃} variable [Category.{v₁} C] [Category.{v₂} D] [Category.{v₃} E] class Reflective (R : D ⥤ C) extends R.Full, R.Faithful where L : C ⥤ D adj : L ⊣ R #align category_theory.reflective CategoryTheory.Reflective variable (i : D ⥤ C) def reflector [Reflective i] : C ⥤ D := Reflective.L (R := i) def reflectorAdjunction [Reflective i] : reflector i ⊣ i := Reflective.adj instance [Reflective i] : i.IsRightAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ instance [Reflective i] : (reflector i).IsLeftAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ def Functor.fullyFaithfulOfReflective [Reflective i] : i.FullyFaithful := (reflectorAdjunction i).fullyFaithfulROfIsIsoCounit -- TODO: This holds more generally for idempotent adjunctions, not just reflective adjunctions. theorem unit_obj_eq_map_unit [Reflective i] (X : C) : (reflectorAdjunction i).unit.app (i.obj ((reflector i).obj X)) = i.map ((reflector i).map ((reflectorAdjunction i).unit.app X)) := by rw [← cancel_mono (i.map ((reflectorAdjunction i).counit.app ((reflector i).obj X))), ← i.map_comp] simp #align category_theory.unit_obj_eq_map_unit CategoryTheory.unit_obj_eq_map_unit example [Reflective i] {B : D} : IsIso ((reflectorAdjunction i).unit.app (i.obj B)) := inferInstance variable {i}
Mathlib/CategoryTheory/Adjunction/Reflective.lean
87
89
theorem Functor.essImage.unit_isIso [Reflective i] {A : C} (h : A ∈ i.essImage) : IsIso ((reflectorAdjunction i).unit.app A) := by
rwa [isIso_unit_app_iff_mem_essImage]
312
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Conj import Mathlib.CategoryTheory.Functor.ReflectsIso #align_import category_theory.adjunction.reflective from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ noncomputable section namespace CategoryTheory open Category Adjunction variable {C : Type u₁} {D : Type u₂} {E : Type u₃} variable [Category.{v₁} C] [Category.{v₂} D] [Category.{v₃} E] class Reflective (R : D ⥤ C) extends R.Full, R.Faithful where L : C ⥤ D adj : L ⊣ R #align category_theory.reflective CategoryTheory.Reflective variable (i : D ⥤ C) def reflector [Reflective i] : C ⥤ D := Reflective.L (R := i) def reflectorAdjunction [Reflective i] : reflector i ⊣ i := Reflective.adj instance [Reflective i] : i.IsRightAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ instance [Reflective i] : (reflector i).IsLeftAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ def Functor.fullyFaithfulOfReflective [Reflective i] : i.FullyFaithful := (reflectorAdjunction i).fullyFaithfulROfIsIsoCounit -- TODO: This holds more generally for idempotent adjunctions, not just reflective adjunctions. theorem unit_obj_eq_map_unit [Reflective i] (X : C) : (reflectorAdjunction i).unit.app (i.obj ((reflector i).obj X)) = i.map ((reflector i).map ((reflectorAdjunction i).unit.app X)) := by rw [← cancel_mono (i.map ((reflectorAdjunction i).counit.app ((reflector i).obj X))), ← i.map_comp] simp #align category_theory.unit_obj_eq_map_unit CategoryTheory.unit_obj_eq_map_unit example [Reflective i] {B : D} : IsIso ((reflectorAdjunction i).unit.app (i.obj B)) := inferInstance variable {i} theorem Functor.essImage.unit_isIso [Reflective i] {A : C} (h : A ∈ i.essImage) : IsIso ((reflectorAdjunction i).unit.app A) := by rwa [isIso_unit_app_iff_mem_essImage] #align category_theory.functor.ess_image.unit_is_iso CategoryTheory.Functor.essImage.unit_isIso theorem mem_essImage_of_unit_isIso {L : C ⥤ D} (adj : L ⊣ i) (A : C) [IsIso (adj.unit.app A)] : A ∈ i.essImage := ⟨L.obj A, ⟨(asIso (adj.unit.app A)).symm⟩⟩ #align category_theory.mem_ess_image_of_unit_is_iso CategoryTheory.mem_essImage_of_unit_isIso
Mathlib/CategoryTheory/Adjunction/Reflective.lean
99
109
theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C} [IsSplitMono ((reflectorAdjunction i).unit.app A)] : A ∈ i.essImage := by
let η : 𝟭 C ⟶ reflector i ⋙ i := (reflectorAdjunction i).unit haveI : IsIso (η.app (i.obj ((reflector i).obj A))) := Functor.essImage.unit_isIso ((i.obj_mem_essImage _)) have : Epi (η.app A) := by refine @epi_of_epi _ _ _ _ _ (retraction (η.app A)) (η.app A) ?_ rw [show retraction _ ≫ η.app A = _ from η.naturality (retraction (η.app A))] apply epi_comp (η.app (i.obj ((reflector i).obj A))) haveI := isIso_of_epi_of_isSplitMono (η.app A) exact mem_essImage_of_unit_isIso (reflectorAdjunction i) A
312
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Conj import Mathlib.CategoryTheory.Functor.ReflectsIso #align_import category_theory.adjunction.reflective from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ noncomputable section namespace CategoryTheory open Category Adjunction variable {C : Type u₁} {D : Type u₂} {E : Type u₃} variable [Category.{v₁} C] [Category.{v₂} D] [Category.{v₃} E] class Reflective (R : D ⥤ C) extends R.Full, R.Faithful where L : C ⥤ D adj : L ⊣ R #align category_theory.reflective CategoryTheory.Reflective variable (i : D ⥤ C) def reflector [Reflective i] : C ⥤ D := Reflective.L (R := i) def reflectorAdjunction [Reflective i] : reflector i ⊣ i := Reflective.adj instance [Reflective i] : i.IsRightAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ instance [Reflective i] : (reflector i).IsLeftAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ def Functor.fullyFaithfulOfReflective [Reflective i] : i.FullyFaithful := (reflectorAdjunction i).fullyFaithfulROfIsIsoCounit -- TODO: This holds more generally for idempotent adjunctions, not just reflective adjunctions. theorem unit_obj_eq_map_unit [Reflective i] (X : C) : (reflectorAdjunction i).unit.app (i.obj ((reflector i).obj X)) = i.map ((reflector i).map ((reflectorAdjunction i).unit.app X)) := by rw [← cancel_mono (i.map ((reflectorAdjunction i).counit.app ((reflector i).obj X))), ← i.map_comp] simp #align category_theory.unit_obj_eq_map_unit CategoryTheory.unit_obj_eq_map_unit example [Reflective i] {B : D} : IsIso ((reflectorAdjunction i).unit.app (i.obj B)) := inferInstance variable {i} theorem Functor.essImage.unit_isIso [Reflective i] {A : C} (h : A ∈ i.essImage) : IsIso ((reflectorAdjunction i).unit.app A) := by rwa [isIso_unit_app_iff_mem_essImage] #align category_theory.functor.ess_image.unit_is_iso CategoryTheory.Functor.essImage.unit_isIso theorem mem_essImage_of_unit_isIso {L : C ⥤ D} (adj : L ⊣ i) (A : C) [IsIso (adj.unit.app A)] : A ∈ i.essImage := ⟨L.obj A, ⟨(asIso (adj.unit.app A)).symm⟩⟩ #align category_theory.mem_ess_image_of_unit_is_iso CategoryTheory.mem_essImage_of_unit_isIso theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C} [IsSplitMono ((reflectorAdjunction i).unit.app A)] : A ∈ i.essImage := by let η : 𝟭 C ⟶ reflector i ⋙ i := (reflectorAdjunction i).unit haveI : IsIso (η.app (i.obj ((reflector i).obj A))) := Functor.essImage.unit_isIso ((i.obj_mem_essImage _)) have : Epi (η.app A) := by refine @epi_of_epi _ _ _ _ _ (retraction (η.app A)) (η.app A) ?_ rw [show retraction _ ≫ η.app A = _ from η.naturality (retraction (η.app A))] apply epi_comp (η.app (i.obj ((reflector i).obj A))) haveI := isIso_of_epi_of_isSplitMono (η.app A) exact mem_essImage_of_unit_isIso (reflectorAdjunction i) A #align category_theory.mem_ess_image_of_unit_is_split_mono CategoryTheory.mem_essImage_of_unit_isSplitMono instance Reflective.comp (F : C ⥤ D) (G : D ⥤ E) [Reflective F] [Reflective G] : Reflective (F ⋙ G) where L := reflector G ⋙ reflector F adj := (reflectorAdjunction G).comp (reflectorAdjunction F) #align category_theory.reflective.comp CategoryTheory.Reflective.comp def unitCompPartialBijectiveAux [Reflective i] (A : C) (B : D) : (A ⟶ i.obj B) ≃ (i.obj ((reflector i).obj A) ⟶ i.obj B) := ((reflectorAdjunction i).homEquiv _ _).symm.trans (Functor.FullyFaithful.ofFullyFaithful i).homEquiv #align category_theory.unit_comp_partial_bijective_aux CategoryTheory.unitCompPartialBijectiveAux
Mathlib/CategoryTheory/Adjunction/Reflective.lean
127
130
theorem unitCompPartialBijectiveAux_symm_apply [Reflective i] {A : C} {B : D} (f : i.obj ((reflector i).obj A) ⟶ i.obj B) : (unitCompPartialBijectiveAux _ _).symm f = (reflectorAdjunction i).unit.app A ≫ f := by
simp [unitCompPartialBijectiveAux]
312
import Mathlib.CategoryTheory.Adjunction.FullyFaithful import Mathlib.CategoryTheory.Conj import Mathlib.CategoryTheory.Functor.ReflectsIso #align_import category_theory.adjunction.reflective from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ noncomputable section namespace CategoryTheory open Category Adjunction variable {C : Type u₁} {D : Type u₂} {E : Type u₃} variable [Category.{v₁} C] [Category.{v₂} D] [Category.{v₃} E] class Reflective (R : D ⥤ C) extends R.Full, R.Faithful where L : C ⥤ D adj : L ⊣ R #align category_theory.reflective CategoryTheory.Reflective variable (i : D ⥤ C) def reflector [Reflective i] : C ⥤ D := Reflective.L (R := i) def reflectorAdjunction [Reflective i] : reflector i ⊣ i := Reflective.adj instance [Reflective i] : i.IsRightAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ instance [Reflective i] : (reflector i).IsLeftAdjoint := ⟨_, ⟨reflectorAdjunction i⟩⟩ def Functor.fullyFaithfulOfReflective [Reflective i] : i.FullyFaithful := (reflectorAdjunction i).fullyFaithfulROfIsIsoCounit -- TODO: This holds more generally for idempotent adjunctions, not just reflective adjunctions. theorem unit_obj_eq_map_unit [Reflective i] (X : C) : (reflectorAdjunction i).unit.app (i.obj ((reflector i).obj X)) = i.map ((reflector i).map ((reflectorAdjunction i).unit.app X)) := by rw [← cancel_mono (i.map ((reflectorAdjunction i).counit.app ((reflector i).obj X))), ← i.map_comp] simp #align category_theory.unit_obj_eq_map_unit CategoryTheory.unit_obj_eq_map_unit example [Reflective i] {B : D} : IsIso ((reflectorAdjunction i).unit.app (i.obj B)) := inferInstance variable {i} theorem Functor.essImage.unit_isIso [Reflective i] {A : C} (h : A ∈ i.essImage) : IsIso ((reflectorAdjunction i).unit.app A) := by rwa [isIso_unit_app_iff_mem_essImage] #align category_theory.functor.ess_image.unit_is_iso CategoryTheory.Functor.essImage.unit_isIso theorem mem_essImage_of_unit_isIso {L : C ⥤ D} (adj : L ⊣ i) (A : C) [IsIso (adj.unit.app A)] : A ∈ i.essImage := ⟨L.obj A, ⟨(asIso (adj.unit.app A)).symm⟩⟩ #align category_theory.mem_ess_image_of_unit_is_iso CategoryTheory.mem_essImage_of_unit_isIso theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C} [IsSplitMono ((reflectorAdjunction i).unit.app A)] : A ∈ i.essImage := by let η : 𝟭 C ⟶ reflector i ⋙ i := (reflectorAdjunction i).unit haveI : IsIso (η.app (i.obj ((reflector i).obj A))) := Functor.essImage.unit_isIso ((i.obj_mem_essImage _)) have : Epi (η.app A) := by refine @epi_of_epi _ _ _ _ _ (retraction (η.app A)) (η.app A) ?_ rw [show retraction _ ≫ η.app A = _ from η.naturality (retraction (η.app A))] apply epi_comp (η.app (i.obj ((reflector i).obj A))) haveI := isIso_of_epi_of_isSplitMono (η.app A) exact mem_essImage_of_unit_isIso (reflectorAdjunction i) A #align category_theory.mem_ess_image_of_unit_is_split_mono CategoryTheory.mem_essImage_of_unit_isSplitMono instance Reflective.comp (F : C ⥤ D) (G : D ⥤ E) [Reflective F] [Reflective G] : Reflective (F ⋙ G) where L := reflector G ⋙ reflector F adj := (reflectorAdjunction G).comp (reflectorAdjunction F) #align category_theory.reflective.comp CategoryTheory.Reflective.comp def unitCompPartialBijectiveAux [Reflective i] (A : C) (B : D) : (A ⟶ i.obj B) ≃ (i.obj ((reflector i).obj A) ⟶ i.obj B) := ((reflectorAdjunction i).homEquiv _ _).symm.trans (Functor.FullyFaithful.ofFullyFaithful i).homEquiv #align category_theory.unit_comp_partial_bijective_aux CategoryTheory.unitCompPartialBijectiveAux theorem unitCompPartialBijectiveAux_symm_apply [Reflective i] {A : C} {B : D} (f : i.obj ((reflector i).obj A) ⟶ i.obj B) : (unitCompPartialBijectiveAux _ _).symm f = (reflectorAdjunction i).unit.app A ≫ f := by simp [unitCompPartialBijectiveAux] #align category_theory.unit_comp_partial_bijective_aux_symm_apply CategoryTheory.unitCompPartialBijectiveAux_symm_apply def unitCompPartialBijective [Reflective i] (A : C) {B : C} (hB : B ∈ i.essImage) : (A ⟶ B) ≃ (i.obj ((reflector i).obj A) ⟶ B) := calc (A ⟶ B) ≃ (A ⟶ i.obj (Functor.essImage.witness hB)) := Iso.homCongr (Iso.refl _) hB.getIso.symm _ ≃ (i.obj _ ⟶ i.obj (Functor.essImage.witness hB)) := unitCompPartialBijectiveAux _ _ _ ≃ (i.obj ((reflector i).obj A) ⟶ B) := Iso.homCongr (Iso.refl _) (Functor.essImage.getIso hB) #align category_theory.unit_comp_partial_bijective CategoryTheory.unitCompPartialBijective @[simp]
Mathlib/CategoryTheory/Adjunction/Reflective.lean
154
156
theorem unitCompPartialBijective_symm_apply [Reflective i] (A : C) {B : C} (hB : B ∈ i.essImage) (f) : (unitCompPartialBijective A hB).symm f = (reflectorAdjunction i).unit.app A ≫ f := by
simp [unitCompPartialBijective, unitCompPartialBijectiveAux_symm_apply]
312
import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Adjunction.Reflective #align_import algebraic_geometry.Gamma_Spec_adjunction from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section universe u open PrimeSpectrum namespace AlgebraicGeometry open Opposite open CategoryTheory open StructureSheaf open Spec (structureSheaf) open TopologicalSpace open AlgebraicGeometry.LocallyRingedSpace open TopCat.Presheaf open TopCat.Presheaf.SheafCondition namespace LocallyRingedSpace variable (X : LocallyRingedSpace.{u}) def ΓToStalk (x : X) : Γ.obj (op X) ⟶ X.presheaf.stalk x := X.presheaf.germ (⟨x, trivial⟩ : (⊤ : Opens X)) #align algebraic_geometry.LocallyRingedSpace.Γ_to_stalk AlgebraicGeometry.LocallyRingedSpace.ΓToStalk def toΓSpecFun : X → PrimeSpectrum (Γ.obj (op X)) := fun x => comap (X.ΓToStalk x) (LocalRing.closedPoint (X.presheaf.stalk x)) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_fun AlgebraicGeometry.LocallyRingedSpace.toΓSpecFun
Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean
77
79
theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) : r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.ΓToStalk x r) := by
erw [LocalRing.mem_maximalIdeal, Classical.not_not]
313
import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Adjunction.Reflective #align_import algebraic_geometry.Gamma_Spec_adjunction from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section universe u open PrimeSpectrum namespace AlgebraicGeometry open Opposite open CategoryTheory open StructureSheaf open Spec (structureSheaf) open TopologicalSpace open AlgebraicGeometry.LocallyRingedSpace open TopCat.Presheaf open TopCat.Presheaf.SheafCondition namespace LocallyRingedSpace variable (X : LocallyRingedSpace.{u}) def ΓToStalk (x : X) : Γ.obj (op X) ⟶ X.presheaf.stalk x := X.presheaf.germ (⟨x, trivial⟩ : (⊤ : Opens X)) #align algebraic_geometry.LocallyRingedSpace.Γ_to_stalk AlgebraicGeometry.LocallyRingedSpace.ΓToStalk def toΓSpecFun : X → PrimeSpectrum (Γ.obj (op X)) := fun x => comap (X.ΓToStalk x) (LocalRing.closedPoint (X.presheaf.stalk x)) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_fun AlgebraicGeometry.LocallyRingedSpace.toΓSpecFun theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) : r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.ΓToStalk x r) := by erw [LocalRing.mem_maximalIdeal, Classical.not_not] #align algebraic_geometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk AlgebraicGeometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk
Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean
84
87
theorem toΓSpec_preim_basicOpen_eq (r : Γ.obj (op X)) : X.toΓSpecFun ⁻¹' (basicOpen r).1 = (X.toRingedSpace.basicOpen r).1 := by
ext erw [X.toRingedSpace.mem_top_basicOpen]; apply not_mem_prime_iff_unit_in_stalk
313
import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Adjunction.Reflective #align_import algebraic_geometry.Gamma_Spec_adjunction from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section universe u open PrimeSpectrum namespace AlgebraicGeometry open Opposite open CategoryTheory open StructureSheaf open Spec (structureSheaf) open TopologicalSpace open AlgebraicGeometry.LocallyRingedSpace open TopCat.Presheaf open TopCat.Presheaf.SheafCondition namespace LocallyRingedSpace variable (X : LocallyRingedSpace.{u}) def ΓToStalk (x : X) : Γ.obj (op X) ⟶ X.presheaf.stalk x := X.presheaf.germ (⟨x, trivial⟩ : (⊤ : Opens X)) #align algebraic_geometry.LocallyRingedSpace.Γ_to_stalk AlgebraicGeometry.LocallyRingedSpace.ΓToStalk def toΓSpecFun : X → PrimeSpectrum (Γ.obj (op X)) := fun x => comap (X.ΓToStalk x) (LocalRing.closedPoint (X.presheaf.stalk x)) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_fun AlgebraicGeometry.LocallyRingedSpace.toΓSpecFun theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) : r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.ΓToStalk x r) := by erw [LocalRing.mem_maximalIdeal, Classical.not_not] #align algebraic_geometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk AlgebraicGeometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk theorem toΓSpec_preim_basicOpen_eq (r : Γ.obj (op X)) : X.toΓSpecFun ⁻¹' (basicOpen r).1 = (X.toRingedSpace.basicOpen r).1 := by ext erw [X.toRingedSpace.mem_top_basicOpen]; apply not_mem_prime_iff_unit_in_stalk #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_preim_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpec_preim_basicOpen_eq
Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean
91
95
theorem toΓSpec_continuous : Continuous X.toΓSpecFun := by
rw [isTopologicalBasis_basic_opens.continuous_iff] rintro _ ⟨r, rfl⟩ erw [X.toΓSpec_preim_basicOpen_eq r] exact (X.toRingedSpace.basicOpen r).2
313
import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Adjunction.Reflective #align_import algebraic_geometry.Gamma_Spec_adjunction from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section universe u open PrimeSpectrum namespace AlgebraicGeometry open Opposite open CategoryTheory open StructureSheaf open Spec (structureSheaf) open TopologicalSpace open AlgebraicGeometry.LocallyRingedSpace open TopCat.Presheaf open TopCat.Presheaf.SheafCondition namespace LocallyRingedSpace variable (X : LocallyRingedSpace.{u}) def ΓToStalk (x : X) : Γ.obj (op X) ⟶ X.presheaf.stalk x := X.presheaf.germ (⟨x, trivial⟩ : (⊤ : Opens X)) #align algebraic_geometry.LocallyRingedSpace.Γ_to_stalk AlgebraicGeometry.LocallyRingedSpace.ΓToStalk def toΓSpecFun : X → PrimeSpectrum (Γ.obj (op X)) := fun x => comap (X.ΓToStalk x) (LocalRing.closedPoint (X.presheaf.stalk x)) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_fun AlgebraicGeometry.LocallyRingedSpace.toΓSpecFun theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) : r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.ΓToStalk x r) := by erw [LocalRing.mem_maximalIdeal, Classical.not_not] #align algebraic_geometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk AlgebraicGeometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk theorem toΓSpec_preim_basicOpen_eq (r : Γ.obj (op X)) : X.toΓSpecFun ⁻¹' (basicOpen r).1 = (X.toRingedSpace.basicOpen r).1 := by ext erw [X.toRingedSpace.mem_top_basicOpen]; apply not_mem_prime_iff_unit_in_stalk #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_preim_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpec_preim_basicOpen_eq theorem toΓSpec_continuous : Continuous X.toΓSpecFun := by rw [isTopologicalBasis_basic_opens.continuous_iff] rintro _ ⟨r, rfl⟩ erw [X.toΓSpec_preim_basicOpen_eq r] exact (X.toRingedSpace.basicOpen r).2 #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_continuous AlgebraicGeometry.LocallyRingedSpace.toΓSpec_continuous @[simps] def toΓSpecBase : X.toTopCat ⟶ Spec.topObj (Γ.obj (op X)) where toFun := X.toΓSpecFun continuous_toFun := X.toΓSpec_continuous #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_base AlgebraicGeometry.LocallyRingedSpace.toΓSpecBase -- These lemmas have always been bad (#7657), but lean4#2644 made `simp` start noticing attribute [nolint simpNF] AlgebraicGeometry.LocallyRingedSpace.toΓSpecBase_apply variable (r : Γ.obj (op X)) abbrev toΓSpecMapBasicOpen : Opens X := (Opens.map X.toΓSpecBase).obj (basicOpen r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.toΓSpecMapBasicOpen theorem toΓSpecMapBasicOpen_eq : X.toΓSpecMapBasicOpen r = X.toRingedSpace.basicOpen r := Opens.ext (X.toΓSpec_preim_basicOpen_eq r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_map_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpecMapBasicOpen_eq abbrev toToΓSpecMapBasicOpen : X.presheaf.obj (op ⊤) ⟶ X.presheaf.obj (op <| X.toΓSpecMapBasicOpen r) := X.presheaf.map (X.toΓSpecMapBasicOpen r).leTop.op #align algebraic_geometry.LocallyRingedSpace.to_to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.toToΓSpecMapBasicOpen
Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean
128
134
theorem isUnit_res_toΓSpecMapBasicOpen : IsUnit (X.toToΓSpecMapBasicOpen r r) := by
convert (X.presheaf.map <| (eqToHom <| X.toΓSpecMapBasicOpen_eq r).op).isUnit_map (X.toRingedSpace.isUnit_res_basicOpen r) -- Porting note: `rw [comp_apply]` to `erw [comp_apply]` erw [← comp_apply, ← Functor.map_comp] congr
313
import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Adjunction.Reflective #align_import algebraic_geometry.Gamma_Spec_adjunction from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section universe u open PrimeSpectrum namespace AlgebraicGeometry open Opposite open CategoryTheory open StructureSheaf open Spec (structureSheaf) open TopologicalSpace open AlgebraicGeometry.LocallyRingedSpace open TopCat.Presheaf open TopCat.Presheaf.SheafCondition namespace LocallyRingedSpace variable (X : LocallyRingedSpace.{u}) def ΓToStalk (x : X) : Γ.obj (op X) ⟶ X.presheaf.stalk x := X.presheaf.germ (⟨x, trivial⟩ : (⊤ : Opens X)) #align algebraic_geometry.LocallyRingedSpace.Γ_to_stalk AlgebraicGeometry.LocallyRingedSpace.ΓToStalk def toΓSpecFun : X → PrimeSpectrum (Γ.obj (op X)) := fun x => comap (X.ΓToStalk x) (LocalRing.closedPoint (X.presheaf.stalk x)) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_fun AlgebraicGeometry.LocallyRingedSpace.toΓSpecFun theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) : r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.ΓToStalk x r) := by erw [LocalRing.mem_maximalIdeal, Classical.not_not] #align algebraic_geometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk AlgebraicGeometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk theorem toΓSpec_preim_basicOpen_eq (r : Γ.obj (op X)) : X.toΓSpecFun ⁻¹' (basicOpen r).1 = (X.toRingedSpace.basicOpen r).1 := by ext erw [X.toRingedSpace.mem_top_basicOpen]; apply not_mem_prime_iff_unit_in_stalk #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_preim_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpec_preim_basicOpen_eq theorem toΓSpec_continuous : Continuous X.toΓSpecFun := by rw [isTopologicalBasis_basic_opens.continuous_iff] rintro _ ⟨r, rfl⟩ erw [X.toΓSpec_preim_basicOpen_eq r] exact (X.toRingedSpace.basicOpen r).2 #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_continuous AlgebraicGeometry.LocallyRingedSpace.toΓSpec_continuous @[simps] def toΓSpecBase : X.toTopCat ⟶ Spec.topObj (Γ.obj (op X)) where toFun := X.toΓSpecFun continuous_toFun := X.toΓSpec_continuous #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_base AlgebraicGeometry.LocallyRingedSpace.toΓSpecBase -- These lemmas have always been bad (#7657), but lean4#2644 made `simp` start noticing attribute [nolint simpNF] AlgebraicGeometry.LocallyRingedSpace.toΓSpecBase_apply variable (r : Γ.obj (op X)) abbrev toΓSpecMapBasicOpen : Opens X := (Opens.map X.toΓSpecBase).obj (basicOpen r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.toΓSpecMapBasicOpen theorem toΓSpecMapBasicOpen_eq : X.toΓSpecMapBasicOpen r = X.toRingedSpace.basicOpen r := Opens.ext (X.toΓSpec_preim_basicOpen_eq r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_map_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpecMapBasicOpen_eq abbrev toToΓSpecMapBasicOpen : X.presheaf.obj (op ⊤) ⟶ X.presheaf.obj (op <| X.toΓSpecMapBasicOpen r) := X.presheaf.map (X.toΓSpecMapBasicOpen r).leTop.op #align algebraic_geometry.LocallyRingedSpace.to_to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.toToΓSpecMapBasicOpen theorem isUnit_res_toΓSpecMapBasicOpen : IsUnit (X.toToΓSpecMapBasicOpen r r) := by convert (X.presheaf.map <| (eqToHom <| X.toΓSpecMapBasicOpen_eq r).op).isUnit_map (X.toRingedSpace.isUnit_res_basicOpen r) -- Porting note: `rw [comp_apply]` to `erw [comp_apply]` erw [← comp_apply, ← Functor.map_comp] congr #align algebraic_geometry.LocallyRingedSpace.is_unit_res_to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.isUnit_res_toΓSpecMapBasicOpen def toΓSpecCApp : (structureSheaf <| Γ.obj <| op X).val.obj (op <| basicOpen r) ⟶ X.presheaf.obj (op <| X.toΓSpecMapBasicOpen r) := IsLocalization.Away.lift r (isUnit_res_toΓSpecMapBasicOpen _ r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_c_app AlgebraicGeometry.LocallyRingedSpace.toΓSpecCApp
Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean
146
160
theorem toΓSpecCApp_iff (f : (structureSheaf <| Γ.obj <| op X).val.obj (op <| basicOpen r) ⟶ X.presheaf.obj (op <| X.toΓSpecMapBasicOpen r)) : toOpen _ (basicOpen r) ≫ f = X.toToΓSpecMapBasicOpen r ↔ f = X.toΓSpecCApp r := by
-- Porting Note: Type class problem got stuck in `IsLocalization.Away.AwayMap.lift_comp` -- created instance manually. This replaces the `pick_goal` tactics have loc_inst := IsLocalization.to_basicOpen (Γ.obj (op X)) r rw [← @IsLocalization.Away.AwayMap.lift_comp _ _ _ _ _ _ _ r loc_inst _ (X.isUnit_res_toΓSpecMapBasicOpen r)] --pick_goal 5; exact is_localization.to_basic_open _ r constructor · intro h exact IsLocalization.ringHom_ext (Submonoid.powers r) h apply congr_arg
313
import Mathlib.Algebra.Group.Even import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.GroupWithZero.Hom import Mathlib.Algebra.Group.Commute.Units import Mathlib.Algebra.Group.Units.Hom import Mathlib.Algebra.Order.Monoid.Canonical.Defs import Mathlib.Algebra.Ring.Units #align_import algebra.associated from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4" variable {α : Type*} {β : Type*} {γ : Type*} {δ : Type*} section Prime variable [CommMonoidWithZero α] def Prime (p : α) : Prop := p ≠ 0 ∧ ¬IsUnit p ∧ ∀ a b, p ∣ a * b → p ∣ a ∨ p ∣ b #align prime Prime namespace Prime variable {p : α} (hp : Prime p) theorem ne_zero : p ≠ 0 := hp.1 #align prime.ne_zero Prime.ne_zero theorem not_unit : ¬IsUnit p := hp.2.1 #align prime.not_unit Prime.not_unit theorem not_dvd_one : ¬p ∣ 1 := mt (isUnit_of_dvd_one ·) hp.not_unit #align prime.not_dvd_one Prime.not_dvd_one theorem ne_one : p ≠ 1 := fun h => hp.2.1 (h.symm ▸ isUnit_one) #align prime.ne_one Prime.ne_one theorem dvd_or_dvd (hp : Prime p) {a b : α} (h : p ∣ a * b) : p ∣ a ∨ p ∣ b := hp.2.2 a b h #align prime.dvd_or_dvd Prime.dvd_or_dvd theorem dvd_mul {a b : α} : p ∣ a * b ↔ p ∣ a ∨ p ∣ b := ⟨hp.dvd_or_dvd, (Or.elim · (dvd_mul_of_dvd_left · _) (dvd_mul_of_dvd_right · _))⟩ theorem isPrimal (hp : Prime p) : IsPrimal p := fun _a _b dvd ↦ (hp.dvd_or_dvd dvd).elim (fun h ↦ ⟨p, 1, h, one_dvd _, (mul_one p).symm⟩) fun h ↦ ⟨1, p, one_dvd _, h, (one_mul p).symm⟩ theorem not_dvd_mul {a b : α} (ha : ¬ p ∣ a) (hb : ¬ p ∣ b) : ¬ p ∣ a * b := hp.dvd_mul.not.mpr <| not_or.mpr ⟨ha, hb⟩
Mathlib/Algebra/Associated.lean
77
86
theorem dvd_of_dvd_pow (hp : Prime p) {a : α} {n : ℕ} (h : p ∣ a ^ n) : p ∣ a := by
induction' n with n ih · rw [pow_zero] at h have := isUnit_of_dvd_one h have := not_unit hp contradiction rw [pow_succ'] at h cases' dvd_or_dvd hp h with dvd_a dvd_pow · assumption exact ih dvd_pow
314
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
48
55
theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by
induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m')
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m')
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
57
63
theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by
induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H ..
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
80
81
theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by
induction l <;> simp [*]
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H .. theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by induction l <;> simp [*] theorem Pairwise.and_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.imp_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true })
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
91
102
theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l) (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y := by
induction l with | nil => exact forall_mem_nil _ | cons a l ih => rw [pairwise_cons] at h₂ h₃ simp only [mem_cons] rintro x (rfl | hx) y (rfl | hy) · exact h₁ _ (l.mem_cons_self _) · exact h₂.1 _ hy · exact h₃.1 _ hx · exact ih (fun x hx => h₁ _ <| mem_cons_of_mem _ hx) h₂.2 h₃.2 hx hy
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H .. theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by induction l <;> simp [*] theorem Pairwise.and_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.imp_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l) (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y := by induction l with | nil => exact forall_mem_nil _ | cons a l ih => rw [pairwise_cons] at h₂ h₃ simp only [mem_cons] rintro x (rfl | hx) y (rfl | hy) · exact h₁ _ (l.mem_cons_self _) · exact h₂.1 _ hy · exact h₃.1 _ hx · exact ih (fun x hx => h₁ _ <| mem_cons_of_mem _ hx) h₂.2 h₃.2 hx hy
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
104
104
theorem pairwise_singleton (R) (a : α) : Pairwise R [a] := by
simp
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H .. theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by induction l <;> simp [*] theorem Pairwise.and_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.imp_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l) (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y := by induction l with | nil => exact forall_mem_nil _ | cons a l ih => rw [pairwise_cons] at h₂ h₃ simp only [mem_cons] rintro x (rfl | hx) y (rfl | hy) · exact h₁ _ (l.mem_cons_self _) · exact h₂.1 _ hy · exact h₃.1 _ hx · exact ih (fun x hx => h₁ _ <| mem_cons_of_mem _ hx) h₂.2 h₃.2 hx hy theorem pairwise_singleton (R) (a : α) : Pairwise R [a] := by simp
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
106
106
theorem pairwise_pair {a b : α} : Pairwise R [a, b] ↔ R a b := by
simp
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H .. theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by induction l <;> simp [*] theorem Pairwise.and_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.imp_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l) (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y := by induction l with | nil => exact forall_mem_nil _ | cons a l ih => rw [pairwise_cons] at h₂ h₃ simp only [mem_cons] rintro x (rfl | hx) y (rfl | hy) · exact h₁ _ (l.mem_cons_self _) · exact h₂.1 _ hy · exact h₃.1 _ hx · exact ih (fun x hx => h₁ _ <| mem_cons_of_mem _ hx) h₂.2 h₃.2 hx hy theorem pairwise_singleton (R) (a : α) : Pairwise R [a] := by simp theorem pairwise_pair {a b : α} : Pairwise R [a, b] ↔ R a b := by simp
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
108
112
theorem pairwise_append_comm {R : α → α → Prop} (s : ∀ {x y}, R x y → R y x) {l₁ l₂ : List α} : Pairwise R (l₁ ++ l₂) ↔ Pairwise R (l₂ ++ l₁) := by
have (l₁ l₂ : List α) (H : ∀ x : α, x ∈ l₁ → ∀ y : α, y ∈ l₂ → R x y) (x : α) (xm : x ∈ l₂) (y : α) (ym : y ∈ l₁) : R x y := s (H y ym x xm) simp only [pairwise_append, and_left_comm]; rw [Iff.intro (this l₁ l₂) (this l₂ l₁)]
315
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H .. theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by induction l <;> simp [*] theorem Pairwise.and_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.imp_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l) (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y := by induction l with | nil => exact forall_mem_nil _ | cons a l ih => rw [pairwise_cons] at h₂ h₃ simp only [mem_cons] rintro x (rfl | hx) y (rfl | hy) · exact h₁ _ (l.mem_cons_self _) · exact h₂.1 _ hy · exact h₃.1 _ hx · exact ih (fun x hx => h₁ _ <| mem_cons_of_mem _ hx) h₂.2 h₃.2 hx hy theorem pairwise_singleton (R) (a : α) : Pairwise R [a] := by simp theorem pairwise_pair {a b : α} : Pairwise R [a, b] ↔ R a b := by simp theorem pairwise_append_comm {R : α → α → Prop} (s : ∀ {x y}, R x y → R y x) {l₁ l₂ : List α} : Pairwise R (l₁ ++ l₂) ↔ Pairwise R (l₂ ++ l₁) := by have (l₁ l₂ : List α) (H : ∀ x : α, x ∈ l₁ → ∀ y : α, y ∈ l₂ → R x y) (x : α) (xm : x ∈ l₂) (y : α) (ym : y ∈ l₁) : R x y := s (H y ym x xm) simp only [pairwise_append, and_left_comm]; rw [Iff.intro (this l₁ l₂) (this l₂ l₁)]
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
114
118
theorem pairwise_middle {R : α → α → Prop} (s : ∀ {x y}, R x y → R y x) {a : α} {l₁ l₂ : List α} : Pairwise R (l₁ ++ a :: l₂) ↔ Pairwise R (a :: (l₁ ++ l₂)) := by
show Pairwise R (l₁ ++ ([a] ++ l₂)) ↔ Pairwise R ([a] ++ l₁ ++ l₂) rw [← append_assoc, pairwise_append, @pairwise_append _ _ ([a] ++ l₁), pairwise_append_comm s] simp only [mem_append, or_comm]
315
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem Monotone.map_sSup_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sSup A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddAbove A := by bddDefault) : f (sSup A) = sSup (f '' A) := --This is a particular case of the more general `IsLUB.isLUB_of_tendsto` .symm <| ((isLUB_csSup A_nonemp A_bdd).isLUB_of_tendsto (Mf.monotoneOn _) A_nonemp <| Cf.mono_left inf_le_left).csSup_eq (A_nonemp.image f) #align monotone.map_Sup_of_continuous_at' Monotone.map_sSup_of_continuousAt'
Mathlib/Topology/Order/Monotone.lean
41
45
theorem Monotone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iSup g)) (Mf : Monotone f) (bdd : BddAbove (range g) := by
bddDefault) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [iSup, Monotone.map_sSup_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iSup] rfl
316
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem Monotone.map_sSup_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sSup A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddAbove A := by bddDefault) : f (sSup A) = sSup (f '' A) := --This is a particular case of the more general `IsLUB.isLUB_of_tendsto` .symm <| ((isLUB_csSup A_nonemp A_bdd).isLUB_of_tendsto (Mf.monotoneOn _) A_nonemp <| Cf.mono_left inf_le_left).csSup_eq (A_nonemp.image f) #align monotone.map_Sup_of_continuous_at' Monotone.map_sSup_of_continuousAt' theorem Monotone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iSup g)) (Mf : Monotone f) (bdd : BddAbove (range g) := by bddDefault) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [iSup, Monotone.map_sSup_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iSup] rfl #align monotone.map_supr_of_continuous_at' Monotone.map_iSup_of_continuousAt' theorem Monotone.map_sInf_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sInf A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddBelow A := by bddDefault) : f (sInf A) = sInf (f '' A) := Monotone.map_sSup_of_continuousAt' (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual A_nonemp A_bdd #align monotone.map_Inf_of_continuous_at' Monotone.map_sInf_of_continuousAt'
Mathlib/Topology/Order/Monotone.lean
58
62
theorem Monotone.map_iInf_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iInf g)) (Mf : Monotone f) (bdd : BddBelow (range g) := by
bddDefault) : f (⨅ i, g i) = ⨅ i, f (g i) := by rw [iInf, Monotone.map_sInf_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iInf] rfl
316
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem Monotone.map_sSup_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sSup A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddAbove A := by bddDefault) : f (sSup A) = sSup (f '' A) := --This is a particular case of the more general `IsLUB.isLUB_of_tendsto` .symm <| ((isLUB_csSup A_nonemp A_bdd).isLUB_of_tendsto (Mf.monotoneOn _) A_nonemp <| Cf.mono_left inf_le_left).csSup_eq (A_nonemp.image f) #align monotone.map_Sup_of_continuous_at' Monotone.map_sSup_of_continuousAt' theorem Monotone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iSup g)) (Mf : Monotone f) (bdd : BddAbove (range g) := by bddDefault) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [iSup, Monotone.map_sSup_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iSup] rfl #align monotone.map_supr_of_continuous_at' Monotone.map_iSup_of_continuousAt' theorem Monotone.map_sInf_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sInf A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddBelow A := by bddDefault) : f (sInf A) = sInf (f '' A) := Monotone.map_sSup_of_continuousAt' (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual A_nonemp A_bdd #align monotone.map_Inf_of_continuous_at' Monotone.map_sInf_of_continuousAt' theorem Monotone.map_iInf_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iInf g)) (Mf : Monotone f) (bdd : BddBelow (range g) := by bddDefault) : f (⨅ i, g i) = ⨅ i, f (g i) := by rw [iInf, Monotone.map_sInf_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iInf] rfl #align monotone.map_infi_of_continuous_at' Monotone.map_iInf_of_continuousAt' theorem Antitone.map_sInf_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sInf A)) (Af : Antitone f) (A_nonemp : A.Nonempty) (A_bdd : BddBelow A := by bddDefault) : f (sInf A) = sSup (f '' A) := Monotone.map_sInf_of_continuousAt' (β := βᵒᵈ) Cf Af.dual_right A_nonemp A_bdd #align antitone.map_Inf_of_continuous_at' Antitone.map_sInf_of_continuousAt'
Mathlib/Topology/Order/Monotone.lean
75
79
theorem Antitone.map_iInf_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iInf g)) (Af : Antitone f) (bdd : BddBelow (range g) := by
bddDefault) : f (⨅ i, g i) = ⨆ i, f (g i) := by rw [iInf, Antitone.map_sInf_of_continuousAt' Cf Af (range_nonempty g) bdd, ← range_comp, iSup] rfl
316
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem Monotone.map_sSup_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sSup A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddAbove A := by bddDefault) : f (sSup A) = sSup (f '' A) := --This is a particular case of the more general `IsLUB.isLUB_of_tendsto` .symm <| ((isLUB_csSup A_nonemp A_bdd).isLUB_of_tendsto (Mf.monotoneOn _) A_nonemp <| Cf.mono_left inf_le_left).csSup_eq (A_nonemp.image f) #align monotone.map_Sup_of_continuous_at' Monotone.map_sSup_of_continuousAt' theorem Monotone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iSup g)) (Mf : Monotone f) (bdd : BddAbove (range g) := by bddDefault) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [iSup, Monotone.map_sSup_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iSup] rfl #align monotone.map_supr_of_continuous_at' Monotone.map_iSup_of_continuousAt' theorem Monotone.map_sInf_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sInf A)) (Mf : Monotone f) (A_nonemp : A.Nonempty) (A_bdd : BddBelow A := by bddDefault) : f (sInf A) = sInf (f '' A) := Monotone.map_sSup_of_continuousAt' (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual A_nonemp A_bdd #align monotone.map_Inf_of_continuous_at' Monotone.map_sInf_of_continuousAt' theorem Monotone.map_iInf_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iInf g)) (Mf : Monotone f) (bdd : BddBelow (range g) := by bddDefault) : f (⨅ i, g i) = ⨅ i, f (g i) := by rw [iInf, Monotone.map_sInf_of_continuousAt' Cf Mf (range_nonempty g) bdd, ← range_comp, iInf] rfl #align monotone.map_infi_of_continuous_at' Monotone.map_iInf_of_continuousAt' theorem Antitone.map_sInf_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sInf A)) (Af : Antitone f) (A_nonemp : A.Nonempty) (A_bdd : BddBelow A := by bddDefault) : f (sInf A) = sSup (f '' A) := Monotone.map_sInf_of_continuousAt' (β := βᵒᵈ) Cf Af.dual_right A_nonemp A_bdd #align antitone.map_Inf_of_continuous_at' Antitone.map_sInf_of_continuousAt' theorem Antitone.map_iInf_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iInf g)) (Af : Antitone f) (bdd : BddBelow (range g) := by bddDefault) : f (⨅ i, g i) = ⨆ i, f (g i) := by rw [iInf, Antitone.map_sInf_of_continuousAt' Cf Af (range_nonempty g) bdd, ← range_comp, iSup] rfl #align antitone.map_infi_of_continuous_at' Antitone.map_iInf_of_continuousAt' theorem Antitone.map_sSup_of_continuousAt' {f : α → β} {A : Set α} (Cf : ContinuousAt f (sSup A)) (Af : Antitone f) (A_nonemp : A.Nonempty) (A_bdd : BddAbove A := by bddDefault) : f (sSup A) = sInf (f '' A) := Monotone.map_sSup_of_continuousAt' (β := βᵒᵈ) Cf Af.dual_right A_nonemp A_bdd #align antitone.map_Sup_of_continuous_at' Antitone.map_sSup_of_continuousAt'
Mathlib/Topology/Order/Monotone.lean
92
96
theorem Antitone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α} (Cf : ContinuousAt f (iSup g)) (Af : Antitone f) (bdd : BddAbove (range g) := by
bddDefault) : f (⨆ i, g i) = ⨅ i, f (g i) := by rw [iSup, Antitone.map_sSup_of_continuousAt' Cf Af (range_nonempty g) bdd, ← range_comp, iInf] rfl
316
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem csSup_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ closure s := (isLUB_csSup hs B).mem_closure hs #align cSup_mem_closure csSup_mem_closure theorem csInf_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ closure s := (isGLB_csInf hs B).mem_closure hs #align cInf_mem_closure csInf_mem_closure theorem IsClosed.csSup_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ s := (isLUB_csSup hs B).mem_of_isClosed hs hc #align is_closed.cSup_mem IsClosed.csSup_mem theorem IsClosed.csInf_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ s := (isGLB_csInf hs B).mem_of_isClosed hs hc #align is_closed.cInf_mem IsClosed.csInf_mem theorem IsClosed.isLeast_csInf {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : IsLeast s (sInf s) := ⟨hc.csInf_mem hs B, (isGLB_csInf hs B).1⟩ theorem IsClosed.isGreatest_csSup {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : IsGreatest s (sSup s) := IsClosed.isLeast_csInf (α := αᵒᵈ) hc hs B
Mathlib/Topology/Order/Monotone.lean
221
225
theorem Monotone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s)) (Mf : Monotone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sSup (f '' s) := by
refine ((isLUB_csSup (ne.image f) (Mf.map_bddAbove H)).unique ?_).symm refine (isLUB_csSup ne H).isLUB_of_tendsto (fun x _ y _ xy => Mf xy) ne ?_ exact Cf.mono_left inf_le_left
316
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem csSup_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ closure s := (isLUB_csSup hs B).mem_closure hs #align cSup_mem_closure csSup_mem_closure theorem csInf_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ closure s := (isGLB_csInf hs B).mem_closure hs #align cInf_mem_closure csInf_mem_closure theorem IsClosed.csSup_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ s := (isLUB_csSup hs B).mem_of_isClosed hs hc #align is_closed.cSup_mem IsClosed.csSup_mem theorem IsClosed.csInf_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ s := (isGLB_csInf hs B).mem_of_isClosed hs hc #align is_closed.cInf_mem IsClosed.csInf_mem theorem IsClosed.isLeast_csInf {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : IsLeast s (sInf s) := ⟨hc.csInf_mem hs B, (isGLB_csInf hs B).1⟩ theorem IsClosed.isGreatest_csSup {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : IsGreatest s (sSup s) := IsClosed.isLeast_csInf (α := αᵒᵈ) hc hs B theorem Monotone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s)) (Mf : Monotone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sSup (f '' s) := by refine ((isLUB_csSup (ne.image f) (Mf.map_bddAbove H)).unique ?_).symm refine (isLUB_csSup ne H).isLUB_of_tendsto (fun x _ y _ xy => Mf xy) ne ?_ exact Cf.mono_left inf_le_left #align monotone.map_cSup_of_continuous_at Monotone.map_csSup_of_continuousAt
Mathlib/Topology/Order/Monotone.lean
230
232
theorem Monotone.map_ciSup_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨆ i, g i)) (Mf : Monotone f) (H : BddAbove (range g)) : f (⨆ i, g i) = ⨆ i, f (g i) := by
rw [iSup, Mf.map_csSup_of_continuousAt Cf (range_nonempty _) H, ← range_comp, iSup]; rfl
316
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderClosedTopology β] [Nonempty γ] theorem csSup_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ closure s := (isLUB_csSup hs B).mem_closure hs #align cSup_mem_closure csSup_mem_closure theorem csInf_mem_closure {s : Set α} (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ closure s := (isGLB_csInf hs B).mem_closure hs #align cInf_mem_closure csInf_mem_closure theorem IsClosed.csSup_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : sSup s ∈ s := (isLUB_csSup hs B).mem_of_isClosed hs hc #align is_closed.cSup_mem IsClosed.csSup_mem theorem IsClosed.csInf_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : sInf s ∈ s := (isGLB_csInf hs B).mem_of_isClosed hs hc #align is_closed.cInf_mem IsClosed.csInf_mem theorem IsClosed.isLeast_csInf {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) : IsLeast s (sInf s) := ⟨hc.csInf_mem hs B, (isGLB_csInf hs B).1⟩ theorem IsClosed.isGreatest_csSup {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) : IsGreatest s (sSup s) := IsClosed.isLeast_csInf (α := αᵒᵈ) hc hs B theorem Monotone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s)) (Mf : Monotone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sSup (f '' s) := by refine ((isLUB_csSup (ne.image f) (Mf.map_bddAbove H)).unique ?_).symm refine (isLUB_csSup ne H).isLUB_of_tendsto (fun x _ y _ xy => Mf xy) ne ?_ exact Cf.mono_left inf_le_left #align monotone.map_cSup_of_continuous_at Monotone.map_csSup_of_continuousAt theorem Monotone.map_ciSup_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨆ i, g i)) (Mf : Monotone f) (H : BddAbove (range g)) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [iSup, Mf.map_csSup_of_continuousAt Cf (range_nonempty _) H, ← range_comp, iSup]; rfl #align monotone.map_csupr_of_continuous_at Monotone.map_ciSup_of_continuousAt theorem Monotone.map_csInf_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sInf s)) (Mf : Monotone f) (ne : s.Nonempty) (H : BddBelow s) : f (sInf s) = sInf (f '' s) := Monotone.map_csSup_of_continuousAt (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual ne H #align monotone.map_cInf_of_continuous_at Monotone.map_csInf_of_continuousAt theorem Monotone.map_ciInf_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨅ i, g i)) (Mf : Monotone f) (H : BddBelow (range g)) : f (⨅ i, g i) = ⨅ i, f (g i) := Monotone.map_ciSup_of_continuousAt (α := αᵒᵈ) (β := βᵒᵈ) Cf Mf.dual H #align monotone.map_cinfi_of_continuous_at Monotone.map_ciInf_of_continuousAt theorem Antitone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s)) (Af : Antitone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sInf (f '' s) := Monotone.map_csSup_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (sSup s) from Cf) Af ne H #align antitone.map_cSup_of_continuous_at Antitone.map_csSup_of_continuousAt theorem Antitone.map_ciSup_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨆ i, g i)) (Af : Antitone f) (H : BddAbove (range g)) : f (⨆ i, g i) = ⨅ i, f (g i) := Monotone.map_ciSup_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (⨆ i, g i) from Cf) Af H #align antitone.map_csupr_of_continuous_at Antitone.map_ciSup_of_continuousAt theorem Antitone.map_csInf_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sInf s)) (Af : Antitone f) (ne : s.Nonempty) (H : BddBelow s) : f (sInf s) = sSup (f '' s) := Monotone.map_csInf_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (sInf s) from Cf) Af ne H #align antitone.map_cInf_of_continuous_at Antitone.map_csInf_of_continuousAt theorem Antitone.map_ciInf_of_continuousAt {f : α → β} {g : γ → α} (Cf : ContinuousAt f (⨅ i, g i)) (Af : Antitone f) (H : BddBelow (range g)) : f (⨅ i, g i) = ⨆ i, f (g i) := Monotone.map_ciInf_of_continuousAt (show ContinuousAt (OrderDual.toDual ∘ f) (⨅ i, g i) from Cf) Af H #align antitone.map_cinfi_of_continuous_at Antitone.map_ciInf_of_continuousAt
Mathlib/Topology/Order/Monotone.lean
282
292
theorem Monotone.tendsto_nhdsWithin_Iio {α β : Type*} [LinearOrder α] [TopologicalSpace α] [OrderTopology α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderTopology β] {f : α → β} (Mf : Monotone f) (x : α) : Tendsto f (𝓝[<] x) (𝓝 (sSup (f '' Iio x))) := by
rcases eq_empty_or_nonempty (Iio x) with (h | h); · simp [h] refine tendsto_order.2 ⟨fun l hl => ?_, fun m hm => ?_⟩ · obtain ⟨z, zx, lz⟩ : ∃ a : α, a < x ∧ l < f a := by simpa only [mem_image, exists_prop, exists_exists_and_eq_and] using exists_lt_of_lt_csSup (h.image _) hl exact mem_of_superset (Ioo_mem_nhdsWithin_Iio' zx) fun y hy => lz.trans_le (Mf hy.1.le) · refine mem_of_superset self_mem_nhdsWithin fun _ hy => lt_of_le_of_lt ?_ hm exact le_csSup (Mf.map_bddAbove bddAbove_Iio) (mem_image_of_mem _ hy)
316
import Mathlib.Topology.ContinuousOn #align_import topology.algebra.order.left_right from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Topology section PartialOrder variable {α β : Type*} [TopologicalSpace α] [PartialOrder α] [TopologicalSpace β]
Mathlib/Topology/Order/LeftRight.lean
95
97
theorem continuousWithinAt_Ioi_iff_Ici {a : α} {f : α → β} : ContinuousWithinAt f (Ioi a) a ↔ ContinuousWithinAt f (Ici a) a := by
simp only [← Ici_diff_left, continuousWithinAt_diff_self]
317
import Mathlib.Topology.ContinuousOn #align_import topology.algebra.order.left_right from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Topology section TopologicalSpace variable {α β : Type*} [TopologicalSpace α] [LinearOrder α] [TopologicalSpace β]
Mathlib/Topology/Order/LeftRight.lean
111
112
theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a := by
rw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ]
317
import Mathlib.Topology.ContinuousOn #align_import topology.algebra.order.left_right from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Topology section TopologicalSpace variable {α β : Type*} [TopologicalSpace α] [LinearOrder α] [TopologicalSpace β] theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ] #align nhds_left_sup_nhds_right nhds_left_sup_nhds_right
Mathlib/Topology/Order/LeftRight.lean
115
116
theorem nhds_left'_sup_nhds_right (a : α) : 𝓝[<] a ⊔ 𝓝[≥] a = 𝓝 a := by
rw [← nhdsWithin_union, Iio_union_Ici, nhdsWithin_univ]
317
import Mathlib.Topology.ContinuousOn #align_import topology.algebra.order.left_right from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Topology section TopologicalSpace variable {α β : Type*} [TopologicalSpace α] [LinearOrder α] [TopologicalSpace β] theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ] #align nhds_left_sup_nhds_right nhds_left_sup_nhds_right theorem nhds_left'_sup_nhds_right (a : α) : 𝓝[<] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iio_union_Ici, nhdsWithin_univ] #align nhds_left'_sup_nhds_right nhds_left'_sup_nhds_right
Mathlib/Topology/Order/LeftRight.lean
119
120
theorem nhds_left_sup_nhds_right' (a : α) : 𝓝[≤] a ⊔ 𝓝[>] a = 𝓝 a := by
rw [← nhdsWithin_union, Iic_union_Ioi, nhdsWithin_univ]
317
import Mathlib.Topology.ContinuousOn #align_import topology.algebra.order.left_right from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Topology section TopologicalSpace variable {α β : Type*} [TopologicalSpace α] [LinearOrder α] [TopologicalSpace β] theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ] #align nhds_left_sup_nhds_right nhds_left_sup_nhds_right theorem nhds_left'_sup_nhds_right (a : α) : 𝓝[<] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iio_union_Ici, nhdsWithin_univ] #align nhds_left'_sup_nhds_right nhds_left'_sup_nhds_right theorem nhds_left_sup_nhds_right' (a : α) : 𝓝[≤] a ⊔ 𝓝[>] a = 𝓝 a := by rw [← nhdsWithin_union, Iic_union_Ioi, nhdsWithin_univ] #align nhds_left_sup_nhds_right' nhds_left_sup_nhds_right'
Mathlib/Topology/Order/LeftRight.lean
123
124
theorem nhds_left'_sup_nhds_right' (a : α) : 𝓝[<] a ⊔ 𝓝[>] a = 𝓝[≠] a := by
rw [← nhdsWithin_union, Iio_union_Ioi]
317
import Mathlib.Topology.ContinuousOn #align_import topology.algebra.order.left_right from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Topology section TopologicalSpace variable {α β : Type*} [TopologicalSpace α] [LinearOrder α] [TopologicalSpace β] theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ] #align nhds_left_sup_nhds_right nhds_left_sup_nhds_right theorem nhds_left'_sup_nhds_right (a : α) : 𝓝[<] a ⊔ 𝓝[≥] a = 𝓝 a := by rw [← nhdsWithin_union, Iio_union_Ici, nhdsWithin_univ] #align nhds_left'_sup_nhds_right nhds_left'_sup_nhds_right theorem nhds_left_sup_nhds_right' (a : α) : 𝓝[≤] a ⊔ 𝓝[>] a = 𝓝 a := by rw [← nhdsWithin_union, Iic_union_Ioi, nhdsWithin_univ] #align nhds_left_sup_nhds_right' nhds_left_sup_nhds_right' theorem nhds_left'_sup_nhds_right' (a : α) : 𝓝[<] a ⊔ 𝓝[>] a = 𝓝[≠] a := by rw [← nhdsWithin_union, Iio_union_Ioi] #align nhds_left'_sup_nhds_right' nhds_left'_sup_nhds_right'
Mathlib/Topology/Order/LeftRight.lean
127
129
theorem continuousAt_iff_continuous_left_right {a : α} {f : α → β} : ContinuousAt f a ↔ ContinuousWithinAt f (Iic a) a ∧ ContinuousWithinAt f (Ici a) a := by
simp only [ContinuousWithinAt, ContinuousAt, ← tendsto_sup, nhds_left_sup_nhds_right]
317
import Mathlib.Topology.Order.LeftRight import Mathlib.Topology.Order.Monotone #align_import topology.algebra.order.left_right_lim from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set Filter open Topology section variable {α β : Type*} [LinearOrder α] [TopologicalSpace β] noncomputable def Function.leftLim (f : α → β) (a : α) : β := by classical haveI : Nonempty β := ⟨f a⟩ letI : TopologicalSpace α := Preorder.topology α exact if 𝓝[<] a = ⊥ ∨ ¬∃ y, Tendsto f (𝓝[<] a) (𝓝 y) then f a else limUnder (𝓝[<] a) f #align function.left_lim Function.leftLim noncomputable def Function.rightLim (f : α → β) (a : α) : β := @Function.leftLim αᵒᵈ β _ _ f a #align function.right_lim Function.rightLim open Function
Mathlib/Topology/Order/LeftRightLim.lean
65
72
theorem leftLim_eq_of_tendsto [hα : TopologicalSpace α] [h'α : OrderTopology α] [T2Space β] {f : α → β} {a : α} {y : β} (h : 𝓝[<] a ≠ ⊥) (h' : Tendsto f (𝓝[<] a) (𝓝 y)) : leftLim f a = y := by
have h'' : ∃ y, Tendsto f (𝓝[<] a) (𝓝 y) := ⟨y, h'⟩ rw [h'α.topology_eq_generate_intervals] at h h' h'' simp only [leftLim, h, h'', not_true, or_self_iff, if_false] haveI := neBot_iff.2 h exact lim_eq h'
318
import Mathlib.Topology.Order.LeftRight import Mathlib.Topology.Order.Monotone #align_import topology.algebra.order.left_right_lim from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set Filter open Topology section variable {α β : Type*} [LinearOrder α] [TopologicalSpace β] noncomputable def Function.leftLim (f : α → β) (a : α) : β := by classical haveI : Nonempty β := ⟨f a⟩ letI : TopologicalSpace α := Preorder.topology α exact if 𝓝[<] a = ⊥ ∨ ¬∃ y, Tendsto f (𝓝[<] a) (𝓝 y) then f a else limUnder (𝓝[<] a) f #align function.left_lim Function.leftLim noncomputable def Function.rightLim (f : α → β) (a : α) : β := @Function.leftLim αᵒᵈ β _ _ f a #align function.right_lim Function.rightLim open Function theorem leftLim_eq_of_tendsto [hα : TopologicalSpace α] [h'α : OrderTopology α] [T2Space β] {f : α → β} {a : α} {y : β} (h : 𝓝[<] a ≠ ⊥) (h' : Tendsto f (𝓝[<] a) (𝓝 y)) : leftLim f a = y := by have h'' : ∃ y, Tendsto f (𝓝[<] a) (𝓝 y) := ⟨y, h'⟩ rw [h'α.topology_eq_generate_intervals] at h h' h'' simp only [leftLim, h, h'', not_true, or_self_iff, if_false] haveI := neBot_iff.2 h exact lim_eq h' #align left_lim_eq_of_tendsto leftLim_eq_of_tendsto
Mathlib/Topology/Order/LeftRightLim.lean
75
78
theorem leftLim_eq_of_eq_bot [hα : TopologicalSpace α] [h'α : OrderTopology α] (f : α → β) {a : α} (h : 𝓝[<] a = ⊥) : leftLim f a = f a := by
rw [h'α.topology_eq_generate_intervals] at h simp [leftLim, ite_eq_left_iff, h]
318
import Mathlib.Topology.Order.LeftRight import Mathlib.Topology.Order.Monotone #align_import topology.algebra.order.left_right_lim from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set Filter open Topology section variable {α β : Type*} [LinearOrder α] [TopologicalSpace β] noncomputable def Function.leftLim (f : α → β) (a : α) : β := by classical haveI : Nonempty β := ⟨f a⟩ letI : TopologicalSpace α := Preorder.topology α exact if 𝓝[<] a = ⊥ ∨ ¬∃ y, Tendsto f (𝓝[<] a) (𝓝 y) then f a else limUnder (𝓝[<] a) f #align function.left_lim Function.leftLim noncomputable def Function.rightLim (f : α → β) (a : α) : β := @Function.leftLim αᵒᵈ β _ _ f a #align function.right_lim Function.rightLim open Function theorem leftLim_eq_of_tendsto [hα : TopologicalSpace α] [h'α : OrderTopology α] [T2Space β] {f : α → β} {a : α} {y : β} (h : 𝓝[<] a ≠ ⊥) (h' : Tendsto f (𝓝[<] a) (𝓝 y)) : leftLim f a = y := by have h'' : ∃ y, Tendsto f (𝓝[<] a) (𝓝 y) := ⟨y, h'⟩ rw [h'α.topology_eq_generate_intervals] at h h' h'' simp only [leftLim, h, h'', not_true, or_self_iff, if_false] haveI := neBot_iff.2 h exact lim_eq h' #align left_lim_eq_of_tendsto leftLim_eq_of_tendsto theorem leftLim_eq_of_eq_bot [hα : TopologicalSpace α] [h'α : OrderTopology α] (f : α → β) {a : α} (h : 𝓝[<] a = ⊥) : leftLim f a = f a := by rw [h'α.topology_eq_generate_intervals] at h simp [leftLim, ite_eq_left_iff, h] #align left_lim_eq_of_eq_bot leftLim_eq_of_eq_bot theorem rightLim_eq_of_tendsto [TopologicalSpace α] [OrderTopology α] [T2Space β] {f : α → β} {a : α} {y : β} (h : 𝓝[>] a ≠ ⊥) (h' : Tendsto f (𝓝[>] a) (𝓝 y)) : Function.rightLim f a = y := @leftLim_eq_of_tendsto αᵒᵈ _ _ _ _ _ _ f a y h h' #align right_lim_eq_of_tendsto rightLim_eq_of_tendsto theorem rightLim_eq_of_eq_bot [TopologicalSpace α] [OrderTopology α] (f : α → β) {a : α} (h : 𝓝[>] a = ⊥) : rightLim f a = f a := @leftLim_eq_of_eq_bot αᵒᵈ _ _ _ _ _ f a h end open Function namespace Monotone variable {α β : Type*} [LinearOrder α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderTopology β] {f : α → β} (hf : Monotone f) {x y : α} theorem leftLim_eq_sSup [TopologicalSpace α] [OrderTopology α] (h : 𝓝[<] x ≠ ⊥) : leftLim f x = sSup (f '' Iio x) := leftLim_eq_of_tendsto h (hf.tendsto_nhdsWithin_Iio x) #align monotone.left_lim_eq_Sup Monotone.leftLim_eq_sSup theorem rightLim_eq_sInf [TopologicalSpace α] [OrderTopology α] (h : 𝓝[>] x ≠ ⊥) : rightLim f x = sInf (f '' Ioi x) := rightLim_eq_of_tendsto h (hf.tendsto_nhdsWithin_Ioi x) #align right_lim_eq_Inf Monotone.rightLim_eq_sInf
Mathlib/Topology/Order/LeftRightLim.lean
110
122
theorem leftLim_le (h : x ≤ y) : leftLim f x ≤ f y := by
letI : TopologicalSpace α := Preorder.topology α haveI : OrderTopology α := ⟨rfl⟩ rcases eq_or_ne (𝓝[<] x) ⊥ with (h' | h') · simpa [leftLim, h'] using hf h haveI A : NeBot (𝓝[<] x) := neBot_iff.2 h' rw [leftLim_eq_sSup hf h'] refine csSup_le ?_ ?_ · simp only [image_nonempty] exact (forall_mem_nonempty_iff_neBot.2 A) _ self_mem_nhdsWithin · simp only [mem_image, mem_Iio, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂] intro z hz exact hf (hz.le.trans h)
318
import Mathlib.Topology.Order.LeftRight import Mathlib.Topology.Order.Monotone #align_import topology.algebra.order.left_right_lim from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" open Set Filter open Topology section variable {α β : Type*} [LinearOrder α] [TopologicalSpace β] noncomputable def Function.leftLim (f : α → β) (a : α) : β := by classical haveI : Nonempty β := ⟨f a⟩ letI : TopologicalSpace α := Preorder.topology α exact if 𝓝[<] a = ⊥ ∨ ¬∃ y, Tendsto f (𝓝[<] a) (𝓝 y) then f a else limUnder (𝓝[<] a) f #align function.left_lim Function.leftLim noncomputable def Function.rightLim (f : α → β) (a : α) : β := @Function.leftLim αᵒᵈ β _ _ f a #align function.right_lim Function.rightLim open Function theorem leftLim_eq_of_tendsto [hα : TopologicalSpace α] [h'α : OrderTopology α] [T2Space β] {f : α → β} {a : α} {y : β} (h : 𝓝[<] a ≠ ⊥) (h' : Tendsto f (𝓝[<] a) (𝓝 y)) : leftLim f a = y := by have h'' : ∃ y, Tendsto f (𝓝[<] a) (𝓝 y) := ⟨y, h'⟩ rw [h'α.topology_eq_generate_intervals] at h h' h'' simp only [leftLim, h, h'', not_true, or_self_iff, if_false] haveI := neBot_iff.2 h exact lim_eq h' #align left_lim_eq_of_tendsto leftLim_eq_of_tendsto theorem leftLim_eq_of_eq_bot [hα : TopologicalSpace α] [h'α : OrderTopology α] (f : α → β) {a : α} (h : 𝓝[<] a = ⊥) : leftLim f a = f a := by rw [h'α.topology_eq_generate_intervals] at h simp [leftLim, ite_eq_left_iff, h] #align left_lim_eq_of_eq_bot leftLim_eq_of_eq_bot theorem rightLim_eq_of_tendsto [TopologicalSpace α] [OrderTopology α] [T2Space β] {f : α → β} {a : α} {y : β} (h : 𝓝[>] a ≠ ⊥) (h' : Tendsto f (𝓝[>] a) (𝓝 y)) : Function.rightLim f a = y := @leftLim_eq_of_tendsto αᵒᵈ _ _ _ _ _ _ f a y h h' #align right_lim_eq_of_tendsto rightLim_eq_of_tendsto theorem rightLim_eq_of_eq_bot [TopologicalSpace α] [OrderTopology α] (f : α → β) {a : α} (h : 𝓝[>] a = ⊥) : rightLim f a = f a := @leftLim_eq_of_eq_bot αᵒᵈ _ _ _ _ _ f a h end open Function namespace Monotone variable {α β : Type*} [LinearOrder α] [ConditionallyCompleteLinearOrder β] [TopologicalSpace β] [OrderTopology β] {f : α → β} (hf : Monotone f) {x y : α} theorem leftLim_eq_sSup [TopologicalSpace α] [OrderTopology α] (h : 𝓝[<] x ≠ ⊥) : leftLim f x = sSup (f '' Iio x) := leftLim_eq_of_tendsto h (hf.tendsto_nhdsWithin_Iio x) #align monotone.left_lim_eq_Sup Monotone.leftLim_eq_sSup theorem rightLim_eq_sInf [TopologicalSpace α] [OrderTopology α] (h : 𝓝[>] x ≠ ⊥) : rightLim f x = sInf (f '' Ioi x) := rightLim_eq_of_tendsto h (hf.tendsto_nhdsWithin_Ioi x) #align right_lim_eq_Inf Monotone.rightLim_eq_sInf theorem leftLim_le (h : x ≤ y) : leftLim f x ≤ f y := by letI : TopologicalSpace α := Preorder.topology α haveI : OrderTopology α := ⟨rfl⟩ rcases eq_or_ne (𝓝[<] x) ⊥ with (h' | h') · simpa [leftLim, h'] using hf h haveI A : NeBot (𝓝[<] x) := neBot_iff.2 h' rw [leftLim_eq_sSup hf h'] refine csSup_le ?_ ?_ · simp only [image_nonempty] exact (forall_mem_nonempty_iff_neBot.2 A) _ self_mem_nhdsWithin · simp only [mem_image, mem_Iio, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂] intro z hz exact hf (hz.le.trans h) #align monotone.left_lim_le Monotone.leftLim_le
Mathlib/Topology/Order/LeftRightLim.lean
125
136
theorem le_leftLim (h : x < y) : f x ≤ leftLim f y := by
letI : TopologicalSpace α := Preorder.topology α haveI : OrderTopology α := ⟨rfl⟩ rcases eq_or_ne (𝓝[<] y) ⊥ with (h' | h') · rw [leftLim_eq_of_eq_bot _ h'] exact hf h.le rw [leftLim_eq_sSup hf h'] refine le_csSup ⟨f y, ?_⟩ (mem_image_of_mem _ h) simp only [upperBounds, mem_image, mem_Iio, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂, mem_setOf_eq] intro z hz exact hf hz.le
318
import Mathlib.CategoryTheory.Functor.ReflectsIso import Mathlib.CategoryTheory.MorphismProperty.Basic universe w v v' u u' namespace CategoryTheory namespace MorphismProperty variable {C : Type u} [Category.{v} C] {D : Type u'} [Category.{v'} D] def IsInvertedBy (P : MorphismProperty C) (F : C ⥤ D) : Prop := ∀ ⦃X Y : C⦄ (f : X ⟶ Y) (_ : P f), IsIso (F.map f) #align category_theory.morphism_property.is_inverted_by CategoryTheory.MorphismProperty.IsInvertedBy -- porting note (#5171): removed @[nolint has_nonempty_instance] def FunctorsInverting (W : MorphismProperty C) (D : Type*) [Category D] := FullSubcategory fun F : C ⥤ D => W.IsInvertedBy F #align category_theory.morphism_property.functors_inverting CategoryTheory.MorphismProperty.FunctorsInverting @[ext] lemma FunctorsInverting.ext {W : MorphismProperty C} {F₁ F₂ : FunctorsInverting W D} (h : F₁.obj = F₂.obj) : F₁ = F₂ := by cases F₁ cases F₂ subst h rfl instance (W : MorphismProperty C) (D : Type*) [Category D] : Category (FunctorsInverting W D) := FullSubcategory.category _ -- Porting note: add another `@[ext]` lemma -- since `ext` can't see through the definition to use `NatTrans.ext`. -- See https://github.com/leanprover-community/mathlib4/issues/5229 @[ext] lemma FunctorsInverting.hom_ext {W : MorphismProperty C} {F₁ F₂ : FunctorsInverting W D} {α β : F₁ ⟶ F₂} (h : α.app = β.app) : α = β := NatTrans.ext _ _ h def FunctorsInverting.mk {W : MorphismProperty C} {D : Type*} [Category D] (F : C ⥤ D) (hF : W.IsInvertedBy F) : W.FunctorsInverting D := ⟨F, hF⟩ #align category_theory.morphism_property.functors_inverting.mk CategoryTheory.MorphismProperty.FunctorsInverting.mk
Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean
128
131
theorem IsInvertedBy.iff_of_iso (W : MorphismProperty C) {F₁ F₂ : C ⥤ D} (e : F₁ ≅ F₂) : W.IsInvertedBy F₁ ↔ W.IsInvertedBy F₂ := by
dsimp [IsInvertedBy] simp only [NatIso.isIso_map_iff e]
319
import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular import Mathlib.Topology.Category.CompHaus.EffectiveEpi import Mathlib.Topology.Category.Profinite.Limits import Mathlib.Topology.Category.Stonean.Basic universe u attribute [local instance] CategoryTheory.ConcreteCategory.instFunLike open CategoryTheory Limits namespace Profinite noncomputable def struct {B X : Profinite.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a) uniq e h g hm := by suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e, fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a⟩ by assumption rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv] ext simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, ← hm] rfl open List in
Mathlib/Topology/Category/Profinite/EffectiveEpi.lean
69
82
theorem effectiveEpi_tfae {B X : Profinite.{u}} (π : X ⟶ B) : TFAE [ EffectiveEpi π , Epi π , Function.Surjective π ] := by
tfae_have 1 → 2 · intro; infer_instance tfae_have 2 ↔ 3 · exact epi_iff_surjective π tfae_have 3 → 1 · exact fun hπ ↦ ⟨⟨struct π hπ⟩⟩ tfae_finish
320
import Mathlib.CategoryTheory.Sites.Coherent.ReflectsPreregular import Mathlib.Topology.Category.CompHaus.EffectiveEpi import Mathlib.Topology.Category.Profinite.Limits import Mathlib.Topology.Category.Stonean.Basic universe u attribute [local instance] CategoryTheory.ConcreteCategory.instFunLike open CategoryTheory Limits namespace Profinite noncomputable def struct {B X : Profinite.{u}} (π : X ⟶ B) (hπ : Function.Surjective π) : EffectiveEpiStruct π where desc e h := (QuotientMap.of_surjective_continuous hπ π.continuous).lift e fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a fac e h := ((QuotientMap.of_surjective_continuous hπ π.continuous).lift_comp e fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a) uniq e h g hm := by suffices g = (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv ⟨e, fun a b hab ↦ DFunLike.congr_fun (h ⟨fun _ ↦ a, continuous_const⟩ ⟨fun _ ↦ b, continuous_const⟩ (by ext; exact hab)) a⟩ by assumption rw [← Equiv.symm_apply_eq (QuotientMap.of_surjective_continuous hπ π.continuous).liftEquiv] ext simp only [QuotientMap.liftEquiv_symm_apply_coe, ContinuousMap.comp_apply, ← hm] rfl open List in theorem effectiveEpi_tfae {B X : Profinite.{u}} (π : X ⟶ B) : TFAE [ EffectiveEpi π , Epi π , Function.Surjective π ] := by tfae_have 1 → 2 · intro; infer_instance tfae_have 2 ↔ 3 · exact epi_iff_surjective π tfae_have 3 → 1 · exact fun hπ ↦ ⟨⟨struct π hπ⟩⟩ tfae_finish instance : profiniteToCompHaus.PreservesEffectiveEpis where preserves f h := ((CompHaus.effectiveEpi_tfae _).out 0 2).mpr (((Profinite.effectiveEpi_tfae _).out 0 2).mp h) instance : profiniteToCompHaus.ReflectsEffectiveEpis where reflects f h := ((Profinite.effectiveEpi_tfae f).out 0 2).mpr (((CompHaus.effectiveEpi_tfae _).out 0 2).mp h) noncomputable def profiniteToCompHausEffectivePresentation (X : CompHaus) : profiniteToCompHaus.EffectivePresentation X where p := Stonean.toProfinite.obj X.presentation f := CompHaus.presentation.π X effectiveEpi := ((CompHaus.effectiveEpi_tfae _).out 0 1).mpr (inferInstance : Epi _) instance : profiniteToCompHaus.EffectivelyEnough where presentation X := ⟨profiniteToCompHausEffectivePresentation X⟩ instance : Preregular Profinite.{u} := profiniteToCompHaus.reflects_preregular example : Precoherent Profinite.{u} := inferInstance -- TODO: prove this for `Type*` open List in
Mathlib/Topology/Category/Profinite/EffectiveEpi.lean
110
128
theorem effectiveEpiFamily_tfae {α : Type} [Finite α] {B : Profinite.{u}} (X : α → Profinite.{u}) (π : (a : α) → (X a ⟶ B)) : TFAE [ EffectiveEpiFamily X π , Epi (Sigma.desc π) , ∀ b : B, ∃ (a : α) (x : X a), π a x = b ] := by
tfae_have 2 → 1 · intro simpa [← effectiveEpi_desc_iff_effectiveEpiFamily, (effectiveEpi_tfae (Sigma.desc π)).out 0 1] tfae_have 1 → 2 · intro; infer_instance tfae_have 3 ↔ 1 · erw [((CompHaus.effectiveEpiFamily_tfae (fun a ↦ profiniteToCompHaus.obj (X a)) (fun a ↦ profiniteToCompHaus.map (π a))).out 2 0 : )] exact ⟨fun h ↦ profiniteToCompHaus.finite_effectiveEpiFamily_of_map _ _ h, fun _ ↦ inferInstance⟩ tfae_finish
320
import Mathlib.Algebra.Order.Ring.Int #align_import data.int.range from "leanprover-community/mathlib"@"7b78d1776212a91ecc94cf601f83bdcc46b04213" -- Porting note: Many unfolds about `Lean.Internal.coeM` namespace Int def range (m n : ℤ) : List ℤ := ((List.range (toNat (n - m))) : List ℕ).map fun (r : ℕ) => (m + r : ℤ) #align int.range Int.range
Mathlib/Data/Int/Range.lean
29
32
theorem mem_range_iff {m n r : ℤ} : r ∈ range m n ↔ m ≤ r ∧ r < n := by
simp only [range, List.mem_map, List.mem_range, lt_toNat, lt_sub_iff_add_lt, add_comm] exact ⟨fun ⟨a, ha⟩ => ha.2 ▸ ⟨le_add_of_nonneg_right (Int.natCast_nonneg _), ha.1⟩, fun h => ⟨toNat (r - m), by simp [toNat_of_nonneg (sub_nonneg.2 h.1), h.2] ⟩⟩
321
import Mathlib.Data.Int.Range import Mathlib.Data.ZMod.Basic import Mathlib.NumberTheory.MulChar.Basic #align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace ZMod section QuadCharModP @[simps] def χ₄ : MulChar (ZMod 4) ℤ where toFun := (![0, 1, 0, -1] : ZMod 4 → ℤ) map_one' := rfl map_mul' := by decide map_nonunit' := by decide #align zmod.χ₄ ZMod.χ₄
Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean
48
52
theorem isQuadratic_χ₄ : χ₄.IsQuadratic := by
intro a -- Porting note (#11043): was `decide!` fin_cases a all_goals decide
322
import Mathlib.Data.Int.Range import Mathlib.Data.ZMod.Basic import Mathlib.NumberTheory.MulChar.Basic #align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace ZMod section QuadCharModP @[simps] def χ₄ : MulChar (ZMod 4) ℤ where toFun := (![0, 1, 0, -1] : ZMod 4 → ℤ) map_one' := rfl map_mul' := by decide map_nonunit' := by decide #align zmod.χ₄ ZMod.χ₄ theorem isQuadratic_χ₄ : χ₄.IsQuadratic := by intro a -- Porting note (#11043): was `decide!` fin_cases a all_goals decide #align zmod.is_quadratic_χ₄ ZMod.isQuadratic_χ₄
Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean
56
56
theorem χ₄_nat_mod_four (n : ℕ) : χ₄ n = χ₄ (n % 4 : ℕ) := by
rw [← ZMod.natCast_mod n 4]
322
import Mathlib.Data.Int.Range import Mathlib.Data.ZMod.Basic import Mathlib.NumberTheory.MulChar.Basic #align_import number_theory.legendre_symbol.zmod_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace ZMod section QuadCharModP @[simps] def χ₄ : MulChar (ZMod 4) ℤ where toFun := (![0, 1, 0, -1] : ZMod 4 → ℤ) map_one' := rfl map_mul' := by decide map_nonunit' := by decide #align zmod.χ₄ ZMod.χ₄ theorem isQuadratic_χ₄ : χ₄.IsQuadratic := by intro a -- Porting note (#11043): was `decide!` fin_cases a all_goals decide #align zmod.is_quadratic_χ₄ ZMod.isQuadratic_χ₄ theorem χ₄_nat_mod_four (n : ℕ) : χ₄ n = χ₄ (n % 4 : ℕ) := by rw [← ZMod.natCast_mod n 4] #align zmod.χ₄_nat_mod_four ZMod.χ₄_nat_mod_four
Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean
60
62
theorem χ₄_int_mod_four (n : ℤ) : χ₄ n = χ₄ (n % 4 : ℤ) := by
rw [← ZMod.intCast_mod n 4] norm_cast
322