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
num_lines
int64
1
150
complexity_score
float64
2.72
139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B
diff_level
int64
0
2
file_diff_level
float64
0
2
theorem_same_file
int64
1
32
rank_file
int64
0
2.51k
import Mathlib.Algebra.Polynomial.Degree.CardPowDegree import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue import Mathlib.RingTheory.Ideal.LocalRing #align_import number_theory.class_number.admissible_card_pow_degree from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" namespace Polynomial open Polynomial open AbsoluteValue Real variable {Fq : Type*} [Fintype Fq]
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
36
57
theorem exists_eq_polynomial [Semiring Fq] {d : ℕ} {m : ℕ} (hm : Fintype.card Fq ^ d ≤ m) (b : Fq[X]) (hb : natDegree b ≤ d) (A : Fin m.succ → Fq[X]) (hA : ∀ i, degree (A i) < degree b) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ A i₁ = A i₀ := by
-- Since there are > q^d elements of A, and only q^d choices for the highest `d` coefficients, -- there must be two elements of A with the same coefficients at -- `0`, ... `degree b - 1` ≤ `d - 1`. -- In other words, the following map is not injective: set f : Fin m.succ → Fin d → Fq := fun i j => (A i).coeff j have : Fintype.card (Fin d → Fq) < Fintype.card (Fin m.succ) := by simpa using lt_of_le_of_lt hm (Nat.lt_succ_self m) -- Therefore, the differences have all coefficients higher than `deg b - d` equal. obtain ⟨i₀, i₁, i_ne, i_eq⟩ := Fintype.exists_ne_map_eq_of_card_lt f this use i₀, i₁, i_ne ext j -- The coefficients higher than `deg b` are the same because they are equal to 0. by_cases hbj : degree b ≤ j · rw [coeff_eq_zero_of_degree_lt (lt_of_lt_of_le (hA _) hbj), coeff_eq_zero_of_degree_lt (lt_of_lt_of_le (hA _) hbj)] -- So we only need to look for the coefficients between `0` and `deg b`. rw [not_le] at hbj apply congr_fun i_eq.symm ⟨j, _⟩ exact lt_of_lt_of_le (coe_lt_degree.mp hbj) hb
19
178,482,300.963187
2
2
3
2,308
import Mathlib.Algebra.Polynomial.Degree.CardPowDegree import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue import Mathlib.RingTheory.Ideal.LocalRing #align_import number_theory.class_number.admissible_card_pow_degree from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" namespace Polynomial open Polynomial open AbsoluteValue Real variable {Fq : Type*} [Fintype Fq] theorem exists_eq_polynomial [Semiring Fq] {d : ℕ} {m : ℕ} (hm : Fintype.card Fq ^ d ≤ m) (b : Fq[X]) (hb : natDegree b ≤ d) (A : Fin m.succ → Fq[X]) (hA : ∀ i, degree (A i) < degree b) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ A i₁ = A i₀ := by -- Since there are > q^d elements of A, and only q^d choices for the highest `d` coefficients, -- there must be two elements of A with the same coefficients at -- `0`, ... `degree b - 1` ≤ `d - 1`. -- In other words, the following map is not injective: set f : Fin m.succ → Fin d → Fq := fun i j => (A i).coeff j have : Fintype.card (Fin d → Fq) < Fintype.card (Fin m.succ) := by simpa using lt_of_le_of_lt hm (Nat.lt_succ_self m) -- Therefore, the differences have all coefficients higher than `deg b - d` equal. obtain ⟨i₀, i₁, i_ne, i_eq⟩ := Fintype.exists_ne_map_eq_of_card_lt f this use i₀, i₁, i_ne ext j -- The coefficients higher than `deg b` are the same because they are equal to 0. by_cases hbj : degree b ≤ j · rw [coeff_eq_zero_of_degree_lt (lt_of_lt_of_le (hA _) hbj), coeff_eq_zero_of_degree_lt (lt_of_lt_of_le (hA _) hbj)] -- So we only need to look for the coefficients between `0` and `deg b`. rw [not_le] at hbj apply congr_fun i_eq.symm ⟨j, _⟩ exact lt_of_lt_of_le (coe_lt_degree.mp hbj) hb #align polynomial.exists_eq_polynomial Polynomial.exists_eq_polynomial
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
63
98
theorem exists_approx_polynomial_aux [Ring Fq] {d : ℕ} {m : ℕ} (hm : Fintype.card Fq ^ d ≤ m) (b : Fq[X]) (A : Fin m.succ → Fq[X]) (hA : ∀ i, degree (A i) < degree b) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ degree (A i₁ - A i₀) < ↑(natDegree b - d) := by
have hb : b ≠ 0 := by rintro rfl specialize hA 0 rw [degree_zero] at hA exact not_lt_of_le bot_le hA -- Since there are > q^d elements of A, and only q^d choices for the highest `d` coefficients, -- there must be two elements of A with the same coefficients at -- `degree b - 1`, ... `degree b - d`. -- In other words, the following map is not injective: set f : Fin m.succ → Fin d → Fq := fun i j => (A i).coeff (natDegree b - j.succ) have : Fintype.card (Fin d → Fq) < Fintype.card (Fin m.succ) := by simpa using lt_of_le_of_lt hm (Nat.lt_succ_self m) -- Therefore, the differences have all coefficients higher than `deg b - d` equal. obtain ⟨i₀, i₁, i_ne, i_eq⟩ := Fintype.exists_ne_map_eq_of_card_lt f this use i₀, i₁, i_ne refine (degree_lt_iff_coeff_zero _ _).mpr fun j hj => ?_ -- The coefficients higher than `deg b` are the same because they are equal to 0. by_cases hbj : degree b ≤ j · refine coeff_eq_zero_of_degree_lt (lt_of_lt_of_le ?_ hbj) exact lt_of_le_of_lt (degree_sub_le _ _) (max_lt (hA _) (hA _)) -- So we only need to look for the coefficients between `deg b - d` and `deg b`. rw [coeff_sub, sub_eq_zero] rw [not_le, degree_eq_natDegree hb] at hbj have hbj : j < natDegree b := (@WithBot.coe_lt_coe _ _ _).mp hbj have hj : natDegree b - j.succ < d := by by_cases hd : natDegree b < d · exact lt_of_le_of_lt tsub_le_self hd · rw [not_lt] at hd have := lt_of_le_of_lt hj (Nat.lt_succ_self j) rwa [tsub_lt_iff_tsub_lt hd hbj] at this have : j = b.natDegree - (natDegree b - j.succ).succ := by rw [← Nat.succ_sub hbj, Nat.succ_sub_succ, tsub_tsub_cancel_of_le hbj.le] convert congr_fun i_eq.symm ⟨natDegree b - j.succ, hj⟩
33
214,643,579,785,916.06
2
2
3
2,308
import Mathlib.Algebra.Polynomial.Degree.CardPowDegree import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue import Mathlib.RingTheory.Ideal.LocalRing #align_import number_theory.class_number.admissible_card_pow_degree from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" namespace Polynomial open Polynomial open AbsoluteValue Real variable {Fq : Type*} [Fintype Fq] theorem exists_eq_polynomial [Semiring Fq] {d : ℕ} {m : ℕ} (hm : Fintype.card Fq ^ d ≤ m) (b : Fq[X]) (hb : natDegree b ≤ d) (A : Fin m.succ → Fq[X]) (hA : ∀ i, degree (A i) < degree b) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ A i₁ = A i₀ := by -- Since there are > q^d elements of A, and only q^d choices for the highest `d` coefficients, -- there must be two elements of A with the same coefficients at -- `0`, ... `degree b - 1` ≤ `d - 1`. -- In other words, the following map is not injective: set f : Fin m.succ → Fin d → Fq := fun i j => (A i).coeff j have : Fintype.card (Fin d → Fq) < Fintype.card (Fin m.succ) := by simpa using lt_of_le_of_lt hm (Nat.lt_succ_self m) -- Therefore, the differences have all coefficients higher than `deg b - d` equal. obtain ⟨i₀, i₁, i_ne, i_eq⟩ := Fintype.exists_ne_map_eq_of_card_lt f this use i₀, i₁, i_ne ext j -- The coefficients higher than `deg b` are the same because they are equal to 0. by_cases hbj : degree b ≤ j · rw [coeff_eq_zero_of_degree_lt (lt_of_lt_of_le (hA _) hbj), coeff_eq_zero_of_degree_lt (lt_of_lt_of_le (hA _) hbj)] -- So we only need to look for the coefficients between `0` and `deg b`. rw [not_le] at hbj apply congr_fun i_eq.symm ⟨j, _⟩ exact lt_of_lt_of_le (coe_lt_degree.mp hbj) hb #align polynomial.exists_eq_polynomial Polynomial.exists_eq_polynomial theorem exists_approx_polynomial_aux [Ring Fq] {d : ℕ} {m : ℕ} (hm : Fintype.card Fq ^ d ≤ m) (b : Fq[X]) (A : Fin m.succ → Fq[X]) (hA : ∀ i, degree (A i) < degree b) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ degree (A i₁ - A i₀) < ↑(natDegree b - d) := by have hb : b ≠ 0 := by rintro rfl specialize hA 0 rw [degree_zero] at hA exact not_lt_of_le bot_le hA -- Since there are > q^d elements of A, and only q^d choices for the highest `d` coefficients, -- there must be two elements of A with the same coefficients at -- `degree b - 1`, ... `degree b - d`. -- In other words, the following map is not injective: set f : Fin m.succ → Fin d → Fq := fun i j => (A i).coeff (natDegree b - j.succ) have : Fintype.card (Fin d → Fq) < Fintype.card (Fin m.succ) := by simpa using lt_of_le_of_lt hm (Nat.lt_succ_self m) -- Therefore, the differences have all coefficients higher than `deg b - d` equal. obtain ⟨i₀, i₁, i_ne, i_eq⟩ := Fintype.exists_ne_map_eq_of_card_lt f this use i₀, i₁, i_ne refine (degree_lt_iff_coeff_zero _ _).mpr fun j hj => ?_ -- The coefficients higher than `deg b` are the same because they are equal to 0. by_cases hbj : degree b ≤ j · refine coeff_eq_zero_of_degree_lt (lt_of_lt_of_le ?_ hbj) exact lt_of_le_of_lt (degree_sub_le _ _) (max_lt (hA _) (hA _)) -- So we only need to look for the coefficients between `deg b - d` and `deg b`. rw [coeff_sub, sub_eq_zero] rw [not_le, degree_eq_natDegree hb] at hbj have hbj : j < natDegree b := (@WithBot.coe_lt_coe _ _ _).mp hbj have hj : natDegree b - j.succ < d := by by_cases hd : natDegree b < d · exact lt_of_le_of_lt tsub_le_self hd · rw [not_lt] at hd have := lt_of_le_of_lt hj (Nat.lt_succ_self j) rwa [tsub_lt_iff_tsub_lt hd hbj] at this have : j = b.natDegree - (natDegree b - j.succ).succ := by rw [← Nat.succ_sub hbj, Nat.succ_sub_succ, tsub_tsub_cancel_of_le hbj.le] convert congr_fun i_eq.symm ⟨natDegree b - j.succ, hj⟩ #align polynomial.exists_approx_polynomial_aux Polynomial.exists_approx_polynomial_aux variable [Field Fq]
Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean
106
149
theorem exists_approx_polynomial {b : Fq[X]} (hb : b ≠ 0) {ε : ℝ} (hε : 0 < ε) (A : Fin (Fintype.card Fq ^ ⌈-log ε / log (Fintype.card Fq)⌉₊).succ → Fq[X]) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ (cardPowDegree (A i₁ % b - A i₀ % b) : ℝ) < cardPowDegree b • ε := by
have hbε : 0 < cardPowDegree b • ε := by rw [Algebra.smul_def, eq_intCast] exact mul_pos (Int.cast_pos.mpr (AbsoluteValue.pos _ hb)) hε have one_lt_q : 1 < Fintype.card Fq := Fintype.one_lt_card have one_lt_q' : (1 : ℝ) < Fintype.card Fq := by assumption_mod_cast have q_pos : 0 < Fintype.card Fq := by omega have q_pos' : (0 : ℝ) < Fintype.card Fq := by assumption_mod_cast -- If `b` is already small enough, then the remainders are equal and we are done. by_cases le_b : b.natDegree ≤ ⌈-log ε / log (Fintype.card Fq)⌉₊ · obtain ⟨i₀, i₁, i_ne, mod_eq⟩ := exists_eq_polynomial le_rfl b le_b (fun i => A i % b) fun i => EuclideanDomain.mod_lt (A i) hb refine ⟨i₀, i₁, i_ne, ?_⟩ rwa [mod_eq, sub_self, map_zero, Int.cast_zero] -- Otherwise, it suffices to choose two elements whose difference is of small enough degree. rw [not_le] at le_b obtain ⟨i₀, i₁, i_ne, deg_lt⟩ := exists_approx_polynomial_aux le_rfl b (fun i => A i % b) fun i => EuclideanDomain.mod_lt (A i) hb use i₀, i₁, i_ne -- Again, if the remainders are equal we are done. by_cases h : A i₁ % b = A i₀ % b · rwa [h, sub_self, map_zero, Int.cast_zero] have h' : A i₁ % b - A i₀ % b ≠ 0 := mt sub_eq_zero.mp h -- If the remainders are not equal, we'll show their difference is of small degree. -- In particular, we'll show the degree is less than the following: suffices (natDegree (A i₁ % b - A i₀ % b) : ℝ) < b.natDegree + log ε / log (Fintype.card Fq) by rwa [← Real.log_lt_log_iff (Int.cast_pos.mpr (cardPowDegree.pos h')) hbε, cardPowDegree_nonzero _ h', cardPowDegree_nonzero _ hb, Algebra.smul_def, eq_intCast, Int.cast_pow, Int.cast_natCast, Int.cast_pow, Int.cast_natCast, log_mul (pow_ne_zero _ q_pos'.ne') hε.ne', ← rpow_natCast, ← rpow_natCast, log_rpow q_pos', log_rpow q_pos', ← lt_div_iff (log_pos one_lt_q'), add_div, mul_div_cancel_right₀ _ (log_pos one_lt_q').ne'] -- And that result follows from manipulating the result from `exists_approx_polynomial_aux` -- to turn the `-⌈-stuff⌉₊` into `+ stuff`. apply lt_of_lt_of_le (Nat.cast_lt.mpr (WithBot.coe_lt_coe.mp _)) _ swap · convert deg_lt rw [degree_eq_natDegree h']; rfl rw [← sub_neg_eq_add, neg_div] refine le_trans ?_ (sub_le_sub_left (Nat.le_ceil _) (b.natDegree : ℝ)) rw [← neg_div] exact le_of_eq (Nat.cast_sub le_b.le)
41
639,843,493,530,055,000
2
2
3
2,308
import Mathlib.CategoryTheory.Preadditive.Yoneda.Projective import Mathlib.CategoryTheory.Preadditive.Yoneda.Limits import Mathlib.Algebra.Category.ModuleCat.EpiMono universe v u namespace CategoryTheory open Limits Projective Opposite variable {C : Type u} [Category.{v} C] [Abelian C] noncomputable def preservesFiniteColimitsPreadditiveCoyonedaObjOfProjective (P : C) [hP : Projective P] : PreservesFiniteColimits (preadditiveCoyonedaObj (op P)) := by haveI := (projective_iff_preservesEpimorphisms_preadditiveCoyoneda_obj' P).mp hP -- Porting note: this next instance wasn't necessary in Lean 3 haveI := @Functor.preservesEpimorphisms_of_preserves_of_reflects _ _ _ _ _ _ _ _ this _ apply Functor.preservesFiniteColimitsOfPreservesEpisAndKernels #align category_theory.preserves_finite_colimits_preadditive_coyoneda_obj_of_projective CategoryTheory.preservesFiniteColimitsPreadditiveCoyonedaObjOfProjective
Mathlib/CategoryTheory/Abelian/Projective.lean
37
42
theorem projective_of_preservesFiniteColimits_preadditiveCoyonedaObj (P : C) [hP : PreservesFiniteColimits (preadditiveCoyonedaObj (op P))] : Projective P := by
rw [projective_iff_preservesEpimorphisms_preadditiveCoyoneda_obj'] -- Porting note: this next line wasn't necessary in Lean 3 dsimp only [preadditiveCoyoneda] infer_instance
4
54.59815
2
2
1
2,309
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Combinatorics.SimpleGraph.Coloring import Mathlib.Combinatorics.SimpleGraph.Hasse import Mathlib.Order.OmegaCompletePartialOrder namespace SimpleGraph def pathGraph.bicoloring (n : ℕ) : Coloring (pathGraph n) Bool := Coloring.mk (fun u ↦ u.val % 2 = 0) <| by intro u v rw [pathGraph_adj] rintro (h | h) <;> simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff] def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where toFun v := ⟨v, trans v.2 h⟩ inj' := by rintro v w rw [Fin.mk.injEq] exact Fin.ext map_rel_iff' := by intro v w fin_cases v <;> fin_cases w <;> simp [pathGraph, ← Fin.coe_covBy_iff]
Mathlib/Combinatorics/SimpleGraph/ConcreteColorings.lean
43
49
theorem chromaticNumber_pathGraph (n : ℕ) (h : 2 ≤ n) : (pathGraph n).chromaticNumber = 2 := by
have hc := (pathGraph.bicoloring n).colorable apply le_antisymm · exact hc.chromaticNumber_le · simpa only [pathGraph_two_eq_top, chromaticNumber_top] using chromaticNumber_mono_of_embedding (pathGraph_two_embedding n h)
5
148.413159
2
2
1
2,310
import Mathlib.Order.Filter.CountableInter set_option autoImplicit true open Function Set Filter class HasCountableSeparatingOn (α : Type*) (p : Set α → Prop) (t : Set α) : Prop where exists_countable_separating : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y theorem exists_countable_separating (α : Type*) (p : Set α → Prop) (t : Set α) [h : HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := h.1 theorem exists_nonempty_countable_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Nonempty ∧ S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := let ⟨S, hSc, hSp, hSt⟩ := exists_countable_separating α p t ⟨insert s₀ S, insert_nonempty _ _, hSc.insert _, forall_insert_of_forall hSp hp, fun x hx y hy hxy ↦ hSt x hx y hy <| forall_of_forall_insert hxy⟩
Mathlib/Order/Filter/CountableSeparatingOn.lean
103
109
theorem exists_seq_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : ℕ → Set α, (∀ n, p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ n, x ∈ S n ↔ y ∈ S n) → x = y := by
rcases exists_nonempty_countable_separating α hp t with ⟨S, hSne, hSc, hS⟩ rcases hSc.exists_eq_range hSne with ⟨S, rfl⟩ use S simpa only [forall_mem_range] using hS
4
54.59815
2
2
4
2,311
import Mathlib.Order.Filter.CountableInter set_option autoImplicit true open Function Set Filter class HasCountableSeparatingOn (α : Type*) (p : Set α → Prop) (t : Set α) : Prop where exists_countable_separating : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y theorem exists_countable_separating (α : Type*) (p : Set α → Prop) (t : Set α) [h : HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := h.1 theorem exists_nonempty_countable_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Nonempty ∧ S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := let ⟨S, hSc, hSp, hSt⟩ := exists_countable_separating α p t ⟨insert s₀ S, insert_nonempty _ _, hSc.insert _, forall_insert_of_forall hSp hp, fun x hx y hy hxy ↦ hSt x hx y hy <| forall_of_forall_insert hxy⟩ theorem exists_seq_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : ℕ → Set α, (∀ n, p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ n, x ∈ S n ↔ y ∈ S n) → x = y := by rcases exists_nonempty_countable_separating α hp t with ⟨S, hSne, hSc, hS⟩ rcases hSc.exists_eq_range hSne with ⟨S, rfl⟩ use S simpa only [forall_mem_range] using hS theorem HasCountableSeparatingOn.mono {α} {p₁ p₂ : Set α → Prop} {t₁ t₂ : Set α} [h : HasCountableSeparatingOn α p₁ t₁] (hp : ∀ s, p₁ s → p₂ s) (ht : t₂ ⊆ t₁) : HasCountableSeparatingOn α p₂ t₂ where exists_countable_separating := let ⟨S, hSc, hSp, hSt⟩ := h.1 ⟨S, hSc, fun s hs ↦ hp s (hSp s hs), fun x hx y hy ↦ hSt x (ht hx) y (ht hy)⟩
Mathlib/Order/Filter/CountableSeparatingOn.lean
118
126
theorem HasCountableSeparatingOn.of_subtype {α : Type*} {p : Set α → Prop} {t : Set α} {q : Set t → Prop} [h : HasCountableSeparatingOn t q univ] (hpq : ∀ U, q U → ∃ V, p V ∧ (↑) ⁻¹' V = U) : HasCountableSeparatingOn α p t := by
rcases h.1 with ⟨S, hSc, hSq, hS⟩ choose! V hpV hV using fun s hs ↦ hpq s (hSq s hs) refine ⟨⟨V '' S, hSc.image _, forall_mem_image.2 hpV, fun x hx y hy h ↦ ?_⟩⟩ refine congr_arg Subtype.val (hS ⟨x, hx⟩ trivial ⟨y, hy⟩ trivial fun U hU ↦ ?_) rw [← hV U hU] exact h _ (mem_image_of_mem _ hU)
6
403.428793
2
2
4
2,311
import Mathlib.Order.Filter.CountableInter set_option autoImplicit true open Function Set Filter class HasCountableSeparatingOn (α : Type*) (p : Set α → Prop) (t : Set α) : Prop where exists_countable_separating : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y theorem exists_countable_separating (α : Type*) (p : Set α → Prop) (t : Set α) [h : HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := h.1 theorem exists_nonempty_countable_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Nonempty ∧ S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := let ⟨S, hSc, hSp, hSt⟩ := exists_countable_separating α p t ⟨insert s₀ S, insert_nonempty _ _, hSc.insert _, forall_insert_of_forall hSp hp, fun x hx y hy hxy ↦ hSt x hx y hy <| forall_of_forall_insert hxy⟩ theorem exists_seq_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : ℕ → Set α, (∀ n, p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ n, x ∈ S n ↔ y ∈ S n) → x = y := by rcases exists_nonempty_countable_separating α hp t with ⟨S, hSne, hSc, hS⟩ rcases hSc.exists_eq_range hSne with ⟨S, rfl⟩ use S simpa only [forall_mem_range] using hS theorem HasCountableSeparatingOn.mono {α} {p₁ p₂ : Set α → Prop} {t₁ t₂ : Set α} [h : HasCountableSeparatingOn α p₁ t₁] (hp : ∀ s, p₁ s → p₂ s) (ht : t₂ ⊆ t₁) : HasCountableSeparatingOn α p₂ t₂ where exists_countable_separating := let ⟨S, hSc, hSp, hSt⟩ := h.1 ⟨S, hSc, fun s hs ↦ hp s (hSp s hs), fun x hx y hy ↦ hSt x (ht hx) y (ht hy)⟩ theorem HasCountableSeparatingOn.of_subtype {α : Type*} {p : Set α → Prop} {t : Set α} {q : Set t → Prop} [h : HasCountableSeparatingOn t q univ] (hpq : ∀ U, q U → ∃ V, p V ∧ (↑) ⁻¹' V = U) : HasCountableSeparatingOn α p t := by rcases h.1 with ⟨S, hSc, hSq, hS⟩ choose! V hpV hV using fun s hs ↦ hpq s (hSq s hs) refine ⟨⟨V '' S, hSc.image _, forall_mem_image.2 hpV, fun x hx y hy h ↦ ?_⟩⟩ refine congr_arg Subtype.val (hS ⟨x, hx⟩ trivial ⟨y, hy⟩ trivial fun U hU ↦ ?_) rw [← hV U hU] exact h _ (mem_image_of_mem _ hU)
Mathlib/Order/Filter/CountableSeparatingOn.lean
128
139
theorem HasCountableSeparatingOn.subtype_iff {α : Type*} {p : Set α → Prop} {t : Set α} : HasCountableSeparatingOn t (fun u ↦ ∃ v, p v ∧ (↑) ⁻¹' v = u) univ ↔ HasCountableSeparatingOn α p t := by
constructor <;> intro h · exact h.of_subtype $ fun s ↦ id rcases h with ⟨S, Sct, Sp, hS⟩ use {Subtype.val ⁻¹' s | s ∈ S}, Sct.image _, ?_, ?_ · rintro u ⟨t, tS, rfl⟩ exact ⟨t, Sp _ tS, rfl⟩ rintro x - y - hxy exact Subtype.val_injective $ hS _ (Subtype.coe_prop _) _ (Subtype.coe_prop _) fun s hs ↦ hxy (Subtype.val ⁻¹' s) ⟨s, hs, rfl⟩
9
8,103.083928
2
2
4
2,311
import Mathlib.Order.Filter.CountableInter set_option autoImplicit true open Function Set Filter class HasCountableSeparatingOn (α : Type*) (p : Set α → Prop) (t : Set α) : Prop where exists_countable_separating : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y theorem exists_countable_separating (α : Type*) (p : Set α → Prop) (t : Set α) [h : HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := h.1 theorem exists_nonempty_countable_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : Set (Set α), S.Nonempty ∧ S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := let ⟨S, hSc, hSp, hSt⟩ := exists_countable_separating α p t ⟨insert s₀ S, insert_nonempty _ _, hSc.insert _, forall_insert_of_forall hSp hp, fun x hx y hy hxy ↦ hSt x hx y hy <| forall_of_forall_insert hxy⟩ theorem exists_seq_separating (α : Type*) {p : Set α → Prop} {s₀} (hp : p s₀) (t : Set α) [HasCountableSeparatingOn α p t] : ∃ S : ℕ → Set α, (∀ n, p (S n)) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ n, x ∈ S n ↔ y ∈ S n) → x = y := by rcases exists_nonempty_countable_separating α hp t with ⟨S, hSne, hSc, hS⟩ rcases hSc.exists_eq_range hSne with ⟨S, rfl⟩ use S simpa only [forall_mem_range] using hS theorem HasCountableSeparatingOn.mono {α} {p₁ p₂ : Set α → Prop} {t₁ t₂ : Set α} [h : HasCountableSeparatingOn α p₁ t₁] (hp : ∀ s, p₁ s → p₂ s) (ht : t₂ ⊆ t₁) : HasCountableSeparatingOn α p₂ t₂ where exists_countable_separating := let ⟨S, hSc, hSp, hSt⟩ := h.1 ⟨S, hSc, fun s hs ↦ hp s (hSp s hs), fun x hx y hy ↦ hSt x (ht hx) y (ht hy)⟩ theorem HasCountableSeparatingOn.of_subtype {α : Type*} {p : Set α → Prop} {t : Set α} {q : Set t → Prop} [h : HasCountableSeparatingOn t q univ] (hpq : ∀ U, q U → ∃ V, p V ∧ (↑) ⁻¹' V = U) : HasCountableSeparatingOn α p t := by rcases h.1 with ⟨S, hSc, hSq, hS⟩ choose! V hpV hV using fun s hs ↦ hpq s (hSq s hs) refine ⟨⟨V '' S, hSc.image _, forall_mem_image.2 hpV, fun x hx y hy h ↦ ?_⟩⟩ refine congr_arg Subtype.val (hS ⟨x, hx⟩ trivial ⟨y, hy⟩ trivial fun U hU ↦ ?_) rw [← hV U hU] exact h _ (mem_image_of_mem _ hU) theorem HasCountableSeparatingOn.subtype_iff {α : Type*} {p : Set α → Prop} {t : Set α} : HasCountableSeparatingOn t (fun u ↦ ∃ v, p v ∧ (↑) ⁻¹' v = u) univ ↔ HasCountableSeparatingOn α p t := by constructor <;> intro h · exact h.of_subtype $ fun s ↦ id rcases h with ⟨S, Sct, Sp, hS⟩ use {Subtype.val ⁻¹' s | s ∈ S}, Sct.image _, ?_, ?_ · rintro u ⟨t, tS, rfl⟩ exact ⟨t, Sp _ tS, rfl⟩ rintro x - y - hxy exact Subtype.val_injective $ hS _ (Subtype.coe_prop _) _ (Subtype.coe_prop _) fun s hs ↦ hxy (Subtype.val ⁻¹' s) ⟨s, hs, rfl⟩ namespace Filter variable {l : Filter α} [CountableInterFilter l] {f g : α → β}
Mathlib/Order/Filter/CountableSeparatingOn.lean
158
172
theorem exists_subset_subsingleton_mem_of_forall_separating (p : Set α → Prop) {s : Set α} [h : HasCountableSeparatingOn α p s] (hs : s ∈ l) (hl : ∀ U, p U → U ∈ l ∨ Uᶜ ∈ l) : ∃ t, t ⊆ s ∧ t.Subsingleton ∧ t ∈ l := by
rcases h.1 with ⟨S, hSc, hSp, hS⟩ refine ⟨s ∩ ⋂₀ (S ∩ l.sets) ∩ ⋂ (U ∈ S) (_ : Uᶜ ∈ l), Uᶜ, ?_, ?_, ?_⟩ · exact fun _ h ↦ h.1.1 · intro x hx y hy simp only [mem_sInter, mem_inter_iff, mem_iInter, mem_compl_iff] at hx hy refine hS x hx.1.1 y hy.1.1 (fun s hsS ↦ ?_) cases hl s (hSp s hsS) with | inl hsl => simp only [hx.1.2 s ⟨hsS, hsl⟩, hy.1.2 s ⟨hsS, hsl⟩] | inr hsl => simp only [hx.2 s hsS hsl, hy.2 s hsS hsl] · exact inter_mem (inter_mem hs ((countable_sInter_mem (hSc.mono inter_subset_left)).2 fun _ h ↦ h.2)) ((countable_bInter_mem hSc).2 fun U hU ↦ iInter_mem.2 id)
12
162,754.791419
2
2
4
2,311
import Mathlib.Topology.UniformSpace.UniformConvergence import Mathlib.Topology.UniformSpace.Equicontinuity import Mathlib.Topology.Separation import Mathlib.Topology.Support #align_import topology.uniform_space.compact from "leanprover-community/mathlib"@"735b22f8f9ff9792cf4212d7cb051c4c994bc685" open scoped Classical open Uniformity Topology Filter UniformSpace Set variable {α β γ : Type*} [UniformSpace α] [UniformSpace β]
Mathlib/Topology/UniformSpace/Compact.lean
51
60
theorem nhdsSet_diagonal_eq_uniformity [CompactSpace α] : 𝓝ˢ (diagonal α) = 𝓤 α := by
refine nhdsSet_diagonal_le_uniformity.antisymm ?_ have : (𝓤 (α × α)).HasBasis (fun U => U ∈ 𝓤 α) fun U => (fun p : (α × α) × α × α => ((p.1.1, p.2.1), p.1.2, p.2.2)) ⁻¹' U ×ˢ U := by rw [uniformity_prod_eq_comap_prod] exact (𝓤 α).basis_sets.prod_self.comap _ refine (isCompact_diagonal.nhdsSet_basis_uniformity this).ge_iff.2 fun U hU => ?_ exact mem_of_superset hU fun ⟨x, y⟩ hxy => mem_iUnion₂.2 ⟨(x, x), rfl, refl_mem_uniformity hU, hxy⟩
9
8,103.083928
2
2
2
2,312
import Mathlib.Topology.UniformSpace.UniformConvergence import Mathlib.Topology.UniformSpace.Equicontinuity import Mathlib.Topology.Separation import Mathlib.Topology.Support #align_import topology.uniform_space.compact from "leanprover-community/mathlib"@"735b22f8f9ff9792cf4212d7cb051c4c994bc685" open scoped Classical open Uniformity Topology Filter UniformSpace Set variable {α β γ : Type*} [UniformSpace α] [UniformSpace β] theorem nhdsSet_diagonal_eq_uniformity [CompactSpace α] : 𝓝ˢ (diagonal α) = 𝓤 α := by refine nhdsSet_diagonal_le_uniformity.antisymm ?_ have : (𝓤 (α × α)).HasBasis (fun U => U ∈ 𝓤 α) fun U => (fun p : (α × α) × α × α => ((p.1.1, p.2.1), p.1.2, p.2.2)) ⁻¹' U ×ˢ U := by rw [uniformity_prod_eq_comap_prod] exact (𝓤 α).basis_sets.prod_self.comap _ refine (isCompact_diagonal.nhdsSet_basis_uniformity this).ge_iff.2 fun U hU => ?_ exact mem_of_superset hU fun ⟨x, y⟩ hxy => mem_iUnion₂.2 ⟨(x, x), rfl, refl_mem_uniformity hU, hxy⟩ #align nhds_set_diagonal_eq_uniformity nhdsSet_diagonal_eq_uniformity theorem compactSpace_uniformity [CompactSpace α] : 𝓤 α = ⨆ x, 𝓝 (x, x) := nhdsSet_diagonal_eq_uniformity.symm.trans (nhdsSet_diagonal _) #align compact_space_uniformity compactSpace_uniformity
Mathlib/Topology/UniformSpace/Compact.lean
69
75
theorem unique_uniformity_of_compact [t : TopologicalSpace γ] [CompactSpace γ] {u u' : UniformSpace γ} (h : u.toTopologicalSpace = t) (h' : u'.toTopologicalSpace = t) : u = u' := by
refine UniformSpace.ext ?_ have : @CompactSpace γ u.toTopologicalSpace := by rwa [h] have : @CompactSpace γ u'.toTopologicalSpace := by rwa [h'] rw [@compactSpace_uniformity _ u, compactSpace_uniformity, h, h']
4
54.59815
2
2
2
2,312
import Mathlib.Analysis.Complex.UpperHalfPlane.Basic import Mathlib.Analysis.Convex.Contractible import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Complex import Mathlib.Analysis.Complex.ReImTopology import Mathlib.Topology.Homotopy.Contractible import Mathlib.Topology.PartialHomeomorph #align_import analysis.complex.upper_half_plane.topology from "leanprover-community/mathlib"@"57f9349f2fe19d2de7207e99b0341808d977cdcf" noncomputable section open Set Filter Function TopologicalSpace Complex open scoped Filter Topology UpperHalfPlane namespace UpperHalfPlane instance : TopologicalSpace ℍ := instTopologicalSpaceSubtype theorem openEmbedding_coe : OpenEmbedding ((↑) : ℍ → ℂ) := IsOpen.openEmbedding_subtype_val <| isOpen_lt continuous_const Complex.continuous_im #align upper_half_plane.open_embedding_coe UpperHalfPlane.openEmbedding_coe theorem embedding_coe : Embedding ((↑) : ℍ → ℂ) := embedding_subtype_val #align upper_half_plane.embedding_coe UpperHalfPlane.embedding_coe theorem continuous_coe : Continuous ((↑) : ℍ → ℂ) := embedding_coe.continuous #align upper_half_plane.continuous_coe UpperHalfPlane.continuous_coe theorem continuous_re : Continuous re := Complex.continuous_re.comp continuous_coe #align upper_half_plane.continuous_re UpperHalfPlane.continuous_re theorem continuous_im : Continuous im := Complex.continuous_im.comp continuous_coe #align upper_half_plane.continuous_im UpperHalfPlane.continuous_im instance : SecondCountableTopology ℍ := TopologicalSpace.Subtype.secondCountableTopology _ instance : T3Space ℍ := Subtype.t3Space instance : T4Space ℍ := inferInstance instance : ContractibleSpace ℍ := (convex_halfspace_im_gt 0).contractibleSpace ⟨I, one_pos.trans_eq I_im.symm⟩ instance : LocPathConnectedSpace ℍ := locPathConnected_of_isOpen <| isOpen_lt continuous_const Complex.continuous_im instance : NoncompactSpace ℍ := by refine ⟨fun h => ?_⟩ have : IsCompact (Complex.im ⁻¹' Ioi 0) := isCompact_iff_isCompact_univ.2 h replace := this.isClosed.closure_eq rw [closure_preimage_im, closure_Ioi, Set.ext_iff] at this exact absurd ((this 0).1 (@left_mem_Ici ℝ _ 0)) (@lt_irrefl ℝ _ 0) instance : LocallyCompactSpace ℍ := openEmbedding_coe.locallyCompactSpace section strips def verticalStrip (A B : ℝ) := {z : ℍ | |z.re| ≤ A ∧ B ≤ z.im} theorem mem_verticalStrip_iff (A B : ℝ) (z : ℍ) : z ∈ verticalStrip A B ↔ |z.re| ≤ A ∧ B ≤ z.im := Iff.rfl @[gcongr] lemma verticalStrip_mono {A B A' B' : ℝ} (hA : A ≤ A') (hB : B' ≤ B) : verticalStrip A B ⊆ verticalStrip A' B' := by rintro z ⟨hzre, hzim⟩ exact ⟨hzre.trans hA, hB.trans hzim⟩ @[gcongr] lemma verticalStrip_mono_left {A A'} (h : A ≤ A') (B) : verticalStrip A B ⊆ verticalStrip A' B := verticalStrip_mono h le_rfl @[gcongr] lemma verticalStrip_anti_right (A) {B B'} (h : B' ≤ B) : verticalStrip A B ⊆ verticalStrip A B' := verticalStrip_mono le_rfl h lemma subset_verticalStrip_of_isCompact {K : Set ℍ} (hK : IsCompact K) : ∃ A B : ℝ, 0 < B ∧ K ⊆ verticalStrip A B := by rcases K.eq_empty_or_nonempty with rfl | hne · exact ⟨1, 1, Real.zero_lt_one, empty_subset _⟩ obtain ⟨u, _, hu⟩ := hK.exists_isMaxOn hne (_root_.continuous_abs.comp continuous_re).continuousOn obtain ⟨v, _, hv⟩ := hK.exists_isMinOn hne continuous_im.continuousOn exact ⟨|re u|, im v, v.im_pos, fun k hk ↦ ⟨isMaxOn_iff.mp hu _ hk, isMinOn_iff.mp hv _ hk⟩⟩
Mathlib/Analysis/Complex/UpperHalfPlane/Topology.lean
109
124
theorem ModularGroup_T_zpow_mem_verticalStrip (z : ℍ) {N : ℕ} (hn : 0 < N) : ∃ n : ℤ, ModularGroup.T ^ (N * n) • z ∈ verticalStrip N z.im := by
let n := Int.floor (z.re/N) use -n rw [modular_T_zpow_smul z (N * -n)] refine ⟨?_, (by simp only [mul_neg, Int.cast_neg, Int.cast_mul, Int.cast_natCast, vadd_im, le_refl])⟩ have h : (N * (-n : ℝ) +ᵥ z).re = -N * Int.floor (z.re / N) + z.re := by simp only [Int.cast_natCast, mul_neg, vadd_re, neg_mul] norm_cast at * rw [h, add_comm] simp only [neg_mul, Int.cast_neg, Int.cast_mul, Int.cast_natCast, ge_iff_le] have hnn : (0 : ℝ) < (N : ℝ) := by norm_cast at * have h2 : z.re + -(N * n) = z.re - n * N := by ring rw [h2, abs_eq_self.2 (Int.sub_floor_div_mul_nonneg (z.re : ℝ) hnn)] apply (Int.sub_floor_div_mul_lt (z.re : ℝ) hnn).le
14
1,202,604.284165
2
2
1
2,313
import Mathlib.GroupTheory.Perm.Cycle.Basic #align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open Equiv Function Finset variable {ι α β : Type*} namespace Equiv.Perm section Generation variable [Finite β] open Subgroup
Mathlib/GroupTheory/Perm/Closure.lean
37
41
theorem closure_isCycle : closure { σ : Perm β | IsCycle σ } = ⊤ := by
classical cases nonempty_fintype β exact top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle))
4
54.59815
2
2
4
2,314
import Mathlib.GroupTheory.Perm.Cycle.Basic #align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open Equiv Function Finset variable {ι α β : Type*} namespace Equiv.Perm section Generation variable [Finite β] open Subgroup theorem closure_isCycle : closure { σ : Perm β | IsCycle σ } = ⊤ := by classical cases nonempty_fintype β exact top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle)) #align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle variable [DecidableEq α] [Fintype α]
Mathlib/GroupTheory/Perm/Closure.lean
46
93
theorem closure_cycle_adjacent_swap {σ : Perm α} (h1 : IsCycle σ) (h2 : σ.support = ⊤) (x : α) : closure ({σ, swap x (σ x)} : Set (Perm α)) = ⊤ := by
let H := closure ({σ, swap x (σ x)} : Set (Perm α)) have h3 : σ ∈ H := subset_closure (Set.mem_insert σ _) have h4 : swap x (σ x) ∈ H := subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)) have step1 : ∀ n : ℕ, swap ((σ ^ n) x) ((σ ^ (n + 1) : Perm α) x) ∈ H := by intro n induction' n with n ih · exact subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)) · convert H.mul_mem (H.mul_mem h3 ih) (H.inv_mem h3) simp_rw [mul_swap_eq_swap_mul, mul_inv_cancel_right, pow_succ'] rfl have step2 : ∀ n : ℕ, swap x ((σ ^ n) x) ∈ H := by intro n induction' n with n ih · simp only [Nat.zero_eq, pow_zero, coe_one, id_eq, swap_self, Set.mem_singleton_iff] convert H.one_mem · by_cases h5 : x = (σ ^ n) x · rw [pow_succ', mul_apply, ← h5] exact h4 by_cases h6 : x = (σ ^ (n + 1) : Perm α) x · rw [← h6, swap_self] exact H.one_mem rw [swap_comm, ← swap_mul_swap_mul_swap h5 h6] exact H.mul_mem (H.mul_mem (step1 n) ih) (step1 n) have step3 : ∀ y : α, swap x y ∈ H := by intro y have hx : x ∈ (⊤ : Finset α) := Finset.mem_univ x rw [← h2, mem_support] at hx have hy : y ∈ (⊤ : Finset α) := Finset.mem_univ y rw [← h2, mem_support] at hy cases' IsCycle.exists_pow_eq h1 hx hy with n hn rw [← hn] exact step2 n have step4 : ∀ y z : α, swap y z ∈ H := by intro y z by_cases h5 : z = x · rw [h5, swap_comm] exact step3 y by_cases h6 : z = y · rw [h6, swap_self] exact H.one_mem rw [← swap_mul_swap_mul_swap h5 h6, swap_comm z x] exact H.mul_mem (H.mul_mem (step3 y) (step3 z)) (step3 y) rw [eq_top_iff, ← closure_isSwap, closure_le] rintro τ ⟨y, z, _, h6⟩ rw [h6] exact step4 y z
46
94,961,194,206,024,480,000
2
2
4
2,314
import Mathlib.GroupTheory.Perm.Cycle.Basic #align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open Equiv Function Finset variable {ι α β : Type*} namespace Equiv.Perm section Generation variable [Finite β] open Subgroup theorem closure_isCycle : closure { σ : Perm β | IsCycle σ } = ⊤ := by classical cases nonempty_fintype β exact top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle)) #align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle variable [DecidableEq α] [Fintype α] theorem closure_cycle_adjacent_swap {σ : Perm α} (h1 : IsCycle σ) (h2 : σ.support = ⊤) (x : α) : closure ({σ, swap x (σ x)} : Set (Perm α)) = ⊤ := by let H := closure ({σ, swap x (σ x)} : Set (Perm α)) have h3 : σ ∈ H := subset_closure (Set.mem_insert σ _) have h4 : swap x (σ x) ∈ H := subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)) have step1 : ∀ n : ℕ, swap ((σ ^ n) x) ((σ ^ (n + 1) : Perm α) x) ∈ H := by intro n induction' n with n ih · exact subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)) · convert H.mul_mem (H.mul_mem h3 ih) (H.inv_mem h3) simp_rw [mul_swap_eq_swap_mul, mul_inv_cancel_right, pow_succ'] rfl have step2 : ∀ n : ℕ, swap x ((σ ^ n) x) ∈ H := by intro n induction' n with n ih · simp only [Nat.zero_eq, pow_zero, coe_one, id_eq, swap_self, Set.mem_singleton_iff] convert H.one_mem · by_cases h5 : x = (σ ^ n) x · rw [pow_succ', mul_apply, ← h5] exact h4 by_cases h6 : x = (σ ^ (n + 1) : Perm α) x · rw [← h6, swap_self] exact H.one_mem rw [swap_comm, ← swap_mul_swap_mul_swap h5 h6] exact H.mul_mem (H.mul_mem (step1 n) ih) (step1 n) have step3 : ∀ y : α, swap x y ∈ H := by intro y have hx : x ∈ (⊤ : Finset α) := Finset.mem_univ x rw [← h2, mem_support] at hx have hy : y ∈ (⊤ : Finset α) := Finset.mem_univ y rw [← h2, mem_support] at hy cases' IsCycle.exists_pow_eq h1 hx hy with n hn rw [← hn] exact step2 n have step4 : ∀ y z : α, swap y z ∈ H := by intro y z by_cases h5 : z = x · rw [h5, swap_comm] exact step3 y by_cases h6 : z = y · rw [h6, swap_self] exact H.one_mem rw [← swap_mul_swap_mul_swap h5 h6, swap_comm z x] exact H.mul_mem (H.mul_mem (step3 y) (step3 z)) (step3 y) rw [eq_top_iff, ← closure_isSwap, closure_le] rintro τ ⟨y, z, _, h6⟩ rw [h6] exact step4 y z #align equiv.perm.closure_cycle_adjacent_swap Equiv.Perm.closure_cycle_adjacent_swap
Mathlib/GroupTheory/Perm/Closure.lean
96
108
theorem closure_cycle_coprime_swap {n : ℕ} {σ : Perm α} (h0 : Nat.Coprime n (Fintype.card α)) (h1 : IsCycle σ) (h2 : σ.support = Finset.univ) (x : α) : closure ({σ, swap x ((σ ^ n) x)} : Set (Perm α)) = ⊤ := by
rw [← Finset.card_univ, ← h2, ← h1.orderOf] at h0 cases' exists_pow_eq_self_of_coprime h0 with m hm have h2' : (σ ^ n).support = ⊤ := Eq.trans (support_pow_coprime h0) h2 have h1' : IsCycle ((σ ^ n) ^ (m : ℤ)) := by rwa [← hm] at h1 replace h1' : IsCycle (σ ^ n) := h1'.of_pow (le_trans (support_pow_le σ n) (ge_of_eq (congr_arg support hm))) rw [eq_top_iff, ← closure_cycle_adjacent_swap h1' h2' x, closure_le, Set.insert_subset_iff] exact ⟨Subgroup.pow_mem (closure _) (subset_closure (Set.mem_insert σ _)) n, Set.singleton_subset_iff.mpr (subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)))⟩
10
22,026.465795
2
2
4
2,314
import Mathlib.GroupTheory.Perm.Cycle.Basic #align_import group_theory.perm.cycle.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open Equiv Function Finset variable {ι α β : Type*} namespace Equiv.Perm section Generation variable [Finite β] open Subgroup theorem closure_isCycle : closure { σ : Perm β | IsCycle σ } = ⊤ := by classical cases nonempty_fintype β exact top_le_iff.mp (le_trans (ge_of_eq closure_isSwap) (closure_mono fun _ => IsSwap.isCycle)) #align equiv.perm.closure_is_cycle Equiv.Perm.closure_isCycle variable [DecidableEq α] [Fintype α] theorem closure_cycle_adjacent_swap {σ : Perm α} (h1 : IsCycle σ) (h2 : σ.support = ⊤) (x : α) : closure ({σ, swap x (σ x)} : Set (Perm α)) = ⊤ := by let H := closure ({σ, swap x (σ x)} : Set (Perm α)) have h3 : σ ∈ H := subset_closure (Set.mem_insert σ _) have h4 : swap x (σ x) ∈ H := subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)) have step1 : ∀ n : ℕ, swap ((σ ^ n) x) ((σ ^ (n + 1) : Perm α) x) ∈ H := by intro n induction' n with n ih · exact subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)) · convert H.mul_mem (H.mul_mem h3 ih) (H.inv_mem h3) simp_rw [mul_swap_eq_swap_mul, mul_inv_cancel_right, pow_succ'] rfl have step2 : ∀ n : ℕ, swap x ((σ ^ n) x) ∈ H := by intro n induction' n with n ih · simp only [Nat.zero_eq, pow_zero, coe_one, id_eq, swap_self, Set.mem_singleton_iff] convert H.one_mem · by_cases h5 : x = (σ ^ n) x · rw [pow_succ', mul_apply, ← h5] exact h4 by_cases h6 : x = (σ ^ (n + 1) : Perm α) x · rw [← h6, swap_self] exact H.one_mem rw [swap_comm, ← swap_mul_swap_mul_swap h5 h6] exact H.mul_mem (H.mul_mem (step1 n) ih) (step1 n) have step3 : ∀ y : α, swap x y ∈ H := by intro y have hx : x ∈ (⊤ : Finset α) := Finset.mem_univ x rw [← h2, mem_support] at hx have hy : y ∈ (⊤ : Finset α) := Finset.mem_univ y rw [← h2, mem_support] at hy cases' IsCycle.exists_pow_eq h1 hx hy with n hn rw [← hn] exact step2 n have step4 : ∀ y z : α, swap y z ∈ H := by intro y z by_cases h5 : z = x · rw [h5, swap_comm] exact step3 y by_cases h6 : z = y · rw [h6, swap_self] exact H.one_mem rw [← swap_mul_swap_mul_swap h5 h6, swap_comm z x] exact H.mul_mem (H.mul_mem (step3 y) (step3 z)) (step3 y) rw [eq_top_iff, ← closure_isSwap, closure_le] rintro τ ⟨y, z, _, h6⟩ rw [h6] exact step4 y z #align equiv.perm.closure_cycle_adjacent_swap Equiv.Perm.closure_cycle_adjacent_swap theorem closure_cycle_coprime_swap {n : ℕ} {σ : Perm α} (h0 : Nat.Coprime n (Fintype.card α)) (h1 : IsCycle σ) (h2 : σ.support = Finset.univ) (x : α) : closure ({σ, swap x ((σ ^ n) x)} : Set (Perm α)) = ⊤ := by rw [← Finset.card_univ, ← h2, ← h1.orderOf] at h0 cases' exists_pow_eq_self_of_coprime h0 with m hm have h2' : (σ ^ n).support = ⊤ := Eq.trans (support_pow_coprime h0) h2 have h1' : IsCycle ((σ ^ n) ^ (m : ℤ)) := by rwa [← hm] at h1 replace h1' : IsCycle (σ ^ n) := h1'.of_pow (le_trans (support_pow_le σ n) (ge_of_eq (congr_arg support hm))) rw [eq_top_iff, ← closure_cycle_adjacent_swap h1' h2' x, closure_le, Set.insert_subset_iff] exact ⟨Subgroup.pow_mem (closure _) (subset_closure (Set.mem_insert σ _)) n, Set.singleton_subset_iff.mpr (subset_closure (Set.mem_insert_of_mem _ (Set.mem_singleton _)))⟩ #align equiv.perm.closure_cycle_coprime_swap Equiv.Perm.closure_cycle_coprime_swap
Mathlib/GroupTheory/Perm/Closure.lean
111
122
theorem closure_prime_cycle_swap {σ τ : Perm α} (h0 : (Fintype.card α).Prime) (h1 : IsCycle σ) (h2 : σ.support = Finset.univ) (h3 : IsSwap τ) : closure ({σ, τ} : Set (Perm α)) = ⊤ := by
obtain ⟨x, y, h4, h5⟩ := h3 obtain ⟨i, hi⟩ := h1.exists_pow_eq (mem_support.mp ((Finset.ext_iff.mp h2 x).mpr (Finset.mem_univ x))) (mem_support.mp ((Finset.ext_iff.mp h2 y).mpr (Finset.mem_univ y))) rw [h5, ← hi] refine closure_cycle_coprime_swap (Nat.Coprime.symm (h0.coprime_iff_not_dvd.mpr fun h => h4 ?_)) h1 h2 x cases' h with m hm rwa [hm, pow_mul, ← Finset.card_univ, ← h2, ← h1.orderOf, pow_orderOf_eq_one, one_pow, one_apply] at hi
10
22,026.465795
2
2
4
2,314
import Mathlib.Order.CompleteLatticeIntervals import Mathlib.Order.CompactlyGenerated.Basic variable {ι α : Type*} [CompleteLattice α] namespace Set.Iic
Mathlib/Order/CompactlyGenerated/Intervals.lean
18
24
theorem isCompactElement {a : α} {b : Iic a} (h : CompleteLattice.IsCompactElement (b : α)) : CompleteLattice.IsCompactElement b := by
simp only [CompleteLattice.isCompactElement_iff, Finset.sup_eq_iSup] at h ⊢ intro ι s hb replace hb : (b : α) ≤ iSup ((↑) ∘ s) := le_trans hb <| (coe_iSup s) ▸ le_refl _ obtain ⟨t, ht⟩ := h ι ((↑) ∘ s) hb exact ⟨t, (by simpa using ht : (b : α) ≤ _)⟩
5
148.413159
2
2
1
2,315
import Mathlib.Geometry.Euclidean.Inversion.Basic import Mathlib.Analysis.InnerProductSpace.Calculus import Mathlib.Analysis.Calculus.Deriv.Inv import Mathlib.Tactic.AdaptationNote open Metric Function AffineMap Set AffineSubspace open scoped Topology RealInnerProductSpace variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [InnerProductSpace ℝ F] open EuclideanGeometry namespace EuclideanGeometry variable {a b c d x y z : F} {r R : ℝ}
Mathlib/Geometry/Euclidean/Inversion/Calculus.lean
87
108
theorem hasFDerivAt_inversion (hx : x ≠ c) : HasFDerivAt (inversion c R) ((R / dist x c) ^ 2 • (reflection (ℝ ∙ (x - c))ᗮ : F →L[ℝ] F)) x := by
rcases add_left_surjective c x with ⟨x, rfl⟩ have : HasFDerivAt (inversion c R) (?_ : F →L[ℝ] F) (c + x) := by #adaptation_note /-- nightly-2024-03-16: simp was simp (config := { unfoldPartialApp := true }) only [inversion] -/ simp only [inversion_def] simp_rw [dist_eq_norm, div_pow, div_eq_mul_inv] have A := (hasFDerivAt_id (𝕜 := ℝ) (c + x)).sub_const c have B := ((hasDerivAt_inv <| by simpa using hx).comp_hasFDerivAt _ A.norm_sq).const_mul (R ^ 2) exact (B.smul A).add_const c refine this.congr_fderiv (LinearMap.ext_on_codisjoint (Submodule.isCompl_orthogonal_of_completeSpace (K := ℝ ∙ x)).codisjoint (LinearMap.eqOn_span' ?_) fun y hy ↦ ?_) · have : ((‖x‖ ^ 2) ^ 2)⁻¹ * (‖x‖ ^ 2) = (‖x‖ ^ 2)⁻¹ := by rw [← div_eq_inv_mul, sq (‖x‖ ^ 2), div_self_mul_self'] simp [reflection_orthogonalComplement_singleton_eq_neg, real_inner_self_eq_norm_sq, two_mul, this, div_eq_mul_inv, mul_add, add_smul, mul_pow] · simp [Submodule.mem_orthogonal_singleton_iff_inner_right.1 hy, reflection_mem_subspace_eq_self hy, div_eq_mul_inv, mul_pow]
19
178,482,300.963187
2
2
1
2,316
import Mathlib.CategoryTheory.GlueData import Mathlib.Topology.Category.TopCat.Limits.Pullbacks import Mathlib.Topology.Category.TopCat.Opens import Mathlib.Tactic.Generalize import Mathlib.CategoryTheory.Elementwise #align_import topology.gluing from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1" noncomputable section open TopologicalSpace CategoryTheory universe v u open CategoryTheory.Limits namespace TopCat -- porting note (#5171): removed @[nolint has_nonempty_instance] structure GlueData extends GlueData TopCat where f_open : ∀ i j, OpenEmbedding (f i j) f_mono := fun i j => (TopCat.mono_iff_injective _).mpr (f_open i j).toEmbedding.inj set_option linter.uppercaseLean3 false in #align Top.glue_data TopCat.GlueData namespace GlueData variable (D : GlueData.{u}) local notation "𝖣" => D.toGlueData theorem π_surjective : Function.Surjective 𝖣.π := (TopCat.epi_iff_surjective 𝖣.π).mp inferInstance set_option linter.uppercaseLean3 false in #align Top.glue_data.π_surjective TopCat.GlueData.π_surjective
Mathlib/Topology/Gluing.lean
104
115
theorem isOpen_iff (U : Set 𝖣.glued) : IsOpen U ↔ ∀ i, IsOpen (𝖣.ι i ⁻¹' U) := by
delta CategoryTheory.GlueData.ι simp_rw [← Multicoequalizer.ι_sigmaπ 𝖣.diagram] rw [← (homeoOfIso (Multicoequalizer.isoCoequalizer 𝖣.diagram).symm).isOpen_preimage] rw [coequalizer_isOpen_iff] dsimp only [GlueData.diagram_l, GlueData.diagram_left, GlueData.diagram_r, GlueData.diagram_right, parallelPair_obj_one] rw [colimit_isOpen_iff.{_,u}] -- Porting note: changed `.{u}` to `.{_,u}`. fun fact: the proof -- breaks down if this `rw` is merged with the `rw` above. constructor · intro h j; exact h ⟨j⟩ · intro h j; cases j; apply h
11
59,874.141715
2
2
3
2,317
import Mathlib.CategoryTheory.GlueData import Mathlib.Topology.Category.TopCat.Limits.Pullbacks import Mathlib.Topology.Category.TopCat.Opens import Mathlib.Tactic.Generalize import Mathlib.CategoryTheory.Elementwise #align_import topology.gluing from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1" noncomputable section open TopologicalSpace CategoryTheory universe v u open CategoryTheory.Limits namespace TopCat -- porting note (#5171): removed @[nolint has_nonempty_instance] structure GlueData extends GlueData TopCat where f_open : ∀ i j, OpenEmbedding (f i j) f_mono := fun i j => (TopCat.mono_iff_injective _).mpr (f_open i j).toEmbedding.inj set_option linter.uppercaseLean3 false in #align Top.glue_data TopCat.GlueData namespace GlueData variable (D : GlueData.{u}) local notation "𝖣" => D.toGlueData theorem π_surjective : Function.Surjective 𝖣.π := (TopCat.epi_iff_surjective 𝖣.π).mp inferInstance set_option linter.uppercaseLean3 false in #align Top.glue_data.π_surjective TopCat.GlueData.π_surjective theorem isOpen_iff (U : Set 𝖣.glued) : IsOpen U ↔ ∀ i, IsOpen (𝖣.ι i ⁻¹' U) := by delta CategoryTheory.GlueData.ι simp_rw [← Multicoequalizer.ι_sigmaπ 𝖣.diagram] rw [← (homeoOfIso (Multicoequalizer.isoCoequalizer 𝖣.diagram).symm).isOpen_preimage] rw [coequalizer_isOpen_iff] dsimp only [GlueData.diagram_l, GlueData.diagram_left, GlueData.diagram_r, GlueData.diagram_right, parallelPair_obj_one] rw [colimit_isOpen_iff.{_,u}] -- Porting note: changed `.{u}` to `.{_,u}`. fun fact: the proof -- breaks down if this `rw` is merged with the `rw` above. constructor · intro h j; exact h ⟨j⟩ · intro h j; cases j; apply h set_option linter.uppercaseLean3 false in #align Top.glue_data.is_open_iff TopCat.GlueData.isOpen_iff theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : _) (y : D.U i), 𝖣.ι i y = x := 𝖣.ι_jointly_surjective (forget TopCat) x set_option linter.uppercaseLean3 false in #align Top.glue_data.ι_jointly_surjective TopCat.GlueData.ι_jointly_surjective def Rel (a b : Σ i, ((D.U i : TopCat) : Type _)) : Prop := a = b ∨ ∃ x : D.V (a.1, b.1), D.f _ _ x = a.2 ∧ D.f _ _ (D.t _ _ x) = b.2 set_option linter.uppercaseLean3 false in #align Top.glue_data.rel TopCat.GlueData.Rel
Mathlib/Topology/Gluing.lean
132
158
theorem rel_equiv : Equivalence D.Rel := ⟨fun x => Or.inl (refl x), by rintro a b (⟨⟨⟩⟩ | ⟨x, e₁, e₂⟩) exacts [Or.inl rfl, Or.inr ⟨D.t _ _ x, e₂, by erw [← e₁, D.t_inv_apply]⟩], by -- previous line now `erw` after #13170 rintro ⟨i, a⟩ ⟨j, b⟩ ⟨k, c⟩ (⟨⟨⟩⟩ | ⟨x, e₁, e₂⟩) · exact id rintro (⟨⟨⟩⟩ | ⟨y, e₃, e₄⟩) · exact Or.inr ⟨x, e₁, e₂⟩ let z := (pullbackIsoProdSubtype (D.f j i) (D.f j k)).inv ⟨⟨_, _⟩, e₂.trans e₃.symm⟩ have eq₁ : (D.t j i) ((pullback.fst : _ /-(D.f j k)-/ ⟶ D.V (j, i)) z) = x := by
dsimp only [coe_of, z] erw [pullbackIsoProdSubtype_inv_fst_apply, D.t_inv_apply]-- now `erw` after #13170 have eq₂ : (pullback.snd : _ ⟶ D.V _) z = y := pullbackIsoProdSubtype_inv_snd_apply _ _ _ clear_value z right use (pullback.fst : _ ⟶ D.V (i, k)) (D.t' _ _ _ z) dsimp only at * substs eq₁ eq₂ e₁ e₃ e₄ have h₁ : D.t' j i k ≫ pullback.fst ≫ D.f i k = pullback.fst ≫ D.t j i ≫ D.f i j := by rw [← 𝖣.t_fac_assoc]; congr 1; exact pullback.condition have h₂ : D.t' j i k ≫ pullback.fst ≫ D.t i k ≫ D.f k i = pullback.snd ≫ D.t j k ≫ D.f k j := by rw [← 𝖣.t_fac_assoc] apply @Epi.left_cancellation _ _ _ _ (D.t' k j i) rw [𝖣.cocycle_assoc, 𝖣.t_fac_assoc, 𝖣.t_inv_assoc] exact pullback.condition.symm exact ⟨ContinuousMap.congr_fun h₁ z, ContinuousMap.congr_fun h₂ z⟩⟩
16
8,886,110.520508
2
2
3
2,317
import Mathlib.CategoryTheory.GlueData import Mathlib.Topology.Category.TopCat.Limits.Pullbacks import Mathlib.Topology.Category.TopCat.Opens import Mathlib.Tactic.Generalize import Mathlib.CategoryTheory.Elementwise #align_import topology.gluing from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1" noncomputable section open TopologicalSpace CategoryTheory universe v u open CategoryTheory.Limits namespace TopCat -- porting note (#5171): removed @[nolint has_nonempty_instance] structure GlueData extends GlueData TopCat where f_open : ∀ i j, OpenEmbedding (f i j) f_mono := fun i j => (TopCat.mono_iff_injective _).mpr (f_open i j).toEmbedding.inj set_option linter.uppercaseLean3 false in #align Top.glue_data TopCat.GlueData namespace GlueData variable (D : GlueData.{u}) local notation "𝖣" => D.toGlueData theorem π_surjective : Function.Surjective 𝖣.π := (TopCat.epi_iff_surjective 𝖣.π).mp inferInstance set_option linter.uppercaseLean3 false in #align Top.glue_data.π_surjective TopCat.GlueData.π_surjective theorem isOpen_iff (U : Set 𝖣.glued) : IsOpen U ↔ ∀ i, IsOpen (𝖣.ι i ⁻¹' U) := by delta CategoryTheory.GlueData.ι simp_rw [← Multicoequalizer.ι_sigmaπ 𝖣.diagram] rw [← (homeoOfIso (Multicoequalizer.isoCoequalizer 𝖣.diagram).symm).isOpen_preimage] rw [coequalizer_isOpen_iff] dsimp only [GlueData.diagram_l, GlueData.diagram_left, GlueData.diagram_r, GlueData.diagram_right, parallelPair_obj_one] rw [colimit_isOpen_iff.{_,u}] -- Porting note: changed `.{u}` to `.{_,u}`. fun fact: the proof -- breaks down if this `rw` is merged with the `rw` above. constructor · intro h j; exact h ⟨j⟩ · intro h j; cases j; apply h set_option linter.uppercaseLean3 false in #align Top.glue_data.is_open_iff TopCat.GlueData.isOpen_iff theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : _) (y : D.U i), 𝖣.ι i y = x := 𝖣.ι_jointly_surjective (forget TopCat) x set_option linter.uppercaseLean3 false in #align Top.glue_data.ι_jointly_surjective TopCat.GlueData.ι_jointly_surjective def Rel (a b : Σ i, ((D.U i : TopCat) : Type _)) : Prop := a = b ∨ ∃ x : D.V (a.1, b.1), D.f _ _ x = a.2 ∧ D.f _ _ (D.t _ _ x) = b.2 set_option linter.uppercaseLean3 false in #align Top.glue_data.rel TopCat.GlueData.Rel theorem rel_equiv : Equivalence D.Rel := ⟨fun x => Or.inl (refl x), by rintro a b (⟨⟨⟩⟩ | ⟨x, e₁, e₂⟩) exacts [Or.inl rfl, Or.inr ⟨D.t _ _ x, e₂, by erw [← e₁, D.t_inv_apply]⟩], by -- previous line now `erw` after #13170 rintro ⟨i, a⟩ ⟨j, b⟩ ⟨k, c⟩ (⟨⟨⟩⟩ | ⟨x, e₁, e₂⟩) · exact id rintro (⟨⟨⟩⟩ | ⟨y, e₃, e₄⟩) · exact Or.inr ⟨x, e₁, e₂⟩ let z := (pullbackIsoProdSubtype (D.f j i) (D.f j k)).inv ⟨⟨_, _⟩, e₂.trans e₃.symm⟩ have eq₁ : (D.t j i) ((pullback.fst : _ ⟶ D.V (j, i)) z) = x := by dsimp only [coe_of, z] erw [pullbackIsoProdSubtype_inv_fst_apply, D.t_inv_apply]-- now `erw` after #13170 have eq₂ : (pullback.snd : _ ⟶ D.V _) z = y := pullbackIsoProdSubtype_inv_snd_apply _ _ _ clear_value z right use (pullback.fst : _ ⟶ D.V (i, k)) (D.t' _ _ _ z) dsimp only at * substs eq₁ eq₂ e₁ e₃ e₄ have h₁ : D.t' j i k ≫ pullback.fst ≫ D.f i k = pullback.fst ≫ D.t j i ≫ D.f i j := by rw [← 𝖣.t_fac_assoc]; congr 1; exact pullback.condition have h₂ : D.t' j i k ≫ pullback.fst ≫ D.t i k ≫ D.f k i = pullback.snd ≫ D.t j k ≫ D.f k j := by rw [← 𝖣.t_fac_assoc] apply @Epi.left_cancellation _ _ _ _ (D.t' k j i) rw [𝖣.cocycle_assoc, 𝖣.t_fac_assoc, 𝖣.t_inv_assoc] exact pullback.condition.symm exact ⟨ContinuousMap.congr_fun h₁ z, ContinuousMap.congr_fun h₂ z⟩⟩ set_option linter.uppercaseLean3 false in #align Top.glue_data.rel_equiv TopCat.GlueData.rel_equiv open CategoryTheory.Limits.WalkingParallelPair
Mathlib/Topology/Gluing.lean
164
201
theorem eqvGen_of_π_eq -- Porting note: was `{x y : ∐ D.U} (h : 𝖣.π x = 𝖣.π y)` {x y : sigmaObj (β := D.toGlueData.J) (C := TopCat) D.toGlueData.U} (h : 𝖣.π x = 𝖣.π y) : EqvGen -- Porting note: was (Types.CoequalizerRel 𝖣.diagram.fstSigmaMap 𝖣.diagram.sndSigmaMap) (Types.CoequalizerRel (X := sigmaObj (β := D.toGlueData.diagram.L) (C := TopCat) (D.toGlueData.diagram).left) (Y := sigmaObj (β := D.toGlueData.diagram.R) (C := TopCat) (D.toGlueData.diagram).right) 𝖣.diagram.fstSigmaMap 𝖣.diagram.sndSigmaMap) x y := by
delta GlueData.π Multicoequalizer.sigmaπ at h -- Porting note: inlined `inferInstance` instead of leaving as a side goal. replace h := (TopCat.mono_iff_injective (Multicoequalizer.isoCoequalizer 𝖣.diagram).inv).mp inferInstance h let diagram := parallelPair 𝖣.diagram.fstSigmaMap 𝖣.diagram.sndSigmaMap ⋙ forget _ have : colimit.ι diagram one x = colimit.ι diagram one y := by dsimp only [coequalizer.π, ContinuousMap.toFun_eq_coe] at h -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← ι_preservesColimitsIso_hom, forget_map_eq_coe, types_comp_apply, h] simp rfl have : (colimit.ι diagram _ ≫ colim.map _ ≫ (colimit.isoColimitCocone _).hom) _ = (colimit.ι diagram _ ≫ colim.map _ ≫ (colimit.isoColimitCocone _).hom) _ := (congr_arg (colim.map (diagramIsoParallelPair diagram).hom ≫ (colimit.isoColimitCocone (Types.coequalizerColimit _ _)).hom) this : _) -- Porting note: was -- simp only [eqToHom_refl, types_comp_apply, colimit.ι_map_assoc, -- diagramIsoParallelPair_hom_app, colimit.isoColimitCocone_ι_hom, types_id_apply] at this -- See https://github.com/leanprover-community/mathlib4/issues/5026 rw [colimit.ι_map_assoc, diagramIsoParallelPair_hom_app, eqToHom_refl, colimit.isoColimitCocone_ι_hom, types_comp_apply, types_id_apply, types_comp_apply, types_id_apply] at this exact Quot.eq.1 this
27
532,048,240,601.79865
2
2
3
2,317
import Mathlib.Analysis.Calculus.SmoothSeries import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct import Mathlib.Analysis.Convolution import Mathlib.Analysis.InnerProductSpace.EuclideanDist import Mathlib.Data.Set.Pointwise.Support import Mathlib.MeasureTheory.Measure.Haar.NormedSpace import Mathlib.MeasureTheory.Measure.Haar.Unique #align_import analysis.calculus.bump_function_findim from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section open Set Metric TopologicalSpace Function Asymptotics MeasureTheory FiniteDimensional ContinuousLinearMap Filter MeasureTheory.Measure Bornology open scoped Pointwise Topology NNReal Convolution variable {E : Type*} [NormedAddCommGroup E] section variable [NormedSpace ℝ E] [FiniteDimensional ℝ E]
Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean
43
73
theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) : ∃ f : E → ℝ, tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by
obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ := Euclidean.nhds_basis_closedBall.mem_iff.1 hs let c : ContDiffBump (toEuclidean x) := { rIn := d / 2 rOut := d rIn_pos := half_pos d_pos rIn_lt_rOut := half_lt_self d_pos } let f : E → ℝ := c ∘ toEuclidean have f_supp : f.support ⊆ Euclidean.ball x d := by intro y hy have : toEuclidean y ∈ Function.support c := by simpa only [Function.mem_support, Function.comp_apply, Ne] using hy rwa [c.support_eq] at this have f_tsupp : tsupport f ⊆ Euclidean.closedBall x d := by rw [tsupport, ← Euclidean.closure_ball _ d_pos.ne'] exact closure_mono f_supp refine ⟨f, f_tsupp.trans hd, ?_, ?_, ?_, ?_⟩ · refine isCompact_of_isClosed_isBounded isClosed_closure ?_ have : IsBounded (Euclidean.closedBall x d) := Euclidean.isCompact_closedBall.isBounded refine this.subset (Euclidean.isClosed_closedBall.closure_subset_iff.2 ?_) exact f_supp.trans Euclidean.ball_subset_closedBall · apply c.contDiff.comp exact ContinuousLinearEquiv.contDiff _ · rintro t ⟨y, rfl⟩ exact ⟨c.nonneg, c.le_one⟩ · apply c.one_of_mem_closedBall apply mem_closedBall_self exact (half_pos d_pos).le
28
1,446,257,064,291.475
2
2
2
2,318
import Mathlib.Analysis.Calculus.SmoothSeries import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct import Mathlib.Analysis.Convolution import Mathlib.Analysis.InnerProductSpace.EuclideanDist import Mathlib.Data.Set.Pointwise.Support import Mathlib.MeasureTheory.Measure.Haar.NormedSpace import Mathlib.MeasureTheory.Measure.Haar.Unique #align_import analysis.calculus.bump_function_findim from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section open Set Metric TopologicalSpace Function Asymptotics MeasureTheory FiniteDimensional ContinuousLinearMap Filter MeasureTheory.Measure Bornology open scoped Pointwise Topology NNReal Convolution variable {E : Type*} [NormedAddCommGroup E] section variable [NormedSpace ℝ E] [FiniteDimensional ℝ E] theorem exists_smooth_tsupport_subset {s : Set E} {x : E} (hs : s ∈ 𝓝 x) : ∃ f : E → ℝ, tsupport f ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 ∧ f x = 1 := by obtain ⟨d : ℝ, d_pos : 0 < d, hd : Euclidean.closedBall x d ⊆ s⟩ := Euclidean.nhds_basis_closedBall.mem_iff.1 hs let c : ContDiffBump (toEuclidean x) := { rIn := d / 2 rOut := d rIn_pos := half_pos d_pos rIn_lt_rOut := half_lt_self d_pos } let f : E → ℝ := c ∘ toEuclidean have f_supp : f.support ⊆ Euclidean.ball x d := by intro y hy have : toEuclidean y ∈ Function.support c := by simpa only [Function.mem_support, Function.comp_apply, Ne] using hy rwa [c.support_eq] at this have f_tsupp : tsupport f ⊆ Euclidean.closedBall x d := by rw [tsupport, ← Euclidean.closure_ball _ d_pos.ne'] exact closure_mono f_supp refine ⟨f, f_tsupp.trans hd, ?_, ?_, ?_, ?_⟩ · refine isCompact_of_isClosed_isBounded isClosed_closure ?_ have : IsBounded (Euclidean.closedBall x d) := Euclidean.isCompact_closedBall.isBounded refine this.subset (Euclidean.isClosed_closedBall.closure_subset_iff.2 ?_) exact f_supp.trans Euclidean.ball_subset_closedBall · apply c.contDiff.comp exact ContinuousLinearEquiv.contDiff _ · rintro t ⟨y, rfl⟩ exact ⟨c.nonneg, c.le_one⟩ · apply c.one_of_mem_closedBall apply mem_closedBall_self exact (half_pos d_pos).le #align exists_smooth_tsupport_subset exists_smooth_tsupport_subset
Mathlib/Analysis/Calculus/BumpFunction/FiniteDimension.lean
78
192
theorem IsOpen.exists_smooth_support_eq {s : Set E} (hs : IsOpen s) : ∃ f : E → ℝ, f.support = s ∧ ContDiff ℝ ⊤ f ∧ Set.range f ⊆ Set.Icc 0 1 := by
/- For any given point `x` in `s`, one can construct a smooth function with support in `s` and nonzero at `x`. By second-countability, it follows that we may cover `s` with the supports of countably many such functions, say `g i`. Then `∑ i, r i • g i` will be the desired function if `r i` is a sequence of positive numbers tending quickly enough to zero. Indeed, this ensures that, for any `k ≤ i`, the `k`-th derivative of `r i • g i` is bounded by a prescribed (summable) sequence `u i`. From this, the summability of the series and of its successive derivatives follows. -/ rcases eq_empty_or_nonempty s with (rfl | h's) · exact ⟨fun _ => 0, Function.support_zero, contDiff_const, by simp only [range_const, singleton_subset_iff, left_mem_Icc, zero_le_one]⟩ let ι := { f : E → ℝ // f.support ⊆ s ∧ HasCompactSupport f ∧ ContDiff ℝ ⊤ f ∧ range f ⊆ Icc 0 1 } obtain ⟨T, T_count, hT⟩ : ∃ T : Set ι, T.Countable ∧ ⋃ f ∈ T, support (f : E → ℝ) = s := by have : ⋃ f : ι, (f : E → ℝ).support = s := by refine Subset.antisymm (iUnion_subset fun f => f.2.1) ?_ intro x hx rcases exists_smooth_tsupport_subset (hs.mem_nhds hx) with ⟨f, hf⟩ let g : ι := ⟨f, (subset_tsupport f).trans hf.1, hf.2.1, hf.2.2.1, hf.2.2.2.1⟩ have : x ∈ support (g : E → ℝ) := by simp only [hf.2.2.2.2, Subtype.coe_mk, mem_support, Ne, one_ne_zero, not_false_iff] exact mem_iUnion_of_mem _ this simp_rw [← this] apply isOpen_iUnion_countable rintro ⟨f, hf⟩ exact hf.2.2.1.continuous.isOpen_support obtain ⟨g0, hg⟩ : ∃ g0 : ℕ → ι, T = range g0 := by apply Countable.exists_eq_range T_count rcases eq_empty_or_nonempty T with (rfl | hT) · simp only [ι, iUnion_false, iUnion_empty] at hT simp only [← hT, mem_empty_iff_false, iUnion_of_empty, iUnion_empty, Set.not_nonempty_empty] at h's · exact hT let g : ℕ → E → ℝ := fun n => (g0 n).1 have g_s : ∀ n, support (g n) ⊆ s := fun n => (g0 n).2.1 have s_g : ∀ x ∈ s, ∃ n, x ∈ support (g n) := fun x hx ↦ by rw [← hT] at hx obtain ⟨i, iT, hi⟩ : ∃ i ∈ T, x ∈ support (i : E → ℝ) := by simpa only [mem_iUnion, exists_prop] using hx rw [hg, mem_range] at iT rcases iT with ⟨n, hn⟩ rw [← hn] at hi exact ⟨n, hi⟩ have g_smooth : ∀ n, ContDiff ℝ ⊤ (g n) := fun n => (g0 n).2.2.2.1 have g_comp_supp : ∀ n, HasCompactSupport (g n) := fun n => (g0 n).2.2.1 have g_nonneg : ∀ n x, 0 ≤ g n x := fun n x => ((g0 n).2.2.2.2 (mem_range_self x)).1 obtain ⟨δ, δpos, c, δc, c_lt⟩ : ∃ δ : ℕ → ℝ≥0, (∀ i : ℕ, 0 < δ i) ∧ ∃ c : NNReal, HasSum δ c ∧ c < 1 := NNReal.exists_pos_sum_of_countable one_ne_zero ℕ have : ∀ n : ℕ, ∃ r : ℝ, 0 < r ∧ ∀ i ≤ n, ∀ x, ‖iteratedFDeriv ℝ i (r • g n) x‖ ≤ δ n := by intro n have : ∀ i, ∃ R, ∀ x, ‖iteratedFDeriv ℝ i (fun x => g n x) x‖ ≤ R := by intro i have : BddAbove (range fun x => ‖iteratedFDeriv ℝ i (fun x : E => g n x) x‖) := by apply ((g_smooth n).continuous_iteratedFDeriv le_top).norm.bddAbove_range_of_hasCompactSupport apply HasCompactSupport.comp_left _ norm_zero apply (g_comp_supp n).iteratedFDeriv rcases this with ⟨R, hR⟩ exact ⟨R, fun x => hR (mem_range_self _)⟩ choose R hR using this let M := max (((Finset.range (n + 1)).image R).max' (by simp)) 1 have δnpos : 0 < δ n := δpos n have IR : ∀ i ≤ n, R i ≤ M := by intro i hi refine le_trans ?_ (le_max_left _ _) apply Finset.le_max' apply Finset.mem_image_of_mem -- Porting note: was -- simp only [Finset.mem_range] -- linarith simpa only [Finset.mem_range, Nat.lt_add_one_iff] refine ⟨M⁻¹ * δ n, by positivity, fun i hi x => ?_⟩ calc ‖iteratedFDeriv ℝ i ((M⁻¹ * δ n) • g n) x‖ = ‖(M⁻¹ * δ n) • iteratedFDeriv ℝ i (g n) x‖ := by rw [iteratedFDeriv_const_smul_apply]; exact (g_smooth n).of_le le_top _ = M⁻¹ * δ n * ‖iteratedFDeriv ℝ i (g n) x‖ := by rw [norm_smul _ (iteratedFDeriv ℝ i (g n) x), Real.norm_of_nonneg]; positivity _ ≤ M⁻¹ * δ n * M := (mul_le_mul_of_nonneg_left ((hR i x).trans (IR i hi)) (by positivity)) _ = δ n := by field_simp choose r rpos hr using this have S : ∀ x, Summable fun n => (r n • g n) x := fun x ↦ by refine .of_nnnorm_bounded _ δc.summable fun n => ?_ rw [← NNReal.coe_le_coe, coe_nnnorm] simpa only [norm_iteratedFDeriv_zero] using hr n 0 (zero_le n) x refine ⟨fun x => ∑' n, (r n • g n) x, ?_, ?_, ?_⟩ · apply Subset.antisymm · intro x hx simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, mem_support, Ne] at hx contrapose! hx have : ∀ n, g n x = 0 := by intro n contrapose! hx exact g_s n hx simp only [this, mul_zero, tsum_zero] · intro x hx obtain ⟨n, hn⟩ : ∃ n, x ∈ support (g n) := s_g x hx have I : 0 < r n * g n x := mul_pos (rpos n) (lt_of_le_of_ne (g_nonneg n x) (Ne.symm hn)) exact ne_of_gt (tsum_pos (S x) (fun i => mul_nonneg (rpos i).le (g_nonneg i x)) n I) · refine contDiff_tsum_of_eventually (fun n => (g_smooth n).const_smul (r n)) (fun k _ => (NNReal.hasSum_coe.2 δc).summable) ?_ intro i _ simp only [Nat.cofinite_eq_atTop, Pi.smul_apply, Algebra.id.smul_eq_mul, Filter.eventually_atTop, ge_iff_le] exact ⟨i, fun n hn x => hr _ _ hn _⟩ · rintro - ⟨y, rfl⟩ refine ⟨tsum_nonneg fun n => mul_nonneg (rpos n).le (g_nonneg n y), le_trans ?_ c_lt.le⟩ have A : HasSum (fun n => (δ n : ℝ)) c := NNReal.hasSum_coe.2 δc simp only [Pi.smul_apply, smul_eq_mul, NNReal.val_eq_coe, ← A.tsum_eq, ge_iff_le] apply tsum_le_tsum _ (S y) A.summable intro n apply (le_abs_self _).trans simpa only [norm_iteratedFDeriv_zero] using hr n 0 (zero_le n) y
113
11,892,590,228,282,010,000,000,000,000,000,000,000,000,000,000,000
2
2
2
2,318
import Mathlib.Algebra.Polynomial.UnitTrinomial import Mathlib.RingTheory.Polynomial.GaussLemma import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.selmer from "leanprover-community/mathlib"@"3e00d81bdcbf77c8188bbd18f5524ddc3ed8cac6" namespace Polynomial open scoped Polynomial variable {n : ℕ}
Mathlib/RingTheory/Polynomial/Selmer.lean
31
45
theorem X_pow_sub_X_sub_one_irreducible_aux (z : ℂ) : ¬(z ^ n = z + 1 ∧ z ^ n + z ^ 2 = 0) := by
rintro ⟨h1, h2⟩ replace h3 : z ^ 3 = 1 := by linear_combination (1 - z - z ^ 2 - z ^ n) * h1 + (z ^ n - 2) * h2 have key : z ^ n = 1 ∨ z ^ n = z ∨ z ^ n = z ^ 2 := by rw [← Nat.mod_add_div n 3, pow_add, pow_mul, h3, one_pow, mul_one] have : n % 3 < 3 := Nat.mod_lt n zero_lt_three interval_cases n % 3 <;> simp only [this, pow_zero, pow_one, eq_self_iff_true, or_true_iff, true_or_iff] have z_ne_zero : z ≠ 0 := fun h => zero_ne_one ((zero_pow three_ne_zero).symm.trans (show (0 : ℂ) ^ 3 = 1 from h ▸ h3)) rcases key with (key | key | key) · exact z_ne_zero (by rwa [key, self_eq_add_left] at h1) · exact one_ne_zero (by rwa [key, self_eq_add_right] at h1) · exact z_ne_zero (pow_eq_zero (by rwa [key, add_self_eq_zero] at h2))
14
1,202,604.284165
2
2
3
2,319
import Mathlib.Algebra.Polynomial.UnitTrinomial import Mathlib.RingTheory.Polynomial.GaussLemma import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.selmer from "leanprover-community/mathlib"@"3e00d81bdcbf77c8188bbd18f5524ddc3ed8cac6" namespace Polynomial open scoped Polynomial variable {n : ℕ} theorem X_pow_sub_X_sub_one_irreducible_aux (z : ℂ) : ¬(z ^ n = z + 1 ∧ z ^ n + z ^ 2 = 0) := by rintro ⟨h1, h2⟩ replace h3 : z ^ 3 = 1 := by linear_combination (1 - z - z ^ 2 - z ^ n) * h1 + (z ^ n - 2) * h2 have key : z ^ n = 1 ∨ z ^ n = z ∨ z ^ n = z ^ 2 := by rw [← Nat.mod_add_div n 3, pow_add, pow_mul, h3, one_pow, mul_one] have : n % 3 < 3 := Nat.mod_lt n zero_lt_three interval_cases n % 3 <;> simp only [this, pow_zero, pow_one, eq_self_iff_true, or_true_iff, true_or_iff] have z_ne_zero : z ≠ 0 := fun h => zero_ne_one ((zero_pow three_ne_zero).symm.trans (show (0 : ℂ) ^ 3 = 1 from h ▸ h3)) rcases key with (key | key | key) · exact z_ne_zero (by rwa [key, self_eq_add_left] at h1) · exact one_ne_zero (by rwa [key, self_eq_add_right] at h1) · exact z_ne_zero (pow_eq_zero (by rwa [key, add_self_eq_zero] at h2)) set_option linter.uppercaseLean3 false in #align polynomial.X_pow_sub_X_sub_one_irreducible_aux Polynomial.X_pow_sub_X_sub_one_irreducible_aux
Mathlib/RingTheory/Polynomial/Selmer.lean
49
67
theorem X_pow_sub_X_sub_one_irreducible (hn1 : n ≠ 1) : Irreducible (X ^ n - X - 1 : ℤ[X]) := by
by_cases hn0 : n = 0 · rw [hn0, pow_zero, sub_sub, add_comm, ← sub_sub, sub_self, zero_sub] exact Associated.irreducible ⟨-1, mul_neg_one X⟩ irreducible_X have hn : 1 < n := Nat.one_lt_iff_ne_zero_and_ne_one.mpr ⟨hn0, hn1⟩ have hp : (X ^ n - X - 1 : ℤ[X]) = trinomial 0 1 n (-1) (-1) 1 := by simp only [trinomial, C_neg, C_1]; ring rw [hp] apply IsUnitTrinomial.irreducible_of_coprime' ⟨0, 1, n, zero_lt_one, hn, -1, -1, 1, rfl⟩ rintro z ⟨h1, h2⟩ apply X_pow_sub_X_sub_one_irreducible_aux (n := n) z rw [trinomial_mirror zero_lt_one hn (-1 : ℤˣ).ne_zero (1 : ℤˣ).ne_zero] at h2 simp_rw [trinomial, aeval_add, aeval_mul, aeval_X_pow, aeval_C, Units.val_neg, Units.val_one, map_neg, map_one] at h1 h2 replace h1 : z ^ n = z + 1 := by linear_combination h1 replace h2 := mul_eq_zero_of_left h2 z rw [add_mul, add_mul, add_zero, mul_assoc (-1 : ℂ), ← pow_succ, Nat.sub_add_cancel hn.le] at h2 rw [h1] at h2 ⊢ exact ⟨rfl, by linear_combination -h2⟩
18
65,659,969.137331
2
2
3
2,319
import Mathlib.Algebra.Polynomial.UnitTrinomial import Mathlib.RingTheory.Polynomial.GaussLemma import Mathlib.Tactic.LinearCombination #align_import ring_theory.polynomial.selmer from "leanprover-community/mathlib"@"3e00d81bdcbf77c8188bbd18f5524ddc3ed8cac6" namespace Polynomial open scoped Polynomial variable {n : ℕ} theorem X_pow_sub_X_sub_one_irreducible_aux (z : ℂ) : ¬(z ^ n = z + 1 ∧ z ^ n + z ^ 2 = 0) := by rintro ⟨h1, h2⟩ replace h3 : z ^ 3 = 1 := by linear_combination (1 - z - z ^ 2 - z ^ n) * h1 + (z ^ n - 2) * h2 have key : z ^ n = 1 ∨ z ^ n = z ∨ z ^ n = z ^ 2 := by rw [← Nat.mod_add_div n 3, pow_add, pow_mul, h3, one_pow, mul_one] have : n % 3 < 3 := Nat.mod_lt n zero_lt_three interval_cases n % 3 <;> simp only [this, pow_zero, pow_one, eq_self_iff_true, or_true_iff, true_or_iff] have z_ne_zero : z ≠ 0 := fun h => zero_ne_one ((zero_pow three_ne_zero).symm.trans (show (0 : ℂ) ^ 3 = 1 from h ▸ h3)) rcases key with (key | key | key) · exact z_ne_zero (by rwa [key, self_eq_add_left] at h1) · exact one_ne_zero (by rwa [key, self_eq_add_right] at h1) · exact z_ne_zero (pow_eq_zero (by rwa [key, add_self_eq_zero] at h2)) set_option linter.uppercaseLean3 false in #align polynomial.X_pow_sub_X_sub_one_irreducible_aux Polynomial.X_pow_sub_X_sub_one_irreducible_aux theorem X_pow_sub_X_sub_one_irreducible (hn1 : n ≠ 1) : Irreducible (X ^ n - X - 1 : ℤ[X]) := by by_cases hn0 : n = 0 · rw [hn0, pow_zero, sub_sub, add_comm, ← sub_sub, sub_self, zero_sub] exact Associated.irreducible ⟨-1, mul_neg_one X⟩ irreducible_X have hn : 1 < n := Nat.one_lt_iff_ne_zero_and_ne_one.mpr ⟨hn0, hn1⟩ have hp : (X ^ n - X - 1 : ℤ[X]) = trinomial 0 1 n (-1) (-1) 1 := by simp only [trinomial, C_neg, C_1]; ring rw [hp] apply IsUnitTrinomial.irreducible_of_coprime' ⟨0, 1, n, zero_lt_one, hn, -1, -1, 1, rfl⟩ rintro z ⟨h1, h2⟩ apply X_pow_sub_X_sub_one_irreducible_aux (n := n) z rw [trinomial_mirror zero_lt_one hn (-1 : ℤˣ).ne_zero (1 : ℤˣ).ne_zero] at h2 simp_rw [trinomial, aeval_add, aeval_mul, aeval_X_pow, aeval_C, Units.val_neg, Units.val_one, map_neg, map_one] at h1 h2 replace h1 : z ^ n = z + 1 := by linear_combination h1 replace h2 := mul_eq_zero_of_left h2 z rw [add_mul, add_mul, add_zero, mul_assoc (-1 : ℂ), ← pow_succ, Nat.sub_add_cancel hn.le] at h2 rw [h1] at h2 ⊢ exact ⟨rfl, by linear_combination -h2⟩ set_option linter.uppercaseLean3 false in #align polynomial.X_pow_sub_X_sub_one_irreducible Polynomial.X_pow_sub_X_sub_one_irreducible
Mathlib/RingTheory/Polynomial/Selmer.lean
71
82
theorem X_pow_sub_X_sub_one_irreducible_rat (hn1 : n ≠ 1) : Irreducible (X ^ n - X - 1 : ℚ[X]) := by
by_cases hn0 : n = 0 · rw [hn0, pow_zero, sub_sub, add_comm, ← sub_sub, sub_self, zero_sub] exact Associated.irreducible ⟨-1, mul_neg_one X⟩ irreducible_X have hp : (X ^ n - X - 1 : ℤ[X]) = trinomial 0 1 n (-1) (-1) 1 := by simp only [trinomial, C_neg, C_1]; ring have hn : 1 < n := Nat.one_lt_iff_ne_zero_and_ne_one.mpr ⟨hn0, hn1⟩ have h := (IsPrimitive.Int.irreducible_iff_irreducible_map_cast ?_).mp (X_pow_sub_X_sub_one_irreducible hn1) · rwa [Polynomial.map_sub, Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_one, Polynomial.map_X] at h · exact hp.symm ▸ (trinomial_monic zero_lt_one hn).isPrimitive
11
59,874.141715
2
2
3
2,319
import Mathlib.Order.ConditionallyCompleteLattice.Basic #align_import order.monotone.extension from "leanprover-community/mathlib"@"422e70f7ce183d2900c586a8cda8381e788a0c62" open Set variable {α β : Type*} [LinearOrder α] [ConditionallyCompleteLinearOrder β] {f : α → β} {s : Set α} {a b : α}
Mathlib/Order/Monotone/Extension.lean
25
48
theorem MonotoneOn.exists_monotone_extension (h : MonotoneOn f s) (hl : BddBelow (f '' s)) (hu : BddAbove (f '' s)) : ∃ g : α → β, Monotone g ∧ EqOn f g s := by
classical /- The extension is defined by `f x = f a` for `x ≤ a`, and `f x` is the supremum of the values of `f` to the left of `x` for `x ≥ a`. -/ rcases hl with ⟨a, ha⟩ have hu' : ∀ x, BddAbove (f '' (Iic x ∩ s)) := fun x => hu.mono (image_subset _ inter_subset_right) let g : α → β := fun x => if Disjoint (Iic x) s then a else sSup (f '' (Iic x ∩ s)) have hgs : EqOn f g s := by intro x hx simp only [g] have : IsGreatest (Iic x ∩ s) x := ⟨⟨right_mem_Iic, hx⟩, fun y hy => hy.1⟩ rw [if_neg this.nonempty.not_disjoint, ((h.mono inter_subset_right).map_isGreatest this).csSup_eq] refine ⟨g, fun x y hxy => ?_, hgs⟩ by_cases hx : Disjoint (Iic x) s <;> by_cases hy : Disjoint (Iic y) s <;> simp only [g, if_pos, if_neg, not_false_iff, *, refl] · rcases not_disjoint_iff_nonempty_inter.1 hy with ⟨z, hz⟩ exact le_csSup_of_le (hu' _) (mem_image_of_mem _ hz) (ha <| mem_image_of_mem _ hz.2) · exact (hx <| hy.mono_left <| Iic_subset_Iic.2 hxy).elim · rw [not_disjoint_iff_nonempty_inter] at hx hy refine csSup_le_csSup (hu' _) (hx.image _) (image_subset _ ?_) exact inter_subset_inter_left _ (Iic_subset_Iic.2 hxy)
22
3,584,912,846.131591
2
2
1
2,320
import Mathlib.Algebra.Field.Defs import Mathlib.Tactic.Common #align_import algebra.field.defs from "leanprover-community/mathlib"@"2651125b48fc5c170ab1111afd0817c903b1fc6c" universe u section IsField structure IsField (R : Type u) [Semiring R] : Prop where exists_pair_ne : ∃ x y : R, x ≠ y mul_comm : ∀ x y : R, x * y = y * x mul_inv_cancel : ∀ {a : R}, a ≠ 0 → ∃ b, a * b = 1 #align is_field IsField theorem Semifield.toIsField (R : Type u) [Semifield R] : IsField R where __ := ‹Semifield R› mul_inv_cancel {a} ha := ⟨a⁻¹, mul_inv_cancel ha⟩ #align semifield.to_is_field Semifield.toIsField theorem Field.toIsField (R : Type u) [Field R] : IsField R := Semifield.toIsField _ #align field.to_is_field Field.toIsField @[simp] theorem IsField.nontrivial {R : Type u} [Semiring R] (h : IsField R) : Nontrivial R := ⟨h.exists_pair_ne⟩ #align is_field.nontrivial IsField.nontrivial @[simp] theorem not_isField_of_subsingleton (R : Type u) [Semiring R] [Subsingleton R] : ¬IsField R := fun h => let ⟨_, _, h⟩ := h.exists_pair_ne h (Subsingleton.elim _ _) #align not_is_field_of_subsingleton not_isField_of_subsingleton open scoped Classical noncomputable def IsField.toSemifield {R : Type u} [Semiring R] (h : IsField R) : Semifield R where __ := ‹Semiring R› __ := h inv a := if ha : a = 0 then 0 else Classical.choose (h.mul_inv_cancel ha) inv_zero := dif_pos rfl mul_inv_cancel a ha := by convert Classical.choose_spec (h.mul_inv_cancel ha); exact dif_neg ha nnqsmul := _ #align is_field.to_semifield IsField.toSemifield noncomputable def IsField.toField {R : Type u} [Ring R] (h : IsField R) : Field R := { ‹Ring R›, IsField.toSemifield h with qsmul := _ } #align is_field.to_field IsField.toField
Mathlib/Algebra/Field/IsField.lean
84
93
theorem uniq_inv_of_isField (R : Type u) [Ring R] (hf : IsField R) : ∀ x : R, x ≠ 0 → ∃! y : R, x * y = 1 := by
intro x hx apply exists_unique_of_exists_of_unique · exact hf.mul_inv_cancel hx · intro y z hxy hxz calc y = y * (x * z) := by rw [hxz, mul_one] _ = x * y * z := by rw [← mul_assoc, hf.mul_comm y x] _ = z := by rw [hxy, one_mul]
8
2,980.957987
2
2
1
2,321
import Mathlib.ModelTheory.Algebra.Ring.Basic import Mathlib.RingTheory.FreeCommRing namespace FirstOrder namespace Ring open Language variable {α : Type*} section attribute [local instance] compatibleRingOfRing private theorem exists_term_realize_eq_freeCommRing (p : FreeCommRing α) : ∃ t : Language.ring.Term α, (t.realize FreeCommRing.of : FreeCommRing α) = p := FreeCommRing.induction_on p ⟨-1, by simp [Term.realize]⟩ (fun a => ⟨Term.var a, by simp [Term.realize]⟩) (fun x y ⟨t₁, ht₁⟩ ⟨t₂, ht₂⟩ => ⟨t₁ + t₂, by simp_all [Term.realize]⟩) (fun x y ⟨t₁, ht₁⟩ ⟨t₂, ht₂⟩ => ⟨t₁ * t₂, by simp_all [Term.realize]⟩) end noncomputable def termOfFreeCommRing (p : FreeCommRing α) : Language.ring.Term α := Classical.choose (exists_term_realize_eq_freeCommRing p) variable {R : Type*} [CommRing R] [CompatibleRing R] @[simp]
Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean
54
63
theorem realize_termOfFreeCommRing (p : FreeCommRing α) (v : α → R) : (termOfFreeCommRing p).realize v = FreeCommRing.lift v p := by
let _ := compatibleRingOfRing (FreeCommRing α) rw [termOfFreeCommRing] conv_rhs => rw [← Classical.choose_spec (exists_term_realize_eq_freeCommRing p)] induction Classical.choose (exists_term_realize_eq_freeCommRing p) with | var _ => simp | func f a ih => cases f <;> simp [ih]
8
2,980.957987
2
2
1
2,322
import Mathlib.RingTheory.WittVector.Identities #align_import ring_theory.witt_vector.domain from "leanprover-community/mathlib"@"b1d911acd60ab198808e853292106ee352b648ea" noncomputable section open scoped Classical namespace WittVector open Function variable {p : ℕ} {R : Type*} local notation "𝕎" => WittVector p -- type as `\bbW` def shift (x : 𝕎 R) (n : ℕ) : 𝕎 R := @mk' p R fun i => x.coeff (n + i) #align witt_vector.shift WittVector.shift theorem shift_coeff (x : 𝕎 R) (n k : ℕ) : (x.shift n).coeff k = x.coeff (n + k) := rfl #align witt_vector.shift_coeff WittVector.shift_coeff variable [hp : Fact p.Prime] [CommRing R]
Mathlib/RingTheory/WittVector/Domain.lean
69
76
theorem verschiebung_shift (x : 𝕎 R) (k : ℕ) (h : ∀ i < k + 1, x.coeff i = 0) : verschiebung (x.shift k.succ) = x.shift k := by
ext ⟨j⟩ · rw [verschiebung_coeff_zero, shift_coeff, h] apply Nat.lt_succ_self · simp only [verschiebung_coeff_succ, shift] congr 1 rw [Nat.add_succ, add_comm, Nat.add_succ, add_comm]
6
403.428793
2
2
3
2,323
import Mathlib.RingTheory.WittVector.Identities #align_import ring_theory.witt_vector.domain from "leanprover-community/mathlib"@"b1d911acd60ab198808e853292106ee352b648ea" noncomputable section open scoped Classical namespace WittVector open Function variable {p : ℕ} {R : Type*} local notation "𝕎" => WittVector p -- type as `\bbW` def shift (x : 𝕎 R) (n : ℕ) : 𝕎 R := @mk' p R fun i => x.coeff (n + i) #align witt_vector.shift WittVector.shift theorem shift_coeff (x : 𝕎 R) (n k : ℕ) : (x.shift n).coeff k = x.coeff (n + k) := rfl #align witt_vector.shift_coeff WittVector.shift_coeff variable [hp : Fact p.Prime] [CommRing R] theorem verschiebung_shift (x : 𝕎 R) (k : ℕ) (h : ∀ i < k + 1, x.coeff i = 0) : verschiebung (x.shift k.succ) = x.shift k := by ext ⟨j⟩ · rw [verschiebung_coeff_zero, shift_coeff, h] apply Nat.lt_succ_self · simp only [verschiebung_coeff_succ, shift] congr 1 rw [Nat.add_succ, add_comm, Nat.add_succ, add_comm] #align witt_vector.verschiebung_shift WittVector.verschiebung_shift
Mathlib/RingTheory/WittVector/Domain.lean
79
85
theorem eq_iterate_verschiebung {x : 𝕎 R} {n : ℕ} (h : ∀ i < n, x.coeff i = 0) : x = verschiebung^[n] (x.shift n) := by
induction' n with k ih · cases x; simp [shift] · dsimp; rw [verschiebung_shift] · exact ih fun i hi => h _ (hi.trans (Nat.lt_succ_self _)) · exact h
5
148.413159
2
2
3
2,323
import Mathlib.RingTheory.WittVector.Identities #align_import ring_theory.witt_vector.domain from "leanprover-community/mathlib"@"b1d911acd60ab198808e853292106ee352b648ea" noncomputable section open scoped Classical namespace WittVector open Function variable {p : ℕ} {R : Type*} local notation "𝕎" => WittVector p -- type as `\bbW` def shift (x : 𝕎 R) (n : ℕ) : 𝕎 R := @mk' p R fun i => x.coeff (n + i) #align witt_vector.shift WittVector.shift theorem shift_coeff (x : 𝕎 R) (n k : ℕ) : (x.shift n).coeff k = x.coeff (n + k) := rfl #align witt_vector.shift_coeff WittVector.shift_coeff variable [hp : Fact p.Prime] [CommRing R] theorem verschiebung_shift (x : 𝕎 R) (k : ℕ) (h : ∀ i < k + 1, x.coeff i = 0) : verschiebung (x.shift k.succ) = x.shift k := by ext ⟨j⟩ · rw [verschiebung_coeff_zero, shift_coeff, h] apply Nat.lt_succ_self · simp only [verschiebung_coeff_succ, shift] congr 1 rw [Nat.add_succ, add_comm, Nat.add_succ, add_comm] #align witt_vector.verschiebung_shift WittVector.verschiebung_shift theorem eq_iterate_verschiebung {x : 𝕎 R} {n : ℕ} (h : ∀ i < n, x.coeff i = 0) : x = verschiebung^[n] (x.shift n) := by induction' n with k ih · cases x; simp [shift] · dsimp; rw [verschiebung_shift] · exact ih fun i hi => h _ (hi.trans (Nat.lt_succ_self _)) · exact h #align witt_vector.eq_iterate_verschiebung WittVector.eq_iterate_verschiebung
Mathlib/RingTheory/WittVector/Domain.lean
88
98
theorem verschiebung_nonzero {x : 𝕎 R} (hx : x ≠ 0) : ∃ n : ℕ, ∃ x' : 𝕎 R, x'.coeff 0 ≠ 0 ∧ x = verschiebung^[n] x' := by
have hex : ∃ k : ℕ, x.coeff k ≠ 0 := by by_contra! hall apply hx ext i simp only [hall, zero_coeff] let n := Nat.find hex use n, x.shift n refine ⟨Nat.find_spec hex, eq_iterate_verschiebung fun i hi => not_not.mp ?_⟩ exact Nat.find_min hex hi
9
8,103.083928
2
2
3
2,323
import Mathlib.Data.Finset.Basic import Mathlib.Data.Set.Lattice #align_import data.set.constructions from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" variable {α : Type*} (S : Set (Set α)) structure FiniteInter : Prop where univ_mem : Set.univ ∈ S inter_mem : ∀ ⦃s⦄, s ∈ S → ∀ ⦃t⦄, t ∈ S → s ∩ t ∈ S #align has_finite_inter FiniteInter namespace FiniteInter inductive finiteInterClosure : Set (Set α) | basic {s} : s ∈ S → finiteInterClosure s | univ : finiteInterClosure Set.univ | inter {s t} : finiteInterClosure s → finiteInterClosure t → finiteInterClosure (s ∩ t) #align has_finite_inter.finite_inter_closure FiniteInter.finiteInterClosure theorem finiteInterClosure_finiteInter : FiniteInter (finiteInterClosure S) := { univ_mem := finiteInterClosure.univ inter_mem := fun _ h _ => finiteInterClosure.inter h } #align has_finite_inter.finite_inter_closure_has_finite_inter FiniteInter.finiteInterClosure_finiteInter variable {S}
Mathlib/Data/Set/Constructions.lean
54
63
theorem finiteInter_mem (cond : FiniteInter S) (F : Finset (Set α)) : ↑F ⊆ S → ⋂₀ (↑F : Set (Set α)) ∈ S := by
classical refine Finset.induction_on F (fun _ => ?_) ?_ · simp [cond.univ_mem] · intro a s _ h1 h2 suffices a ∩ ⋂₀ ↑s ∈ S by simpa exact cond.inter_mem (h2 (Finset.mem_insert_self a s)) (h1 fun x hx => h2 <| Finset.mem_insert_of_mem hx)
8
2,980.957987
2
2
2
2,324
import Mathlib.Data.Finset.Basic import Mathlib.Data.Set.Lattice #align_import data.set.constructions from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" variable {α : Type*} (S : Set (Set α)) structure FiniteInter : Prop where univ_mem : Set.univ ∈ S inter_mem : ∀ ⦃s⦄, s ∈ S → ∀ ⦃t⦄, t ∈ S → s ∩ t ∈ S #align has_finite_inter FiniteInter namespace FiniteInter inductive finiteInterClosure : Set (Set α) | basic {s} : s ∈ S → finiteInterClosure s | univ : finiteInterClosure Set.univ | inter {s t} : finiteInterClosure s → finiteInterClosure t → finiteInterClosure (s ∩ t) #align has_finite_inter.finite_inter_closure FiniteInter.finiteInterClosure theorem finiteInterClosure_finiteInter : FiniteInter (finiteInterClosure S) := { univ_mem := finiteInterClosure.univ inter_mem := fun _ h _ => finiteInterClosure.inter h } #align has_finite_inter.finite_inter_closure_has_finite_inter FiniteInter.finiteInterClosure_finiteInter variable {S} theorem finiteInter_mem (cond : FiniteInter S) (F : Finset (Set α)) : ↑F ⊆ S → ⋂₀ (↑F : Set (Set α)) ∈ S := by classical refine Finset.induction_on F (fun _ => ?_) ?_ · simp [cond.univ_mem] · intro a s _ h1 h2 suffices a ∩ ⋂₀ ↑s ∈ S by simpa exact cond.inter_mem (h2 (Finset.mem_insert_self a s)) (h1 fun x hx => h2 <| Finset.mem_insert_of_mem hx) #align has_finite_inter.finite_inter_mem FiniteInter.finiteInter_mem
Mathlib/Data/Set/Constructions.lean
66
82
theorem finiteInterClosure_insert {A : Set α} (cond : FiniteInter S) (P) (H : P ∈ finiteInterClosure (insert A S)) : P ∈ S ∨ ∃ Q ∈ S, P = A ∩ Q := by
induction' H with S h T1 T2 _ _ h1 h2 · cases h · exact Or.inr ⟨Set.univ, cond.univ_mem, by simpa⟩ · exact Or.inl (by assumption) · exact Or.inl cond.univ_mem · rcases h1 with (h | ⟨Q, hQ, rfl⟩) <;> rcases h2 with (i | ⟨R, hR, rfl⟩) · exact Or.inl (cond.inter_mem h i) · exact Or.inr ⟨T1 ∩ R, cond.inter_mem h hR, by simp only [← Set.inter_assoc, Set.inter_comm _ A]⟩ · exact Or.inr ⟨Q ∩ T2, cond.inter_mem hQ i, by simp only [Set.inter_assoc]⟩ · exact Or.inr ⟨Q ∩ R, cond.inter_mem hQ hR, by ext x constructor <;> simp (config := { contextual := true })⟩
15
3,269,017.372472
2
2
2
2,324
import Mathlib.RingTheory.IsTensorProduct import Mathlib.RingTheory.Localization.Module variable {R : Type*} [CommSemiring R] (S : Submonoid R) (A : Type*) [CommRing A] [Algebra R A] [IsLocalization S A] {M : Type*} [AddCommMonoid M] [Module R M] [Module A M] [IsScalarTower R A M] {M' : Type*} [AddCommMonoid M'] [Module R M'] [Module A M'] [IsScalarTower R A M'] (f : M →ₗ[R] M') theorem IsLocalizedModule.isBaseChange [IsLocalizedModule S f] : IsBaseChange A f := .of_lift_unique _ fun Q _ _ _ _ g ↦ by obtain ⟨ℓ, rfl, h₂⟩ := IsLocalizedModule.is_universal S f g fun s ↦ by rw [← (Algebra.lsmul R (A := A) R Q).commutes]; exact (IsLocalization.map_units A s).map _ refine ⟨ℓ.extendScalarsOfIsLocalization S A, by simp, fun g'' h ↦ ?_⟩ cases h₂ (LinearMap.restrictScalars R g'') h; rfl
Mathlib/RingTheory/Localization/BaseChange.lean
41
49
theorem isLocalizedModule_iff_isBaseChange : IsLocalizedModule S f ↔ IsBaseChange A f := by
refine ⟨fun _ ↦ IsLocalizedModule.isBaseChange S A f, fun h ↦ ?_⟩ have : IsBaseChange A (LocalizedModule.mkLinearMap S M) := IsLocalizedModule.isBaseChange S A _ let e := (this.equiv.symm.trans h.equiv).restrictScalars R convert IsLocalizedModule.of_linearEquiv S (LocalizedModule.mkLinearMap S M) e ext rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, LinearEquiv.restrictScalars_apply, LinearEquiv.trans_apply, IsBaseChange.equiv_symm_apply, IsBaseChange.equiv_tmul, one_smul]
8
2,980.957987
2
2
1
2,325
import Mathlib.Analysis.LocallyConvex.WithSeminorms import Mathlib.Topology.Semicontinuous import Mathlib.Topology.Baire.Lemmas open Filter Topology Set ContinuousLinearMap section defs class BarrelledSpace (𝕜 E : Type*) [SeminormedRing 𝕜] [AddGroup E] [SMul 𝕜 E] [TopologicalSpace E] : Prop where continuous_of_lowerSemicontinuous : ∀ p : Seminorm 𝕜 E, LowerSemicontinuous p → Continuous p theorem Seminorm.continuous_of_lowerSemicontinuous {𝕜 E : Type*} [AddGroup E] [SMul 𝕜 E] [SeminormedRing 𝕜] [TopologicalSpace E] [BarrelledSpace 𝕜 E] (p : Seminorm 𝕜 E) (hp : LowerSemicontinuous p) : Continuous p := BarrelledSpace.continuous_of_lowerSemicontinuous p hp
Mathlib/Analysis/LocallyConvex/Barrelled.lean
93
103
theorem Seminorm.continuous_iSup {ι : Sort*} {𝕜 E : Type*} [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] [BarrelledSpace 𝕜 E] (p : ι → Seminorm 𝕜 E) (hp : ∀ i, Continuous (p i)) (bdd : BddAbove (range p)) : Continuous (⨆ i, p i) := by
rw [← Seminorm.coe_iSup_eq bdd] refine Seminorm.continuous_of_lowerSemicontinuous _ ?_ rw [Seminorm.coe_iSup_eq bdd] rw [Seminorm.bddAbove_range_iff] at bdd convert lowerSemicontinuous_ciSup (f := fun i x ↦ p i x) bdd (fun i ↦ (hp i).lowerSemicontinuous) exact iSup_apply
6
403.428793
2
2
1
2,326
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Data.Finset.Pointwise import Mathlib.Data.Finsupp.Indicator import Mathlib.Data.Fintype.BigOperators #align_import data.finset.finsupp from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" noncomputable section open Finsupp open scoped Classical open Pointwise variable {ι α : Type*} [Zero α] {s : Finset ι} {f : ι →₀ α} namespace Finset protected def finsupp (s : Finset ι) (t : ι → Finset α) : Finset (ι →₀ α) := (s.pi t).map ⟨indicator s, indicator_injective s⟩ #align finset.finsupp Finset.finsupp
Mathlib/Data/Finset/Finsupp.lean
48
57
theorem mem_finsupp_iff {t : ι → Finset α} : f ∈ s.finsupp t ↔ f.support ⊆ s ∧ ∀ i ∈ s, f i ∈ t i := by
refine mem_map.trans ⟨?_, ?_⟩ · rintro ⟨f, hf, rfl⟩ refine ⟨support_indicator_subset _ _, fun i hi => ?_⟩ convert mem_pi.1 hf i hi exact indicator_of_mem hi _ · refine fun h => ⟨fun i _ => f i, mem_pi.2 h.2, ?_⟩ ext i exact ite_eq_left_iff.2 fun hi => (not_mem_support_iff.1 fun H => hi <| h.1 H).symm
8
2,980.957987
2
2
2
2,327
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Data.Finset.Pointwise import Mathlib.Data.Finsupp.Indicator import Mathlib.Data.Fintype.BigOperators #align_import data.finset.finsupp from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" noncomputable section open Finsupp open scoped Classical open Pointwise variable {ι α : Type*} [Zero α] {s : Finset ι} {f : ι →₀ α} namespace Finset protected def finsupp (s : Finset ι) (t : ι → Finset α) : Finset (ι →₀ α) := (s.pi t).map ⟨indicator s, indicator_injective s⟩ #align finset.finsupp Finset.finsupp theorem mem_finsupp_iff {t : ι → Finset α} : f ∈ s.finsupp t ↔ f.support ⊆ s ∧ ∀ i ∈ s, f i ∈ t i := by refine mem_map.trans ⟨?_, ?_⟩ · rintro ⟨f, hf, rfl⟩ refine ⟨support_indicator_subset _ _, fun i hi => ?_⟩ convert mem_pi.1 hf i hi exact indicator_of_mem hi _ · refine fun h => ⟨fun i _ => f i, mem_pi.2 h.2, ?_⟩ ext i exact ite_eq_left_iff.2 fun hi => (not_mem_support_iff.1 fun H => hi <| h.1 H).symm #align finset.mem_finsupp_iff Finset.mem_finsupp_iff @[simp]
Mathlib/Data/Finset/Finsupp.lean
62
74
theorem mem_finsupp_iff_of_support_subset {t : ι →₀ Finset α} (ht : t.support ⊆ s) : f ∈ s.finsupp t ↔ ∀ i, f i ∈ t i := by
refine mem_finsupp_iff.trans (forall_and.symm.trans <| forall_congr' fun i => ⟨fun h => ?_, fun h => ⟨fun hi => ht <| mem_support_iff.2 fun H => mem_support_iff.1 hi ?_, fun _ => h⟩⟩) · by_cases hi : i ∈ s · exact h.2 hi · rw [not_mem_support_iff.1 (mt h.1 hi), not_mem_support_iff.1 fun H => hi <| ht H] exact zero_mem_zero · rwa [H, mem_zero] at h
11
59,874.141715
2
2
2
2,327
import Mathlib.Data.Set.Pairwise.Basic import Mathlib.Data.Set.Lattice import Mathlib.Order.SuccPred.Basic #align_import order.succ_pred.interval_succ from "leanprover-community/mathlib"@"c227d107bbada5d0d9d20287e3282c0a7f1651a0" open Set Order variable {α β : Type*} [LinearOrder α] namespace Monotone
Mathlib/Order/SuccPred/IntervalSucc.lean
38
48
theorem biUnion_Ico_Ioc_map_succ [SuccOrder α] [IsSuccArchimedean α] [LinearOrder β] {f : α → β} (hf : Monotone f) (m n : α) : ⋃ i ∈ Ico m n, Ioc (f i) (f (succ i)) = Ioc (f m) (f n) := by
rcases le_total n m with hnm | hmn · rw [Ico_eq_empty_of_le hnm, Ioc_eq_empty_of_le (hf hnm), biUnion_empty] · refine Succ.rec ?_ ?_ hmn · simp only [Ioc_self, Ico_self, biUnion_empty] · intro k hmk ihk rw [← Ioc_union_Ioc_eq_Ioc (hf hmk) (hf <| le_succ _), union_comm, ← ihk] by_cases hk : IsMax k · rw [hk.succ_eq, Ioc_self, empty_union] · rw [Ico_succ_right_eq_insert_of_not_isMax hmk hk, biUnion_insert]
9
8,103.083928
2
2
1
2,328
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.SpecificLimits.Normed #align_import analysis.normed.group.controlled_closure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Filter Finset open Topology variable {G : Type*} [NormedAddCommGroup G] [CompleteSpace G] variable {H : Type*} [NormedAddCommGroup H]
Mathlib/Analysis/Normed/Group/ControlledClosure.lean
32
106
theorem controlled_closure_of_complete {f : NormedAddGroupHom G H} {K : AddSubgroup H} {C ε : ℝ} (hC : 0 < C) (hε : 0 < ε) (hyp : f.SurjectiveOnWith K C) : f.SurjectiveOnWith K.topologicalClosure (C + ε) := by
rintro (h : H) (h_in : h ∈ K.topologicalClosure) -- We first get rid of the easy case where `h = 0`. by_cases hyp_h : h = 0 · rw [hyp_h] use 0 simp /- The desired preimage will be constructed as the sum of a series. Convergence of the series will be guaranteed by completeness of `G`. We first write `h` as the sum of a sequence `v` of elements of `K` which starts close to `h` and then quickly goes to zero. The sequence `b` below quantifies this. -/ set b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C have b_pos (i) : 0 < b i := by field_simp [b, hC, hyp_h] obtain ⟨v : ℕ → H, lim_v : Tendsto (fun n : ℕ => ∑ k ∈ range (n + 1), v k) atTop (𝓝 h), v_in : ∀ n, v n ∈ K, hv₀ : ‖v 0 - h‖ < b 0, hv : ∀ n > 0, ‖v n‖ < b n⟩ := controlled_sum_of_mem_closure h_in b_pos /- The controlled surjectivity assumption on `f` allows to build preimages `u n` for all elements `v n` of the `v` sequence. -/ have : ∀ n, ∃ m' : G, f m' = v n ∧ ‖m'‖ ≤ C * ‖v n‖ := fun n : ℕ => hyp (v n) (v_in n) choose u hu hnorm_u using this /- The desired series `s` is then obtained by summing `u`. We then check our choice of `b` ensures `s` is Cauchy. -/ set s : ℕ → G := fun n => ∑ k ∈ range (n + 1), u k have : CauchySeq s := by apply NormedAddCommGroup.cauchy_series_of_le_geometric'' (by norm_num) one_half_lt_one · rintro n (hn : n ≥ 1) calc ‖u n‖ ≤ C * ‖v n‖ := hnorm_u n _ ≤ C * b n := by gcongr; exact (hv _ <| Nat.succ_le_iff.mp hn).le _ = (1 / 2) ^ n * (ε * ‖h‖ / 2) := by simp [mul_div_cancel₀ _ hC.ne.symm] _ = ε * ‖h‖ / 2 * (1 / 2) ^ n := mul_comm _ _ -- We now show that the limit `g` of `s` is the desired preimage. obtain ⟨g : G, hg⟩ := cauchySeq_tendsto_of_complete this refine ⟨g, ?_, ?_⟩ · -- We indeed get a preimage. First note: have : f ∘ s = fun n => ∑ k ∈ range (n + 1), v k := by ext n simp [s, map_sum, hu] /- In the above equality, the left-hand-side converges to `f g` by continuity of `f` and definition of `g` while the right-hand-side converges to `h` by construction of `v` so `g` is indeed a preimage of `h`. -/ rw [← this] at lim_v exact tendsto_nhds_unique ((f.continuous.tendsto g).comp hg) lim_v · -- Then we need to estimate the norm of `g`, using our careful choice of `b`. suffices ∀ n, ‖s n‖ ≤ (C + ε) * ‖h‖ from le_of_tendsto' (continuous_norm.continuousAt.tendsto.comp hg) this intro n have hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖ := by have := calc ‖v 0‖ ≤ ‖h‖ + ‖v 0 - h‖ := norm_le_insert' _ _ _ ≤ ‖h‖ + b 0 := by gcongr calc ‖u 0‖ ≤ C * ‖v 0‖ := hnorm_u 0 _ ≤ C * (‖h‖ + b 0) := by gcongr _ = C * b 0 + C * ‖h‖ := by rw [add_comm, mul_add] have : (∑ k ∈ range (n + 1), C * b k) ≤ ε * ‖h‖ := calc (∑ k ∈ range (n + 1), C * b k) _ = (∑ k ∈ range (n + 1), (1 / 2 : ℝ) ^ k) * (ε * ‖h‖ / 2) := by simp only [mul_div_cancel₀ _ hC.ne.symm, ← sum_mul] _ ≤ 2 * (ε * ‖h‖ / 2) := by gcongr; apply sum_geometric_two_le _ = ε * ‖h‖ := mul_div_cancel₀ _ two_ne_zero calc ‖s n‖ ≤ ∑ k ∈ range (n + 1), ‖u k‖ := norm_sum_le _ _ _ = (∑ k ∈ range n, ‖u (k + 1)‖) + ‖u 0‖ := sum_range_succ' _ _ _ ≤ (∑ k ∈ range n, C * ‖v (k + 1)‖) + ‖u 0‖ := by gcongr; apply hnorm_u _ ≤ (∑ k ∈ range n, C * b (k + 1)) + (C * b 0 + C * ‖h‖) := by gcongr with k; exact (hv _ k.succ_pos).le _ = (∑ k ∈ range (n + 1), C * b k) + C * ‖h‖ := by rw [← add_assoc, sum_range_succ'] _ ≤ (C + ε) * ‖h‖ := by rw [add_comm, add_mul] apply add_le_add_left this
72
18,586,717,452,841,279,000,000,000,000,000
2
2
2
2,329
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.SpecificLimits.Normed #align_import analysis.normed.group.controlled_closure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Filter Finset open Topology variable {G : Type*} [NormedAddCommGroup G] [CompleteSpace G] variable {H : Type*} [NormedAddCommGroup H] theorem controlled_closure_of_complete {f : NormedAddGroupHom G H} {K : AddSubgroup H} {C ε : ℝ} (hC : 0 < C) (hε : 0 < ε) (hyp : f.SurjectiveOnWith K C) : f.SurjectiveOnWith K.topologicalClosure (C + ε) := by rintro (h : H) (h_in : h ∈ K.topologicalClosure) -- We first get rid of the easy case where `h = 0`. by_cases hyp_h : h = 0 · rw [hyp_h] use 0 simp set b : ℕ → ℝ := fun i => (1 / 2) ^ i * (ε * ‖h‖ / 2) / C have b_pos (i) : 0 < b i := by field_simp [b, hC, hyp_h] obtain ⟨v : ℕ → H, lim_v : Tendsto (fun n : ℕ => ∑ k ∈ range (n + 1), v k) atTop (𝓝 h), v_in : ∀ n, v n ∈ K, hv₀ : ‖v 0 - h‖ < b 0, hv : ∀ n > 0, ‖v n‖ < b n⟩ := controlled_sum_of_mem_closure h_in b_pos have : ∀ n, ∃ m' : G, f m' = v n ∧ ‖m'‖ ≤ C * ‖v n‖ := fun n : ℕ => hyp (v n) (v_in n) choose u hu hnorm_u using this set s : ℕ → G := fun n => ∑ k ∈ range (n + 1), u k have : CauchySeq s := by apply NormedAddCommGroup.cauchy_series_of_le_geometric'' (by norm_num) one_half_lt_one · rintro n (hn : n ≥ 1) calc ‖u n‖ ≤ C * ‖v n‖ := hnorm_u n _ ≤ C * b n := by gcongr; exact (hv _ <| Nat.succ_le_iff.mp hn).le _ = (1 / 2) ^ n * (ε * ‖h‖ / 2) := by simp [mul_div_cancel₀ _ hC.ne.symm] _ = ε * ‖h‖ / 2 * (1 / 2) ^ n := mul_comm _ _ -- We now show that the limit `g` of `s` is the desired preimage. obtain ⟨g : G, hg⟩ := cauchySeq_tendsto_of_complete this refine ⟨g, ?_, ?_⟩ · -- We indeed get a preimage. First note: have : f ∘ s = fun n => ∑ k ∈ range (n + 1), v k := by ext n simp [s, map_sum, hu] rw [← this] at lim_v exact tendsto_nhds_unique ((f.continuous.tendsto g).comp hg) lim_v · -- Then we need to estimate the norm of `g`, using our careful choice of `b`. suffices ∀ n, ‖s n‖ ≤ (C + ε) * ‖h‖ from le_of_tendsto' (continuous_norm.continuousAt.tendsto.comp hg) this intro n have hnorm₀ : ‖u 0‖ ≤ C * b 0 + C * ‖h‖ := by have := calc ‖v 0‖ ≤ ‖h‖ + ‖v 0 - h‖ := norm_le_insert' _ _ _ ≤ ‖h‖ + b 0 := by gcongr calc ‖u 0‖ ≤ C * ‖v 0‖ := hnorm_u 0 _ ≤ C * (‖h‖ + b 0) := by gcongr _ = C * b 0 + C * ‖h‖ := by rw [add_comm, mul_add] have : (∑ k ∈ range (n + 1), C * b k) ≤ ε * ‖h‖ := calc (∑ k ∈ range (n + 1), C * b k) _ = (∑ k ∈ range (n + 1), (1 / 2 : ℝ) ^ k) * (ε * ‖h‖ / 2) := by simp only [mul_div_cancel₀ _ hC.ne.symm, ← sum_mul] _ ≤ 2 * (ε * ‖h‖ / 2) := by gcongr; apply sum_geometric_two_le _ = ε * ‖h‖ := mul_div_cancel₀ _ two_ne_zero calc ‖s n‖ ≤ ∑ k ∈ range (n + 1), ‖u k‖ := norm_sum_le _ _ _ = (∑ k ∈ range n, ‖u (k + 1)‖) + ‖u 0‖ := sum_range_succ' _ _ _ ≤ (∑ k ∈ range n, C * ‖v (k + 1)‖) + ‖u 0‖ := by gcongr; apply hnorm_u _ ≤ (∑ k ∈ range n, C * b (k + 1)) + (C * b 0 + C * ‖h‖) := by gcongr with k; exact (hv _ k.succ_pos).le _ = (∑ k ∈ range (n + 1), C * b k) + C * ‖h‖ := by rw [← add_assoc, sum_range_succ'] _ ≤ (C + ε) * ‖h‖ := by rw [add_comm, add_mul] apply add_le_add_left this #align controlled_closure_of_complete controlled_closure_of_complete
Mathlib/Analysis/Normed/Group/ControlledClosure.lean
116
125
theorem controlled_closure_range_of_complete {f : NormedAddGroupHom G H} {K : Type*} [SeminormedAddCommGroup K] {j : NormedAddGroupHom K H} (hj : ∀ x, ‖j x‖ = ‖x‖) {C ε : ℝ} (hC : 0 < C) (hε : 0 < ε) (hyp : ∀ k, ∃ g, f g = j k ∧ ‖g‖ ≤ C * ‖k‖) : f.SurjectiveOnWith j.range.topologicalClosure (C + ε) := by
replace hyp : ∀ h ∈ j.range, ∃ g, f g = h ∧ ‖g‖ ≤ C * ‖h‖ := by intro h h_in rcases (j.mem_range _).mp h_in with ⟨k, rfl⟩ rw [hj] exact hyp k exact controlled_closure_of_complete hC hε hyp
6
403.428793
2
2
2
2,329
import Mathlib.AlgebraicTopology.DoldKan.FunctorN import Mathlib.AlgebraicTopology.DoldKan.Decomposition import Mathlib.CategoryTheory.Idempotents.HomologicalComplex import Mathlib.CategoryTheory.Idempotents.KaroubiKaroubi #align_import algebraic_topology.dold_kan.n_reflects_iso from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category CategoryTheory.Idempotents Opposite Simplicial namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] open MorphComponents instance : (N₁ : SimplicialObject C ⥤ Karoubi (ChainComplex C ℕ)).ReflectsIsomorphisms := ⟨fun {X Y} f => by intro -- restating the result in a way that allows induction on the degree n suffices ∀ n : ℕ, IsIso (f.app (op [n])) by haveI : ∀ Δ : SimplexCategoryᵒᵖ, IsIso (f.app Δ) := fun Δ => this Δ.unop.len apply NatIso.isIso_of_isIso_app -- restating the assumption in a more practical form have h₁ := HomologicalComplex.congr_hom (Karoubi.hom_ext_iff.mp (IsIso.hom_inv_id (N₁.map f))) have h₂ := HomologicalComplex.congr_hom (Karoubi.hom_ext_iff.mp (IsIso.inv_hom_id (N₁.map f))) have h₃ := fun n => Karoubi.HomologicalComplex.p_comm_f_assoc (inv (N₁.map f)) n (f.app (op [n])) simp only [N₁_map_f, Karoubi.comp_f, HomologicalComplex.comp_f, AlternatingFaceMapComplex.map_f, N₁_obj_p, Karoubi.id_eq, assoc] at h₁ h₂ h₃ -- we have to construct an inverse to f in degree n, by induction on n intro n induction' n with n hn -- degree 0 · use (inv (N₁.map f)).f.f 0 have h₁₀ := h₁ 0 have h₂₀ := h₂ 0 dsimp at h₁₀ h₂₀ simp only [id_comp, comp_id] at h₁₀ h₂₀ tauto · haveI := hn use φ { a := PInfty.f (n + 1) ≫ (inv (N₁.map f)).f.f (n + 1) b := fun i => inv (f.app (op [n])) ≫ X.σ i } simp only [MorphComponents.id, ← id_φ, ← preComp_φ, preComp, ← postComp_φ, postComp, PInfty_f_naturality_assoc, IsIso.hom_inv_id_assoc, assoc, IsIso.inv_hom_id_assoc, SimplicialObject.σ_naturality, h₁, h₂, h₃, and_self]⟩
Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean
68
92
theorem compatibility_N₂_N₁_karoubi : N₂ ⋙ (karoubiChainComplexEquivalence C ℕ).functor = karoubiFunctorCategoryEmbedding SimplexCategoryᵒᵖ C ⋙ N₁ ⋙ (karoubiChainComplexEquivalence (Karoubi C) ℕ).functor ⋙ Functor.mapHomologicalComplex (KaroubiKaroubi.equivalence C).inverse _ := by
refine CategoryTheory.Functor.ext (fun P => ?_) fun P Q f => ?_ · refine HomologicalComplex.ext ?_ ?_ · ext n · rfl · dsimp simp only [karoubi_PInfty_f, comp_id, PInfty_f_naturality, id_comp, eqToHom_refl] · rintro _ n (rfl : n + 1 = _) ext have h := (AlternatingFaceMapComplex.map P.p).comm (n + 1) n dsimp [N₂, karoubiChainComplexEquivalence, KaroubiHomologicalComplexEquivalence.Functor.obj] at h ⊢ simp only [assoc, Karoubi.eqToHom_f, eqToHom_refl, comp_id, karoubi_alternatingFaceMapComplex_d, karoubi_PInfty_f, ← HomologicalComplex.Hom.comm_assoc, ← h, app_idem_assoc] · ext n dsimp [KaroubiKaroubi.inverse, Functor.mapHomologicalComplex] simp only [karoubi_PInfty_f, HomologicalComplex.eqToHom_f, Karoubi.eqToHom_f, assoc, comp_id, PInfty_f_naturality, app_p_comp, karoubiChainComplexEquivalence_functor_obj_X_p, N₂_obj_p_f, eqToHom_refl, PInfty_f_naturality_assoc, app_comp_p, PInfty_f_idem_assoc]
20
485,165,195.40979
2
2
1
2,330
import Mathlib.Analysis.Calculus.FDeriv.Prod #align_import analysis.calculus.fderiv.bilinear from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Asymptotics ENNReal noncomputable section section variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace 𝕜 G'] variable {f f₀ f₁ g : E → F} variable {f' f₀' f₁' g' : E →L[𝕜] F} variable (e : E →L[𝕜] F) variable {x : E} variable {s t : Set E} variable {L L₁ L₂ : Filter E} section BilinearMap variable {b : E × F → G} {u : Set (E × F)} open NormedField -- Porting note (#11215): TODO: rewrite/golf using analytic functions? @[fun_prop]
Mathlib/Analysis/Calculus/FDeriv/Bilinear.lean
51
74
theorem IsBoundedBilinearMap.hasStrictFDerivAt (h : IsBoundedBilinearMap 𝕜 b) (p : E × F) : HasStrictFDerivAt b (h.deriv p) p := by
simp only [HasStrictFDerivAt] simp only [← map_add_left_nhds_zero (p, p), isLittleO_map] set T := (E × F) × E × F calc _ = fun x ↦ h.deriv (x.1 - x.2) (x.2.1, x.1.2) := by ext ⟨⟨x₁, y₁⟩, ⟨x₂, y₂⟩⟩ rcases p with ⟨x, y⟩ simp only [map_sub, deriv_apply, Function.comp_apply, Prod.mk_add_mk, h.add_right, h.add_left, Prod.mk_sub_mk, h.map_sub_left, h.map_sub_right, sub_add_sub_cancel] abel -- _ =O[𝓝 (0 : T)] fun x ↦ ‖x.1 - x.2‖ * ‖(x.2.1, x.1.2)‖ := -- h.toContinuousLinearMap.deriv₂.isBoundedBilinearMap.isBigO_comp -- _ = o[𝓝 0] fun x ↦ ‖x.1 - x.2‖ * 1 := _ _ =o[𝓝 (0 : T)] fun x ↦ x.1 - x.2 := by -- TODO : add 2 `calc` steps instead of the next 3 lines refine h.toContinuousLinearMap.deriv₂.isBoundedBilinearMap.isBigO_comp.trans_isLittleO ?_ suffices (fun x : T ↦ ‖x.1 - x.2‖ * ‖(x.2.1, x.1.2)‖) =o[𝓝 0] fun x ↦ ‖x.1 - x.2‖ * 1 by simpa only [mul_one, isLittleO_norm_right] using this refine (isBigO_refl _ _).mul_isLittleO ((isLittleO_one_iff _).2 ?_) -- TODO: `continuity` fails exact (continuous_snd.fst.prod_mk continuous_fst.snd).norm.tendsto' _ _ (by simp) _ = _ := by simp [(· ∘ ·)]
22
3,584,912,846.131591
2
2
1
2,331
import Mathlib.CategoryTheory.Limits.Preserves.Opposites import Mathlib.Topology.Category.TopCat.Yoneda import Mathlib.Condensed.Explicit universe w w' v u open CategoryTheory Opposite Limits regularTopology ContinuousMap variable {C : Type u} [Category.{v} C] (G : C ⥤ TopCat.{w}) (X : Type w') [TopologicalSpace X]
Mathlib/Condensed/TopComparison.lean
40
58
theorem factorsThrough_of_pullbackCondition {Z B : C} {π : Z ⟶ B} [HasPullback π π] [PreservesLimit (cospan π π) G] {a : C(G.obj Z, X)} (ha : a ∘ (G.map pullback.fst) = a ∘ (G.map (pullback.snd (f := π) (g := π)))) : Function.FactorsThrough a (G.map π) := by
intro x y hxy let xy : G.obj (pullback π π) := (PreservesPullback.iso G π π).inv <| (TopCat.pullbackIsoProdSubtype (G.map π) (G.map π)).inv ⟨(x, y), hxy⟩ have ha' := congr_fun ha xy dsimp at ha' have h₁ : ∀ y, G.map pullback.fst ((PreservesPullback.iso G π π).inv y) = pullback.fst (f := G.map π) (g := G.map π) y := by simp only [← PreservesPullback.iso_inv_fst]; intro y; rfl have h₂ : ∀ y, G.map pullback.snd ((PreservesPullback.iso G π π).inv y) = pullback.snd (f := G.map π) (g := G.map π) y := by simp only [← PreservesPullback.iso_inv_snd]; intro y; rfl erw [h₁, h₂, TopCat.pullbackIsoProdSubtype_inv_fst_apply, TopCat.pullbackIsoProdSubtype_inv_snd_apply] at ha' simpa using ha'
14
1,202,604.284165
2
2
2
2,332
import Mathlib.CategoryTheory.Limits.Preserves.Opposites import Mathlib.Topology.Category.TopCat.Yoneda import Mathlib.Condensed.Explicit universe w w' v u open CategoryTheory Opposite Limits regularTopology ContinuousMap variable {C : Type u} [Category.{v} C] (G : C ⥤ TopCat.{w}) (X : Type w') [TopologicalSpace X] theorem factorsThrough_of_pullbackCondition {Z B : C} {π : Z ⟶ B} [HasPullback π π] [PreservesLimit (cospan π π) G] {a : C(G.obj Z, X)} (ha : a ∘ (G.map pullback.fst) = a ∘ (G.map (pullback.snd (f := π) (g := π)))) : Function.FactorsThrough a (G.map π) := by intro x y hxy let xy : G.obj (pullback π π) := (PreservesPullback.iso G π π).inv <| (TopCat.pullbackIsoProdSubtype (G.map π) (G.map π)).inv ⟨(x, y), hxy⟩ have ha' := congr_fun ha xy dsimp at ha' have h₁ : ∀ y, G.map pullback.fst ((PreservesPullback.iso G π π).inv y) = pullback.fst (f := G.map π) (g := G.map π) y := by simp only [← PreservesPullback.iso_inv_fst]; intro y; rfl have h₂ : ∀ y, G.map pullback.snd ((PreservesPullback.iso G π π).inv y) = pullback.snd (f := G.map π) (g := G.map π) y := by simp only [← PreservesPullback.iso_inv_snd]; intro y; rfl erw [h₁, h₂, TopCat.pullbackIsoProdSubtype_inv_fst_apply, TopCat.pullbackIsoProdSubtype_inv_snd_apply] at ha' simpa using ha'
Mathlib/Condensed/TopComparison.lean
65
86
theorem equalizerCondition_yonedaPresheaf [∀ (Z B : C) (π : Z ⟶ B) [EffectiveEpi π], PreservesLimit (cospan π π) G] (hq : ∀ (Z B : C) (π : Z ⟶ B) [EffectiveEpi π], QuotientMap (G.map π)) : EqualizerCondition (yonedaPresheaf G X) := by
apply EqualizerCondition.mk intro Z B π _ _ refine ⟨fun a b h ↦ ?_, fun ⟨a, ha⟩ ↦ ?_⟩ · simp only [yonedaPresheaf, unop_op, Quiver.Hom.unop_op, Set.coe_setOf, MapToEqualizer, Set.mem_setOf_eq, Subtype.mk.injEq, comp, ContinuousMap.mk.injEq] at h simp only [yonedaPresheaf, unop_op] ext x obtain ⟨y, hy⟩ := (hq Z B π).surjective x rw [← hy] exact congr_fun h y · simp only [yonedaPresheaf, comp, unop_op, Quiver.Hom.unop_op, Set.mem_setOf_eq, ContinuousMap.mk.injEq] at ha simp only [yonedaPresheaf, comp, unop_op, Quiver.Hom.unop_op, Set.coe_setOf, MapToEqualizer, Set.mem_setOf_eq, Subtype.mk.injEq] simp only [yonedaPresheaf, unop_op] at a refine ⟨(hq Z B π).lift a (factorsThrough_of_pullbackCondition G X ha), ?_⟩ congr exact DFunLike.ext'_iff.mp ((hq Z B π).lift_comp a (factorsThrough_of_pullbackCondition G X ha))
18
65,659,969.137331
2
2
2
2,332
import Mathlib.Logic.Encodable.Basic import Mathlib.Order.Atoms import Mathlib.Order.Chain import Mathlib.Order.UpperLower.Basic import Mathlib.Data.Set.Subsingleton #align_import order.ideal from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" open Function Set namespace Order variable {P : Type*} structure Ideal (P) [LE P] extends LowerSet P where nonempty' : carrier.Nonempty directed' : DirectedOn (· ≤ ·) carrier #align order.ideal Order.Ideal -- Porting note (#11215): TODO: remove this configuration and use the default configuration. -- We keep this to be consistent with Lean 3. initialize_simps_projections Ideal (+toLowerSet, -carrier) @[mk_iff] structure IsIdeal {P} [LE P] (I : Set P) : Prop where IsLowerSet : IsLowerSet I Nonempty : I.Nonempty Directed : DirectedOn (· ≤ ·) I #align order.is_ideal Order.IsIdeal def IsIdeal.toIdeal [LE P] {I : Set P} (h : IsIdeal I) : Ideal P := ⟨⟨I, h.IsLowerSet⟩, h.Nonempty, h.Directed⟩ #align order.is_ideal.to_ideal Order.IsIdeal.toIdeal namespace Ideal section LE variable [LE P] section variable {I J s t : Ideal P} {x y : P} theorem toLowerSet_injective : Injective (toLowerSet : Ideal P → LowerSet P) := fun s t _ ↦ by cases s cases t congr #align order.ideal.to_lower_set_injective Order.Ideal.toLowerSet_injective instance : SetLike (Ideal P) P where coe s := s.carrier coe_injective' _ _ h := toLowerSet_injective <| SetLike.coe_injective h @[ext] theorem ext {s t : Ideal P} : (s : Set P) = t → s = t := SetLike.ext' #align order.ideal.ext Order.Ideal.ext @[simp] theorem carrier_eq_coe (s : Ideal P) : s.carrier = s := rfl #align order.ideal.carrier_eq_coe Order.Ideal.carrier_eq_coe @[simp] theorem coe_toLowerSet (s : Ideal P) : (s.toLowerSet : Set P) = s := rfl #align order.ideal.coe_to_lower_set Order.Ideal.coe_toLowerSet protected theorem lower (s : Ideal P) : IsLowerSet (s : Set P) := s.lower' #align order.ideal.lower Order.Ideal.lower protected theorem nonempty (s : Ideal P) : (s : Set P).Nonempty := s.nonempty' #align order.ideal.nonempty Order.Ideal.nonempty protected theorem directed (s : Ideal P) : DirectedOn (· ≤ ·) (s : Set P) := s.directed' #align order.ideal.directed Order.Ideal.directed protected theorem isIdeal (s : Ideal P) : IsIdeal (s : Set P) := ⟨s.lower, s.nonempty, s.directed⟩ #align order.ideal.is_ideal Order.Ideal.isIdeal theorem mem_compl_of_ge {x y : P} : x ≤ y → x ∈ (I : Set P)ᶜ → y ∈ (I : Set P)ᶜ := fun h ↦ mt <| I.lower h #align order.ideal.mem_compl_of_ge Order.Ideal.mem_compl_of_ge instance instPartialOrderIdeal : PartialOrder (Ideal P) := PartialOrder.lift SetLike.coe SetLike.coe_injective -- @[simp] -- Porting note (#10618): simp can prove this theorem coe_subset_coe : (s : Set P) ⊆ t ↔ s ≤ t := Iff.rfl #align order.ideal.coe_subset_coe Order.Ideal.coe_subset_coe -- @[simp] -- Porting note (#10618): simp can prove this theorem coe_ssubset_coe : (s : Set P) ⊂ t ↔ s < t := Iff.rfl #align order.ideal.coe_ssubset_coe Order.Ideal.coe_ssubset_coe @[trans] theorem mem_of_mem_of_le {x : P} {I J : Ideal P} : x ∈ I → I ≤ J → x ∈ J := @Set.mem_of_mem_of_subset P x I J #align order.ideal.mem_of_mem_of_le Order.Ideal.mem_of_mem_of_le @[mk_iff] class IsProper (I : Ideal P) : Prop where ne_univ : (I : Set P) ≠ univ #align order.ideal.is_proper Order.Ideal.IsProper theorem isProper_of_not_mem {I : Ideal P} {p : P} (nmem : p ∉ I) : IsProper I := ⟨fun hp ↦ by have := mem_univ p rw [← hp] at this exact nmem this⟩ #align order.ideal.is_proper_of_not_mem Order.Ideal.isProper_of_not_mem @[mk_iff] class IsMaximal (I : Ideal P) extends IsProper I : Prop where maximal_proper : ∀ ⦃J : Ideal P⦄, I < J → (J : Set P) = univ #align order.ideal.is_maximal Order.Ideal.IsMaximal
Mathlib/Order/Ideal.lean
191
195
theorem inter_nonempty [IsDirected P (· ≥ ·)] (I J : Ideal P) : (I ∩ J : Set P).Nonempty := by
obtain ⟨a, ha⟩ := I.nonempty obtain ⟨b, hb⟩ := J.nonempty obtain ⟨c, hac, hbc⟩ := exists_le_le a b exact ⟨c, I.lower hac ha, J.lower hbc hb⟩
4
54.59815
2
2
1
2,333
import Mathlib.MeasureTheory.Measure.Lebesgue.Complex import Mathlib.MeasureTheory.Integral.DivergenceTheorem import Mathlib.MeasureTheory.Integral.CircleIntegral import Mathlib.Analysis.Calculus.Dslope import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Complex.ReImTopology import Mathlib.Analysis.Calculus.DiffContOnCl import Mathlib.Analysis.Calculus.FDeriv.Analytic import Mathlib.Data.Real.Cardinality #align_import analysis.complex.cauchy_integral from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open TopologicalSpace Set MeasureTheory intervalIntegral Metric Filter Function open scoped Interval Real NNReal ENNReal Topology noncomputable section universe u variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] namespace Complex
Mathlib/Analysis/Complex/CauchyIntegral.lean
166
203
theorem integral_boundary_rect_of_hasFDerivAt_real_off_countable (f : ℂ → E) (f' : ℂ → ℂ →L[ℝ] E) (z w : ℂ) (s : Set ℂ) (hs : s.Countable) (Hc : ContinuousOn f ([[z.re, w.re]] ×ℂ [[z.im, w.im]])) (Hd : ∀ x ∈ Ioo (min z.re w.re) (max z.re w.re) ×ℂ Ioo (min z.im w.im) (max z.im w.im) \ s, HasFDerivAt f (f' x) x) (Hi : IntegrableOn (fun z => I • f' z 1 - f' z I) ([[z.re, w.re]] ×ℂ [[z.im, w.im]])) : (∫ x : ℝ in z.re..w.re, f (x + z.im * I)) - (∫ x : ℝ in z.re..w.re, f (x + w.im * I)) + I • (∫ y : ℝ in z.im..w.im, f (re w + y * I)) - I • ∫ y : ℝ in z.im..w.im, f (re z + y * I) = ∫ x : ℝ in z.re..w.re, ∫ y : ℝ in z.im..w.im, I • f' (x + y * I) 1 - f' (x + y * I) I := by
set e : (ℝ × ℝ) ≃L[ℝ] ℂ := equivRealProdCLM.symm have he : ∀ x y : ℝ, ↑x + ↑y * I = e (x, y) := fun x y => (mk_eq_add_mul_I x y).symm have he₁ : e (1, 0) = 1 := rfl; have he₂ : e (0, 1) = I := rfl simp only [he] at * set F : ℝ × ℝ → E := f ∘ e set F' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E := fun p => (f' (e p)).comp (e : ℝ × ℝ →L[ℝ] ℂ) have hF' : ∀ p : ℝ × ℝ, (-(I • F' p)) (1, 0) + F' p (0, 1) = -(I • f' (e p) 1 - f' (e p) I) := by rintro ⟨x, y⟩ simp only [F', ContinuousLinearMap.neg_apply, ContinuousLinearMap.smul_apply, ContinuousLinearMap.comp_apply, ContinuousLinearEquiv.coe_coe, he₁, he₂, neg_add_eq_sub, neg_sub] set R : Set (ℝ × ℝ) := [[z.re, w.re]] ×ˢ [[w.im, z.im]] set t : Set (ℝ × ℝ) := e ⁻¹' s rw [uIcc_comm z.im] at Hc Hi; rw [min_comm z.im, max_comm z.im] at Hd have hR : e ⁻¹' ([[z.re, w.re]] ×ℂ [[w.im, z.im]]) = R := rfl have htc : ContinuousOn F R := Hc.comp e.continuousOn hR.ge have htd : ∀ p ∈ Ioo (min z.re w.re) (max z.re w.re) ×ˢ Ioo (min w.im z.im) (max w.im z.im) \ t, HasFDerivAt F (F' p) p := fun p hp => (Hd (e p) hp).comp p e.hasFDerivAt simp_rw [← intervalIntegral.integral_smul, intervalIntegral.integral_symm w.im z.im, ← intervalIntegral.integral_neg, ← hF'] refine (integral2_divergence_prod_of_hasFDerivWithinAt_off_countable (fun p => -(I • F p)) F (fun p => -(I • F' p)) F' z.re w.im w.re z.im t (hs.preimage e.injective) (htc.const_smul _).neg htc (fun p hp => ((htd p hp).const_smul I).neg) htd ?_).symm rw [← (volume_preserving_equiv_real_prod.symm _).integrableOn_comp_preimage (MeasurableEquiv.measurableEmbedding _)] at Hi simpa only [hF'] using Hi.neg
28
1,446,257,064,291.475
2
2
1
2,334
import Mathlib.Algebra.Category.GroupCat.Basic import Mathlib.Algebra.Category.MonCat.FilteredColimits #align_import algebra.category.Group.filtered_colimits from "leanprover-community/mathlib"@"c43486ecf2a5a17479a32ce09e4818924145e90e" set_option linter.uppercaseLean3 false universe v u noncomputable section open scoped Classical open CategoryTheory open CategoryTheory.Limits open CategoryTheory.IsFiltered renaming max → max' -- avoid name collision with `_root_.max`. namespace GroupCat.FilteredColimits section open MonCat.FilteredColimits (colimit_one_eq colimit_mul_mk_eq) -- Mathlib3 used parameters here, mainly so we could have the abbreviations `G` and `G.mk` below, -- without passing around `F` all the time. variable {J : Type v} [SmallCategory J] [IsFiltered J] (F : J ⥤ GroupCat.{max v u}) @[to_additive "The colimit of `F ⋙ forget₂ AddGroupCat AddMonCat` in the category `AddMonCat`. In the following, we will show that this has the structure of an additive group."] noncomputable abbrev G : MonCat := MonCat.FilteredColimits.colimit.{v, u} (F ⋙ forget₂ GroupCat MonCat.{max v u}) #align Group.filtered_colimits.G GroupCat.FilteredColimits.G #align AddGroup.filtered_colimits.G AddGroupCat.FilteredColimits.G @[to_additive "The canonical projection into the colimit, as a quotient type."] abbrev G.mk : (Σ j, F.obj j) → G.{v, u} F := Quot.mk (Types.Quot.Rel (F ⋙ forget GroupCat.{max v u})) #align Group.filtered_colimits.G.mk GroupCat.FilteredColimits.G.mk #align AddGroup.filtered_colimits.G.mk AddGroupCat.FilteredColimits.G.mk @[to_additive] theorem G.mk_eq (x y : Σ j, F.obj j) (h : ∃ (k : J) (f : x.1 ⟶ k) (g : y.1 ⟶ k), F.map f x.2 = F.map g y.2) : G.mk.{v, u} F x = G.mk F y := Quot.EqvGen_sound (Types.FilteredColimit.eqvGen_quot_rel_of_rel (F ⋙ forget GroupCat) x y h) #align Group.filtered_colimits.G.mk_eq GroupCat.FilteredColimits.G.mk_eq #align AddGroup.filtered_colimits.G.mk_eq AddGroupCat.FilteredColimits.G.mk_eq @[to_additive "The \"unlifted\" version of negation in the colimit."] def colimitInvAux (x : Σ j, F.obj j) : G.{v, u} F := G.mk F ⟨x.1, x.2⁻¹⟩ #align Group.filtered_colimits.colimit_inv_aux GroupCat.FilteredColimits.colimitInvAux #align AddGroup.filtered_colimits.colimit_neg_aux AddGroupCat.FilteredColimits.colimitNegAux @[to_additive]
Mathlib/Algebra/Category/GroupCat/FilteredColimits.lean
84
91
theorem colimitInvAux_eq_of_rel (x y : Σ j, F.obj j) (h : Types.FilteredColimit.Rel (F ⋙ forget GroupCat) x y) : colimitInvAux.{v, u} F x = colimitInvAux F y := by
apply G.mk_eq obtain ⟨k, f, g, hfg⟩ := h use k, f, g rw [MonoidHom.map_inv, MonoidHom.map_inv, inv_inj] exact hfg
5
148.413159
2
2
1
2,335
import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic import Mathlib.CategoryTheory.Preadditive.Injective import Mathlib.Algebra.Category.GroupCat.EpiMono import Mathlib.Algebra.Category.ModuleCat.EpiMono #align_import category_theory.preadditive.yoneda.injective from "leanprover-community/mathlib"@"f8d8465c3c392a93b9ed226956e26dee00975946" universe v u open Opposite namespace CategoryTheory variable {C : Type u} [Category.{v} C] section Preadditive variable [Preadditive C] namespace Injective
Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean
32
40
theorem injective_iff_preservesEpimorphisms_preadditiveYoneda_obj (J : C) : Injective J ↔ (preadditiveYoneda.obj J).PreservesEpimorphisms := by
rw [injective_iff_preservesEpimorphisms_yoneda_obj] refine ⟨fun h : (preadditiveYoneda.obj J ⋙ (forget AddCommGroupCat)).PreservesEpimorphisms => ?_, ?_⟩ · exact Functor.preservesEpimorphisms_of_preserves_of_reflects (preadditiveYoneda.obj J) (forget _) · intro exact (inferInstance : (preadditiveYoneda.obj J ⋙ forget _).PreservesEpimorphisms)
7
1,096.633158
2
2
2
2,336
import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic import Mathlib.CategoryTheory.Preadditive.Injective import Mathlib.Algebra.Category.GroupCat.EpiMono import Mathlib.Algebra.Category.ModuleCat.EpiMono #align_import category_theory.preadditive.yoneda.injective from "leanprover-community/mathlib"@"f8d8465c3c392a93b9ed226956e26dee00975946" universe v u open Opposite namespace CategoryTheory variable {C : Type u} [Category.{v} C] section Preadditive variable [Preadditive C] namespace Injective theorem injective_iff_preservesEpimorphisms_preadditiveYoneda_obj (J : C) : Injective J ↔ (preadditiveYoneda.obj J).PreservesEpimorphisms := by rw [injective_iff_preservesEpimorphisms_yoneda_obj] refine ⟨fun h : (preadditiveYoneda.obj J ⋙ (forget AddCommGroupCat)).PreservesEpimorphisms => ?_, ?_⟩ · exact Functor.preservesEpimorphisms_of_preserves_of_reflects (preadditiveYoneda.obj J) (forget _) · intro exact (inferInstance : (preadditiveYoneda.obj J ⋙ forget _).PreservesEpimorphisms) #align category_theory.injective.injective_iff_preserves_epimorphisms_preadditive_yoneda_obj CategoryTheory.Injective.injective_iff_preservesEpimorphisms_preadditiveYoneda_obj
Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean
43
51
theorem injective_iff_preservesEpimorphisms_preadditive_yoneda_obj' (J : C) : Injective J ↔ (preadditiveYonedaObj J).PreservesEpimorphisms := by
rw [injective_iff_preservesEpimorphisms_yoneda_obj] refine ⟨fun h : (preadditiveYonedaObj J ⋙ (forget <| ModuleCat (End J))).PreservesEpimorphisms => ?_, ?_⟩ · exact Functor.preservesEpimorphisms_of_preserves_of_reflects (preadditiveYonedaObj J) (forget _) · intro exact (inferInstance : (preadditiveYonedaObj J ⋙ forget _).PreservesEpimorphisms)
7
1,096.633158
2
2
2
2,336
import Mathlib.Order.Interval.Set.Monotone import Mathlib.Topology.MetricSpace.Basic import Mathlib.Topology.MetricSpace.Bounded import Mathlib.Topology.Order.MonotoneConvergence #align_import analysis.box_integral.box.basic from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Function Metric Filter noncomputable section open scoped Classical open NNReal Topology namespace BoxIntegral variable {ι : Type*} structure Box (ι : Type*) where (lower upper : ι → ℝ) lower_lt_upper : ∀ i, lower i < upper i #align box_integral.box BoxIntegral.Box attribute [simp] Box.lower_lt_upper namespace Box variable (I J : Box ι) {x y : ι → ℝ} instance : Inhabited (Box ι) := ⟨⟨0, 1, fun _ ↦ zero_lt_one⟩⟩ theorem lower_le_upper : I.lower ≤ I.upper := fun i ↦ (I.lower_lt_upper i).le #align box_integral.box.lower_le_upper BoxIntegral.Box.lower_le_upper theorem lower_ne_upper (i) : I.lower i ≠ I.upper i := (I.lower_lt_upper i).ne #align box_integral.box.lower_ne_upper BoxIntegral.Box.lower_ne_upper instance : Membership (ι → ℝ) (Box ι) := ⟨fun x I ↦ ∀ i, x i ∈ Ioc (I.lower i) (I.upper i)⟩ -- Porting note: added @[coe] def toSet (I : Box ι) : Set (ι → ℝ) := { x | x ∈ I } instance : CoeTC (Box ι) (Set <| ι → ℝ) := ⟨toSet⟩ @[simp] theorem mem_mk {l u x : ι → ℝ} {H} : x ∈ mk l u H ↔ ∀ i, x i ∈ Ioc (l i) (u i) := Iff.rfl #align box_integral.box.mem_mk BoxIntegral.Box.mem_mk @[simp, norm_cast] theorem mem_coe : x ∈ (I : Set (ι → ℝ)) ↔ x ∈ I := Iff.rfl #align box_integral.box.mem_coe BoxIntegral.Box.mem_coe theorem mem_def : x ∈ I ↔ ∀ i, x i ∈ Ioc (I.lower i) (I.upper i) := Iff.rfl #align box_integral.box.mem_def BoxIntegral.Box.mem_def theorem mem_univ_Ioc {I : Box ι} : (x ∈ pi univ fun i ↦ Ioc (I.lower i) (I.upper i)) ↔ x ∈ I := mem_univ_pi #align box_integral.box.mem_univ_Ioc BoxIntegral.Box.mem_univ_Ioc theorem coe_eq_pi : (I : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (I.lower i) (I.upper i) := Set.ext fun _ ↦ mem_univ_Ioc.symm #align box_integral.box.coe_eq_pi BoxIntegral.Box.coe_eq_pi @[simp] theorem upper_mem : I.upper ∈ I := fun i ↦ right_mem_Ioc.2 <| I.lower_lt_upper i #align box_integral.box.upper_mem BoxIntegral.Box.upper_mem theorem exists_mem : ∃ x, x ∈ I := ⟨_, I.upper_mem⟩ #align box_integral.box.exists_mem BoxIntegral.Box.exists_mem theorem nonempty_coe : Set.Nonempty (I : Set (ι → ℝ)) := I.exists_mem #align box_integral.box.nonempty_coe BoxIntegral.Box.nonempty_coe @[simp] theorem coe_ne_empty : (I : Set (ι → ℝ)) ≠ ∅ := I.nonempty_coe.ne_empty #align box_integral.box.coe_ne_empty BoxIntegral.Box.coe_ne_empty @[simp] theorem empty_ne_coe : ∅ ≠ (I : Set (ι → ℝ)) := I.coe_ne_empty.symm #align box_integral.box.empty_ne_coe BoxIntegral.Box.empty_ne_coe instance : LE (Box ι) := ⟨fun I J ↦ ∀ ⦃x⦄, x ∈ I → x ∈ J⟩ theorem le_def : I ≤ J ↔ ∀ x ∈ I, x ∈ J := Iff.rfl #align box_integral.box.le_def BoxIntegral.Box.le_def
Mathlib/Analysis/BoxIntegral/Box/Basic.lean
157
168
theorem le_TFAE : List.TFAE [I ≤ J, (I : Set (ι → ℝ)) ⊆ J, Icc I.lower I.upper ⊆ Icc J.lower J.upper, J.lower ≤ I.lower ∧ I.upper ≤ J.upper] := by
tfae_have 1 ↔ 2 · exact Iff.rfl tfae_have 2 → 3 · intro h simpa [coe_eq_pi, closure_pi_set, lower_ne_upper] using closure_mono h tfae_have 3 ↔ 4 · exact Icc_subset_Icc_iff I.lower_le_upper tfae_have 4 → 2 · exact fun h x hx i ↦ Ioc_subset_Ioc (h.1 i) (h.2 i) (hx i) tfae_finish
10
22,026.465795
2
2
2
2,337
import Mathlib.Order.Interval.Set.Monotone import Mathlib.Topology.MetricSpace.Basic import Mathlib.Topology.MetricSpace.Bounded import Mathlib.Topology.Order.MonotoneConvergence #align_import analysis.box_integral.box.basic from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Function Metric Filter noncomputable section open scoped Classical open NNReal Topology namespace BoxIntegral variable {ι : Type*} structure Box (ι : Type*) where (lower upper : ι → ℝ) lower_lt_upper : ∀ i, lower i < upper i #align box_integral.box BoxIntegral.Box attribute [simp] Box.lower_lt_upper namespace Box variable (I J : Box ι) {x y : ι → ℝ} instance : Inhabited (Box ι) := ⟨⟨0, 1, fun _ ↦ zero_lt_one⟩⟩ theorem lower_le_upper : I.lower ≤ I.upper := fun i ↦ (I.lower_lt_upper i).le #align box_integral.box.lower_le_upper BoxIntegral.Box.lower_le_upper theorem lower_ne_upper (i) : I.lower i ≠ I.upper i := (I.lower_lt_upper i).ne #align box_integral.box.lower_ne_upper BoxIntegral.Box.lower_ne_upper instance : Membership (ι → ℝ) (Box ι) := ⟨fun x I ↦ ∀ i, x i ∈ Ioc (I.lower i) (I.upper i)⟩ -- Porting note: added @[coe] def toSet (I : Box ι) : Set (ι → ℝ) := { x | x ∈ I } instance : CoeTC (Box ι) (Set <| ι → ℝ) := ⟨toSet⟩ @[simp] theorem mem_mk {l u x : ι → ℝ} {H} : x ∈ mk l u H ↔ ∀ i, x i ∈ Ioc (l i) (u i) := Iff.rfl #align box_integral.box.mem_mk BoxIntegral.Box.mem_mk @[simp, norm_cast] theorem mem_coe : x ∈ (I : Set (ι → ℝ)) ↔ x ∈ I := Iff.rfl #align box_integral.box.mem_coe BoxIntegral.Box.mem_coe theorem mem_def : x ∈ I ↔ ∀ i, x i ∈ Ioc (I.lower i) (I.upper i) := Iff.rfl #align box_integral.box.mem_def BoxIntegral.Box.mem_def theorem mem_univ_Ioc {I : Box ι} : (x ∈ pi univ fun i ↦ Ioc (I.lower i) (I.upper i)) ↔ x ∈ I := mem_univ_pi #align box_integral.box.mem_univ_Ioc BoxIntegral.Box.mem_univ_Ioc theorem coe_eq_pi : (I : Set (ι → ℝ)) = pi univ fun i ↦ Ioc (I.lower i) (I.upper i) := Set.ext fun _ ↦ mem_univ_Ioc.symm #align box_integral.box.coe_eq_pi BoxIntegral.Box.coe_eq_pi @[simp] theorem upper_mem : I.upper ∈ I := fun i ↦ right_mem_Ioc.2 <| I.lower_lt_upper i #align box_integral.box.upper_mem BoxIntegral.Box.upper_mem theorem exists_mem : ∃ x, x ∈ I := ⟨_, I.upper_mem⟩ #align box_integral.box.exists_mem BoxIntegral.Box.exists_mem theorem nonempty_coe : Set.Nonempty (I : Set (ι → ℝ)) := I.exists_mem #align box_integral.box.nonempty_coe BoxIntegral.Box.nonempty_coe @[simp] theorem coe_ne_empty : (I : Set (ι → ℝ)) ≠ ∅ := I.nonempty_coe.ne_empty #align box_integral.box.coe_ne_empty BoxIntegral.Box.coe_ne_empty @[simp] theorem empty_ne_coe : ∅ ≠ (I : Set (ι → ℝ)) := I.coe_ne_empty.symm #align box_integral.box.empty_ne_coe BoxIntegral.Box.empty_ne_coe instance : LE (Box ι) := ⟨fun I J ↦ ∀ ⦃x⦄, x ∈ I → x ∈ J⟩ theorem le_def : I ≤ J ↔ ∀ x ∈ I, x ∈ J := Iff.rfl #align box_integral.box.le_def BoxIntegral.Box.le_def theorem le_TFAE : List.TFAE [I ≤ J, (I : Set (ι → ℝ)) ⊆ J, Icc I.lower I.upper ⊆ Icc J.lower J.upper, J.lower ≤ I.lower ∧ I.upper ≤ J.upper] := by tfae_have 1 ↔ 2 · exact Iff.rfl tfae_have 2 → 3 · intro h simpa [coe_eq_pi, closure_pi_set, lower_ne_upper] using closure_mono h tfae_have 3 ↔ 4 · exact Icc_subset_Icc_iff I.lower_le_upper tfae_have 4 → 2 · exact fun h x hx i ↦ Ioc_subset_Ioc (h.1 i) (h.2 i) (hx i) tfae_finish #align box_integral.box.le_tfae BoxIntegral.Box.le_TFAE variable {I J} @[simp, norm_cast] theorem coe_subset_coe : (I : Set (ι → ℝ)) ⊆ J ↔ I ≤ J := Iff.rfl #align box_integral.box.coe_subset_coe BoxIntegral.Box.coe_subset_coe theorem le_iff_bounds : I ≤ J ↔ J.lower ≤ I.lower ∧ I.upper ≤ J.upper := (le_TFAE I J).out 0 3 #align box_integral.box.le_iff_bounds BoxIntegral.Box.le_iff_bounds
Mathlib/Analysis/BoxIntegral/Box/Basic.lean
181
185
theorem injective_coe : Injective ((↑) : Box ι → Set (ι → ℝ)) := by
rintro ⟨l₁, u₁, h₁⟩ ⟨l₂, u₂, h₂⟩ h simp only [Subset.antisymm_iff, coe_subset_coe, le_iff_bounds] at h congr exacts [le_antisymm h.2.1 h.1.1, le_antisymm h.1.2 h.2.2]
4
54.59815
2
2
2
2,337
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.AddTorsorBases import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import analysis.convex.measure from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open MeasureTheory MeasureTheory.Measure Set Metric Filter Bornology open FiniteDimensional (finrank) open scoped Topology NNReal ENNReal variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] (μ : Measure E) [IsAddHaarMeasure μ] {s : Set E} namespace Convex
Mathlib/Analysis/Convex/Measure.lean
33
80
theorem addHaar_frontier (hs : Convex ℝ s) : μ (frontier s) = 0 := by
/- If `s` is included in a hyperplane, then `frontier s ⊆ closure s` is included in the same hyperplane, hence it has measure zero. -/ cases' ne_or_eq (affineSpan ℝ s) ⊤ with hspan hspan · refine measure_mono_null ?_ (addHaar_affineSubspace _ _ hspan) exact frontier_subset_closure.trans (closure_minimal (subset_affineSpan _ _) (affineSpan ℝ s).closed_of_finiteDimensional) rw [← hs.interior_nonempty_iff_affineSpan_eq_top] at hspan rcases hspan with ⟨x, hx⟩ /- Without loss of generality, `s` is bounded. Indeed, `∂s ⊆ ⋃ n, ∂(s ∩ ball x (n + 1))`, hence it suffices to prove that `∀ n, μ (s ∩ ball x (n + 1)) = 0`; the latter set is bounded. -/ suffices H : ∀ t : Set E, Convex ℝ t → x ∈ interior t → IsBounded t → μ (frontier t) = 0 by let B : ℕ → Set E := fun n => ball x (n + 1) have : μ (⋃ n : ℕ, frontier (s ∩ B n)) = 0 := by refine measure_iUnion_null fun n => H _ (hs.inter (convex_ball _ _)) ?_ (isBounded_ball.subset inter_subset_right) rw [interior_inter, isOpen_ball.interior_eq] exact ⟨hx, mem_ball_self (add_pos_of_nonneg_of_pos n.cast_nonneg zero_lt_one)⟩ refine measure_mono_null (fun y hy => ?_) this; clear this set N : ℕ := ⌊dist y x⌋₊ refine mem_iUnion.2 ⟨N, ?_⟩ have hN : y ∈ B N := by simp [B, N, Nat.lt_floor_add_one] suffices y ∈ frontier (s ∩ B N) ∩ B N from this.1 rw [frontier_inter_open_inter isOpen_ball] exact ⟨hy, hN⟩ intro s hs hx hb /- Since `s` is bounded, we have `μ (interior s) ≠ ∞`, hence it suffices to prove `μ (closure s) ≤ μ (interior s)`. -/ replace hb : μ (interior s) ≠ ∞ := (hb.subset interior_subset).measure_lt_top.ne suffices μ (closure s) ≤ μ (interior s) by rwa [frontier, measure_diff interior_subset_closure isOpen_interior.measurableSet hb, tsub_eq_zero_iff_le] /- Due to `Convex.closure_subset_image_homothety_interior_of_one_lt`, for any `r > 1` we have `closure s ⊆ homothety x r '' interior s`, hence `μ (closure s) ≤ r ^ d * μ (interior s)`, where `d = finrank ℝ E`. -/ set d : ℕ := FiniteDimensional.finrank ℝ E have : ∀ r : ℝ≥0, 1 < r → μ (closure s) ≤ ↑(r ^ d) * μ (interior s) := fun r hr ↦ by refine (measure_mono <| hs.closure_subset_image_homothety_interior_of_one_lt hx r hr).trans_eq ?_ rw [addHaar_image_homothety, ← NNReal.coe_pow, NNReal.abs_eq, ENNReal.ofReal_coe_nnreal] have : ∀ᶠ (r : ℝ≥0) in 𝓝[>] 1, μ (closure s) ≤ ↑(r ^ d) * μ (interior s) := mem_of_superset self_mem_nhdsWithin this -- Taking the limit as `r → 1`, we get `μ (closure s) ≤ μ (interior s)`. refine ge_of_tendsto ?_ this refine (((ENNReal.continuous_mul_const hb).comp (ENNReal.continuous_coe.comp (continuous_pow d))).tendsto' _ _ ?_).mono_left nhdsWithin_le_nhds simp
47
258,131,288,619,006,750,000
2
2
1
2,338
import Mathlib.LinearAlgebra.DFinsupp import Mathlib.RingTheory.Ideal.Operations #align_import ring_theory.coprime.ideal from "leanprover-community/mathlib"@"2bbc7e3884ba234309d2a43b19144105a753292e" namespace Ideal variable {ι R : Type*} [CommSemiring R]
Mathlib/RingTheory/Coprime/Ideal.lean
31
112
theorem iSup_iInf_eq_top_iff_pairwise {t : Finset ι} (h : t.Nonempty) (I : ι → Ideal R) : (⨆ i ∈ t, ⨅ (j) (_ : j ∈ t) (_ : j ≠ i), I j) = ⊤ ↔ (t : Set ι).Pairwise fun i j => I i ⊔ I j = ⊤ := by
haveI : DecidableEq ι := Classical.decEq ι rw [eq_top_iff_one, Submodule.mem_iSup_finset_iff_exists_sum] refine h.cons_induction ?_ ?_ <;> clear t h · simp only [Finset.sum_singleton, Finset.coe_singleton, Set.pairwise_singleton, iff_true_iff] refine fun a => ⟨fun i => if h : i = a then ⟨1, ?_⟩ else 0, ?_⟩ · simp [h] · simp only [dif_pos, dif_ctx_congr, Submodule.coe_mk, eq_self_iff_true] intro a t hat h ih rw [Finset.coe_cons, Set.pairwise_insert_of_symmetric fun i j (h : I i ⊔ I j = ⊤) ↦ (sup_comm _ _).trans h] constructor · rintro ⟨μ, hμ⟩ rw [Finset.sum_cons] at hμ -- Porting note: `refine` yields goals in a different order than in lean3. refine ⟨ih.mp ⟨Pi.single h.choose ⟨μ a, ?a1⟩ + fun i => ⟨μ i, ?a2⟩, ?a3⟩, fun b hb ab => ?a4⟩ case a1 => have := Submodule.coe_mem (μ a) rw [mem_iInf] at this ⊢ --for some reason `simp only [mem_iInf]` times out intro i specialize this i rw [mem_iInf, mem_iInf] at this ⊢ intro hi _ apply this (Finset.subset_cons _ hi) rintro rfl exact hat hi case a2 => have := Submodule.coe_mem (μ i) simp only [mem_iInf] at this ⊢ intro j hj ij exact this _ (Finset.subset_cons _ hj) ij case a3 => rw [← @if_pos _ _ h.choose_spec R (μ a) 0, ← Finset.sum_pi_single', ← Finset.sum_add_distrib] at hμ convert hμ rename_i i _ rw [Pi.add_apply, Submodule.coe_add, Submodule.coe_mk] by_cases hi : i = h.choose · rw [hi, Pi.single_eq_same, Pi.single_eq_same, Submodule.coe_mk] · rw [Pi.single_eq_of_ne hi, Pi.single_eq_of_ne hi, Submodule.coe_zero] case a4 => rw [eq_top_iff_one, Submodule.mem_sup] rw [add_comm] at hμ refine ⟨_, ?_, _, ?_, hμ⟩ · refine sum_mem _ fun x hx => ?_ have := Submodule.coe_mem (μ x) simp only [mem_iInf] at this apply this _ (Finset.mem_cons_self _ _) rintro rfl exact hat hx · have := Submodule.coe_mem (μ a) simp only [mem_iInf] at this exact this _ (Finset.subset_cons _ hb) ab.symm · rintro ⟨hs, Hb⟩ obtain ⟨μ, hμ⟩ := ih.mpr hs have := sup_iInf_eq_top fun b hb => Hb b hb (ne_of_mem_of_not_mem hb hat).symm rw [eq_top_iff_one, Submodule.mem_sup] at this obtain ⟨u, hu, v, hv, huv⟩ := this refine ⟨fun i => if hi : i = a then ⟨v, ?_⟩ else ⟨u * μ i, ?_⟩, ?_⟩ · simp only [mem_iInf] at hv ⊢ intro j hj ij rw [Finset.mem_cons, ← hi] at hj exact hv _ (hj.resolve_left ij) · have := Submodule.coe_mem (μ i) simp only [mem_iInf] at this ⊢ intro j hj ij rcases Finset.mem_cons.mp hj with (rfl | hj) · exact mul_mem_right _ _ hu · exact mul_mem_left _ _ (this _ hj ij) · dsimp only rw [Finset.sum_cons, dif_pos rfl, add_comm] rw [← mul_one u] at huv rw [← huv, ← hμ, Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro j hj rw [dif_neg] rintro rfl exact hat hj
79
20,382,810,665,126,688,000,000,000,000,000,000
2
2
1
2,339
import Mathlib.Topology.Category.TopCat.Adjunctions #align_import topology.category.Top.epi_mono from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u open CategoryTheory open TopCat namespace TopCat
Mathlib/Topology/Category/TopCat/EpiMono.lean
27
34
theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
suffices Epi f ↔ Epi ((forget TopCat).map f) by rw [this, CategoryTheory.epi_iff_surjective] rfl constructor · intro infer_instance · apply Functor.epi_of_epi_map
7
1,096.633158
2
2
2
2,340
import Mathlib.Topology.Category.TopCat.Adjunctions #align_import topology.category.Top.epi_mono from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u open CategoryTheory open TopCat namespace TopCat theorem epi_iff_surjective {X Y : TopCat.{u}} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by suffices Epi f ↔ Epi ((forget TopCat).map f) by rw [this, CategoryTheory.epi_iff_surjective] rfl constructor · intro infer_instance · apply Functor.epi_of_epi_map set_option linter.uppercaseLean3 false in #align Top.epi_iff_surjective TopCat.epi_iff_surjective
Mathlib/Topology/Category/TopCat/EpiMono.lean
38
45
theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by
suffices Mono f ↔ Mono ((forget TopCat).map f) by rw [this, CategoryTheory.mono_iff_injective] rfl constructor · intro infer_instance · apply Functor.mono_of_mono_map
7
1,096.633158
2
2
2
2,340
import Mathlib.RingTheory.Ideal.Cotangent import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.RingTheory.FinitePresentation import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Away.AdjoinRoot #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth end namespace FormallySmooth section variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B)
Mathlib/RingTheory/Smooth/Basic.lean
68
88
theorem exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by
revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩
18
65,659,969.137331
2
2
4
2,341
import Mathlib.RingTheory.Ideal.Cotangent import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.RingTheory.FinitePresentation import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Away.AdjoinRoot #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth end namespace FormallySmooth section variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) theorem exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift noncomputable def lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] noncomputable def liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp]
Mathlib/RingTheory/Smooth/Basic.lean
121
131
theorem liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by
apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective simp only [liftOfSurjective, AlgEquiv.apply_symm_apply, AlgEquiv.toAlgHom_eq_coe, Ideal.quotientKerAlgEquivOfSurjective_apply, RingHom.kerLift_mk, RingHom.coe_coe]
8
2,980.957987
2
2
4
2,341
import Mathlib.RingTheory.Ideal.Cotangent import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.RingTheory.FinitePresentation import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Away.AdjoinRoot #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth end namespace FormallySmooth section variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) theorem exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift noncomputable def lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] noncomputable def liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective simp only [liftOfSurjective, AlgEquiv.apply_symm_apply, AlgEquiv.toAlgHom_eq_coe, Ideal.quotientKerAlgEquivOfSurjective_apply, RingHom.kerLift_mk, RingHom.coe_coe] #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section OfEquiv variable {R : Type u} [CommSemiring R] variable {A B : Type u} [Semiring A] [Algebra R A] [Semiring B] [Algebra R B]
Mathlib/RingTheory/Smooth/Basic.lean
148
153
theorem of_equiv [FormallySmooth R A] (e : A ≃ₐ[R] B) : FormallySmooth R B := by
constructor intro C _ _ I hI f use (FormallySmooth.lift I ⟨2, hI⟩ (f.comp e : A →ₐ[R] C ⧸ I)).comp e.symm rw [← AlgHom.comp_assoc, FormallySmooth.comp_lift, AlgHom.comp_assoc, AlgEquiv.comp_symm, AlgHom.comp_id]
5
148.413159
2
2
4
2,341
import Mathlib.RingTheory.Ideal.Cotangent import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.RingTheory.FinitePresentation import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Away.AdjoinRoot #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth end namespace FormallySmooth section variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) theorem exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift noncomputable def lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] noncomputable def liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective simp only [liftOfSurjective, AlgEquiv.apply_symm_apply, AlgEquiv.toAlgHom_eq_coe, Ideal.quotientKerAlgEquivOfSurjective_apply, RingHom.kerLift_mk, RingHom.coe_coe] #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B]
Mathlib/RingTheory/Smooth/Basic.lean
188
196
theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by
constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩
8
2,980.957987
2
2
4
2,341
import Mathlib.Computability.PartrecCode import Mathlib.Data.Set.Subsingleton #align_import computability.halting from "leanprover-community/mathlib"@"a50170a88a47570ed186b809ca754110590f9476" open Encodable Denumerable namespace Nat.Partrec open Computable Part
Mathlib/Computability/Halting.lean
28
60
theorem merge' {f g} (hf : Nat.Partrec f) (hg : Nat.Partrec g) : ∃ h, Nat.Partrec h ∧ ∀ a, (∀ x ∈ h a, x ∈ f a ∨ x ∈ g a) ∧ ((h a).Dom ↔ (f a).Dom ∨ (g a).Dom) := by
obtain ⟨cf, rfl⟩ := Code.exists_code.1 hf obtain ⟨cg, rfl⟩ := Code.exists_code.1 hg have : Nat.Partrec fun n => Nat.rfindOpt fun k => cf.evaln k n <|> cg.evaln k n := Partrec.nat_iff.1 (Partrec.rfindOpt <| Primrec.option_orElse.to_comp.comp (Code.evaln_prim.to_comp.comp <| (snd.pair (const cf)).pair fst) (Code.evaln_prim.to_comp.comp <| (snd.pair (const cg)).pair fst)) refine ⟨_, this, fun n => ?_⟩ have : ∀ x ∈ rfindOpt fun k ↦ HOrElse.hOrElse (Code.evaln k cf n) fun _x ↦ Code.evaln k cg n, x ∈ Code.eval cf n ∨ x ∈ Code.eval cg n := by intro x h obtain ⟨k, e⟩ := Nat.rfindOpt_spec h revert e simp only [Option.mem_def] cases' e' : cf.evaln k n with y <;> simp <;> intro e · exact Or.inr (Code.evaln_sound e) · subst y exact Or.inl (Code.evaln_sound e') refine ⟨this, ⟨fun h => (this _ ⟨h, rfl⟩).imp Exists.fst Exists.fst, ?_⟩⟩ intro h rw [Nat.rfindOpt_dom] simp only [dom_iff_mem, Code.evaln_complete, Option.mem_def] at h obtain ⟨x, k, e⟩ | ⟨x, k, e⟩ := h · refine ⟨k, x, ?_⟩ simp only [e, Option.some_orElse, Option.mem_def] · refine ⟨k, ?_⟩ cases' cf.evaln k n with y · exact ⟨x, by simp only [e, Option.mem_def, Option.none_orElse]⟩ · exact ⟨y, by simp only [Option.some_orElse, Option.mem_def]⟩
30
10,686,474,581,524.463
2
2
1
2,342
import Mathlib.CategoryTheory.ConcreteCategory.Basic import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts import Mathlib.CategoryTheory.Limits.Shapes.RegularMono import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms #align_import category_theory.limits.mono_coprod from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits universe u namespace CategoryTheory namespace Limits variable (C : Type*) [Category C] class MonoCoprod : Prop where binaryCofan_inl : ∀ ⦃A B : C⦄ (c : BinaryCofan A B) (_ : IsColimit c), Mono c.inl #align category_theory.limits.mono_coprod CategoryTheory.Limits.MonoCoprod variable {C} instance (priority := 100) monoCoprodOfHasZeroMorphisms [HasZeroMorphisms C] : MonoCoprod C := ⟨fun A B c hc => by haveI : IsSplitMono c.inl := IsSplitMono.mk' (SplitMono.mk (hc.desc (BinaryCofan.mk (𝟙 A) 0)) (IsColimit.fac _ _ _)) infer_instance⟩ #align category_theory.limits.mono_coprod_of_has_zero_morphisms CategoryTheory.Limits.monoCoprodOfHasZeroMorphisms namespace MonoCoprod
Mathlib/CategoryTheory/Limits/MonoCoprod.lean
63
69
theorem binaryCofan_inr {A B : C} [MonoCoprod C] (c : BinaryCofan A B) (hc : IsColimit c) : Mono c.inr := by
haveI hc' : IsColimit (BinaryCofan.mk c.inr c.inl) := BinaryCofan.IsColimit.mk _ (fun f₁ f₂ => hc.desc (BinaryCofan.mk f₂ f₁)) (by aesop_cat) (by aesop_cat) (fun f₁ f₂ m h₁ h₂ => BinaryCofan.IsColimit.hom_ext hc (by aesop_cat) (by aesop_cat)) exact binaryCofan_inl _ hc'
5
148.413159
2
2
2
2,343
import Mathlib.CategoryTheory.ConcreteCategory.Basic import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts import Mathlib.CategoryTheory.Limits.Shapes.RegularMono import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms #align_import category_theory.limits.mono_coprod from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits universe u namespace CategoryTheory namespace Limits variable (C : Type*) [Category C] class MonoCoprod : Prop where binaryCofan_inl : ∀ ⦃A B : C⦄ (c : BinaryCofan A B) (_ : IsColimit c), Mono c.inl #align category_theory.limits.mono_coprod CategoryTheory.Limits.MonoCoprod variable {C} instance (priority := 100) monoCoprodOfHasZeroMorphisms [HasZeroMorphisms C] : MonoCoprod C := ⟨fun A B c hc => by haveI : IsSplitMono c.inl := IsSplitMono.mk' (SplitMono.mk (hc.desc (BinaryCofan.mk (𝟙 A) 0)) (IsColimit.fac _ _ _)) infer_instance⟩ #align category_theory.limits.mono_coprod_of_has_zero_morphisms CategoryTheory.Limits.monoCoprodOfHasZeroMorphisms namespace MonoCoprod theorem binaryCofan_inr {A B : C} [MonoCoprod C] (c : BinaryCofan A B) (hc : IsColimit c) : Mono c.inr := by haveI hc' : IsColimit (BinaryCofan.mk c.inr c.inl) := BinaryCofan.IsColimit.mk _ (fun f₁ f₂ => hc.desc (BinaryCofan.mk f₂ f₁)) (by aesop_cat) (by aesop_cat) (fun f₁ f₂ m h₁ h₂ => BinaryCofan.IsColimit.hom_ext hc (by aesop_cat) (by aesop_cat)) exact binaryCofan_inl _ hc' #align category_theory.limits.mono_coprod.binary_cofan_inr CategoryTheory.Limits.MonoCoprod.binaryCofan_inr instance {A B : C} [MonoCoprod C] [HasBinaryCoproduct A B] : Mono (coprod.inl : A ⟶ A ⨿ B) := binaryCofan_inl _ (colimit.isColimit _) instance {A B : C} [MonoCoprod C] [HasBinaryCoproduct A B] : Mono (coprod.inr : B ⟶ A ⨿ B) := binaryCofan_inr _ (colimit.isColimit _)
Mathlib/CategoryTheory/Limits/MonoCoprod.lean
78
87
theorem mono_inl_iff {A B : C} {c₁ c₂ : BinaryCofan A B} (hc₁ : IsColimit c₁) (hc₂ : IsColimit c₂) : Mono c₁.inl ↔ Mono c₂.inl := by
suffices ∀ (c₁ c₂ : BinaryCofan A B) (_ : IsColimit c₁) (_ : IsColimit c₂) (_ : Mono c₁.inl), Mono c₂.inl by exact ⟨fun h₁ => this _ _ hc₁ hc₂ h₁, fun h₂ => this _ _ hc₂ hc₁ h₂⟩ intro c₁ c₂ hc₁ hc₂ intro simpa only [IsColimit.comp_coconePointUniqueUpToIso_hom] using mono_comp c₁.inl (hc₁.coconePointUniqueUpToIso hc₂).hom
8
2,980.957987
2
2
2
2,343
import Mathlib.Topology.Connected.Basic open Set Function universe u v variable {α : Type u} {β : Type v} {ι : Type*} {π : ι → Type*} [TopologicalSpace α] {s t u v : Set α} section TotallyDisconnected def IsTotallyDisconnected (s : Set α) : Prop := ∀ t, t ⊆ s → IsPreconnected t → t.Subsingleton #align is_totally_disconnected IsTotallyDisconnected theorem isTotallyDisconnected_empty : IsTotallyDisconnected (∅ : Set α) := fun _ ht _ _ x_in _ _ => (ht x_in).elim #align is_totally_disconnected_empty isTotallyDisconnected_empty theorem isTotallyDisconnected_singleton {x} : IsTotallyDisconnected ({x} : Set α) := fun _ ht _ => subsingleton_singleton.anti ht #align is_totally_disconnected_singleton isTotallyDisconnected_singleton @[mk_iff] class TotallyDisconnectedSpace (α : Type u) [TopologicalSpace α] : Prop where isTotallyDisconnected_univ : IsTotallyDisconnected (univ : Set α) #align totally_disconnected_space TotallyDisconnectedSpace theorem IsPreconnected.subsingleton [TotallyDisconnectedSpace α] {s : Set α} (h : IsPreconnected s) : s.Subsingleton := TotallyDisconnectedSpace.isTotallyDisconnected_univ s (subset_univ s) h #align is_preconnected.subsingleton IsPreconnected.subsingleton instance Pi.totallyDisconnectedSpace {α : Type*} {β : α → Type*} [∀ a, TopologicalSpace (β a)] [∀ a, TotallyDisconnectedSpace (β a)] : TotallyDisconnectedSpace (∀ a : α, β a) := ⟨fun t _ h2 => have this : ∀ a, IsPreconnected ((fun x : ∀ a, β a => x a) '' t) := fun a => h2.image (fun x => x a) (continuous_apply a).continuousOn fun x x_in y y_in => funext fun a => (this a).subsingleton ⟨x, x_in, rfl⟩ ⟨y, y_in, rfl⟩⟩ #align pi.totally_disconnected_space Pi.totallyDisconnectedSpace instance Prod.totallyDisconnectedSpace [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (α × β) := ⟨fun t _ h2 => have H1 : IsPreconnected (Prod.fst '' t) := h2.image Prod.fst continuous_fst.continuousOn have H2 : IsPreconnected (Prod.snd '' t) := h2.image Prod.snd continuous_snd.continuousOn fun x hx y hy => Prod.ext (H1.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩) (H2.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩)⟩ #align prod.totally_disconnected_space Prod.totallyDisconnectedSpace instance [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (Sum α β) := by refine ⟨fun s _ hs => ?_⟩ obtain ⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩ := Sum.isPreconnected_iff.1 hs · exact ht.subsingleton.image _ · exact ht.subsingleton.image _ instance [∀ i, TopologicalSpace (π i)] [∀ i, TotallyDisconnectedSpace (π i)] : TotallyDisconnectedSpace (Σi, π i) := by refine ⟨fun s _ hs => ?_⟩ obtain rfl | h := s.eq_empty_or_nonempty · exact subsingleton_empty · obtain ⟨a, t, ht, rfl⟩ := Sigma.isConnected_iff.1 ⟨h, hs⟩ exact ht.isPreconnected.subsingleton.image _ -- Porting note: reformulated using `Pairwise`
Mathlib/Topology/Connected/TotallyDisconnected.lean
93
104
theorem isTotallyDisconnected_of_isClopen_set {X : Type*} [TopologicalSpace X] (hX : Pairwise fun x y => ∃ (U : Set X), IsClopen U ∧ x ∈ U ∧ y ∉ U) : IsTotallyDisconnected (Set.univ : Set X) := by
rintro S - hS unfold Set.Subsingleton by_contra! h_contra rcases h_contra with ⟨x, hx, y, hy, hxy⟩ obtain ⟨U, hU, hxU, hyU⟩ := hX hxy specialize hS U Uᶜ hU.2 hU.compl.2 (fun a _ => em (a ∈ U)) ⟨x, hx, hxU⟩ ⟨y, hy, hyU⟩ rw [inter_compl_self, Set.inter_empty] at hS exact Set.not_nonempty_empty hS
9
8,103.083928
2
2
3
2,344
import Mathlib.Topology.Connected.Basic open Set Function universe u v variable {α : Type u} {β : Type v} {ι : Type*} {π : ι → Type*} [TopologicalSpace α] {s t u v : Set α} section TotallyDisconnected def IsTotallyDisconnected (s : Set α) : Prop := ∀ t, t ⊆ s → IsPreconnected t → t.Subsingleton #align is_totally_disconnected IsTotallyDisconnected theorem isTotallyDisconnected_empty : IsTotallyDisconnected (∅ : Set α) := fun _ ht _ _ x_in _ _ => (ht x_in).elim #align is_totally_disconnected_empty isTotallyDisconnected_empty theorem isTotallyDisconnected_singleton {x} : IsTotallyDisconnected ({x} : Set α) := fun _ ht _ => subsingleton_singleton.anti ht #align is_totally_disconnected_singleton isTotallyDisconnected_singleton @[mk_iff] class TotallyDisconnectedSpace (α : Type u) [TopologicalSpace α] : Prop where isTotallyDisconnected_univ : IsTotallyDisconnected (univ : Set α) #align totally_disconnected_space TotallyDisconnectedSpace theorem IsPreconnected.subsingleton [TotallyDisconnectedSpace α] {s : Set α} (h : IsPreconnected s) : s.Subsingleton := TotallyDisconnectedSpace.isTotallyDisconnected_univ s (subset_univ s) h #align is_preconnected.subsingleton IsPreconnected.subsingleton instance Pi.totallyDisconnectedSpace {α : Type*} {β : α → Type*} [∀ a, TopologicalSpace (β a)] [∀ a, TotallyDisconnectedSpace (β a)] : TotallyDisconnectedSpace (∀ a : α, β a) := ⟨fun t _ h2 => have this : ∀ a, IsPreconnected ((fun x : ∀ a, β a => x a) '' t) := fun a => h2.image (fun x => x a) (continuous_apply a).continuousOn fun x x_in y y_in => funext fun a => (this a).subsingleton ⟨x, x_in, rfl⟩ ⟨y, y_in, rfl⟩⟩ #align pi.totally_disconnected_space Pi.totallyDisconnectedSpace instance Prod.totallyDisconnectedSpace [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (α × β) := ⟨fun t _ h2 => have H1 : IsPreconnected (Prod.fst '' t) := h2.image Prod.fst continuous_fst.continuousOn have H2 : IsPreconnected (Prod.snd '' t) := h2.image Prod.snd continuous_snd.continuousOn fun x hx y hy => Prod.ext (H1.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩) (H2.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩)⟩ #align prod.totally_disconnected_space Prod.totallyDisconnectedSpace instance [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (Sum α β) := by refine ⟨fun s _ hs => ?_⟩ obtain ⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩ := Sum.isPreconnected_iff.1 hs · exact ht.subsingleton.image _ · exact ht.subsingleton.image _ instance [∀ i, TopologicalSpace (π i)] [∀ i, TotallyDisconnectedSpace (π i)] : TotallyDisconnectedSpace (Σi, π i) := by refine ⟨fun s _ hs => ?_⟩ obtain rfl | h := s.eq_empty_or_nonempty · exact subsingleton_empty · obtain ⟨a, t, ht, rfl⟩ := Sigma.isConnected_iff.1 ⟨h, hs⟩ exact ht.isPreconnected.subsingleton.image _ -- Porting note: reformulated using `Pairwise` theorem isTotallyDisconnected_of_isClopen_set {X : Type*} [TopologicalSpace X] (hX : Pairwise fun x y => ∃ (U : Set X), IsClopen U ∧ x ∈ U ∧ y ∉ U) : IsTotallyDisconnected (Set.univ : Set X) := by rintro S - hS unfold Set.Subsingleton by_contra! h_contra rcases h_contra with ⟨x, hx, y, hy, hxy⟩ obtain ⟨U, hU, hxU, hyU⟩ := hX hxy specialize hS U Uᶜ hU.2 hU.compl.2 (fun a _ => em (a ∈ U)) ⟨x, hx, hxU⟩ ⟨y, hy, hyU⟩ rw [inter_compl_self, Set.inter_empty] at hS exact Set.not_nonempty_empty hS #align is_totally_disconnected_of_clopen_set isTotallyDisconnected_of_isClopen_set
Mathlib/Topology/Connected/TotallyDisconnected.lean
108
119
theorem totallyDisconnectedSpace_iff_connectedComponent_subsingleton : TotallyDisconnectedSpace α ↔ ∀ x : α, (connectedComponent x).Subsingleton := by
constructor · intro h x apply h.1 · exact subset_univ _ exact isPreconnected_connectedComponent intro h; constructor intro s s_sub hs rcases eq_empty_or_nonempty s with (rfl | ⟨x, x_in⟩) · exact subsingleton_empty · exact (h x).anti (hs.subset_connectedComponent x_in)
10
22,026.465795
2
2
3
2,344
import Mathlib.Topology.Connected.Basic open Set Function universe u v variable {α : Type u} {β : Type v} {ι : Type*} {π : ι → Type*} [TopologicalSpace α] {s t u v : Set α} section TotallyDisconnected def IsTotallyDisconnected (s : Set α) : Prop := ∀ t, t ⊆ s → IsPreconnected t → t.Subsingleton #align is_totally_disconnected IsTotallyDisconnected theorem isTotallyDisconnected_empty : IsTotallyDisconnected (∅ : Set α) := fun _ ht _ _ x_in _ _ => (ht x_in).elim #align is_totally_disconnected_empty isTotallyDisconnected_empty theorem isTotallyDisconnected_singleton {x} : IsTotallyDisconnected ({x} : Set α) := fun _ ht _ => subsingleton_singleton.anti ht #align is_totally_disconnected_singleton isTotallyDisconnected_singleton @[mk_iff] class TotallyDisconnectedSpace (α : Type u) [TopologicalSpace α] : Prop where isTotallyDisconnected_univ : IsTotallyDisconnected (univ : Set α) #align totally_disconnected_space TotallyDisconnectedSpace theorem IsPreconnected.subsingleton [TotallyDisconnectedSpace α] {s : Set α} (h : IsPreconnected s) : s.Subsingleton := TotallyDisconnectedSpace.isTotallyDisconnected_univ s (subset_univ s) h #align is_preconnected.subsingleton IsPreconnected.subsingleton instance Pi.totallyDisconnectedSpace {α : Type*} {β : α → Type*} [∀ a, TopologicalSpace (β a)] [∀ a, TotallyDisconnectedSpace (β a)] : TotallyDisconnectedSpace (∀ a : α, β a) := ⟨fun t _ h2 => have this : ∀ a, IsPreconnected ((fun x : ∀ a, β a => x a) '' t) := fun a => h2.image (fun x => x a) (continuous_apply a).continuousOn fun x x_in y y_in => funext fun a => (this a).subsingleton ⟨x, x_in, rfl⟩ ⟨y, y_in, rfl⟩⟩ #align pi.totally_disconnected_space Pi.totallyDisconnectedSpace instance Prod.totallyDisconnectedSpace [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (α × β) := ⟨fun t _ h2 => have H1 : IsPreconnected (Prod.fst '' t) := h2.image Prod.fst continuous_fst.continuousOn have H2 : IsPreconnected (Prod.snd '' t) := h2.image Prod.snd continuous_snd.continuousOn fun x hx y hy => Prod.ext (H1.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩) (H2.subsingleton ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩)⟩ #align prod.totally_disconnected_space Prod.totallyDisconnectedSpace instance [TopologicalSpace β] [TotallyDisconnectedSpace α] [TotallyDisconnectedSpace β] : TotallyDisconnectedSpace (Sum α β) := by refine ⟨fun s _ hs => ?_⟩ obtain ⟨t, ht, rfl⟩ | ⟨t, ht, rfl⟩ := Sum.isPreconnected_iff.1 hs · exact ht.subsingleton.image _ · exact ht.subsingleton.image _ instance [∀ i, TopologicalSpace (π i)] [∀ i, TotallyDisconnectedSpace (π i)] : TotallyDisconnectedSpace (Σi, π i) := by refine ⟨fun s _ hs => ?_⟩ obtain rfl | h := s.eq_empty_or_nonempty · exact subsingleton_empty · obtain ⟨a, t, ht, rfl⟩ := Sigma.isConnected_iff.1 ⟨h, hs⟩ exact ht.isPreconnected.subsingleton.image _ -- Porting note: reformulated using `Pairwise` theorem isTotallyDisconnected_of_isClopen_set {X : Type*} [TopologicalSpace X] (hX : Pairwise fun x y => ∃ (U : Set X), IsClopen U ∧ x ∈ U ∧ y ∉ U) : IsTotallyDisconnected (Set.univ : Set X) := by rintro S - hS unfold Set.Subsingleton by_contra! h_contra rcases h_contra with ⟨x, hx, y, hy, hxy⟩ obtain ⟨U, hU, hxU, hyU⟩ := hX hxy specialize hS U Uᶜ hU.2 hU.compl.2 (fun a _ => em (a ∈ U)) ⟨x, hx, hxU⟩ ⟨y, hy, hyU⟩ rw [inter_compl_self, Set.inter_empty] at hS exact Set.not_nonempty_empty hS #align is_totally_disconnected_of_clopen_set isTotallyDisconnected_of_isClopen_set theorem totallyDisconnectedSpace_iff_connectedComponent_subsingleton : TotallyDisconnectedSpace α ↔ ∀ x : α, (connectedComponent x).Subsingleton := by constructor · intro h x apply h.1 · exact subset_univ _ exact isPreconnected_connectedComponent intro h; constructor intro s s_sub hs rcases eq_empty_or_nonempty s with (rfl | ⟨x, x_in⟩) · exact subsingleton_empty · exact (h x).anti (hs.subset_connectedComponent x_in) #align totally_disconnected_space_iff_connected_component_subsingleton totallyDisconnectedSpace_iff_connectedComponent_subsingleton
Mathlib/Topology/Connected/TotallyDisconnected.lean
123
128
theorem totallyDisconnectedSpace_iff_connectedComponent_singleton : TotallyDisconnectedSpace α ↔ ∀ x : α, connectedComponent x = {x} := by
rw [totallyDisconnectedSpace_iff_connectedComponent_subsingleton] refine forall_congr' fun x => ?_ rw [subsingleton_iff_singleton] exact mem_connectedComponent
4
54.59815
2
2
3
2,344
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Set.Pointwise.Iterate import Mathlib.Dynamics.Ergodic.Ergodic import Mathlib.MeasureTheory.Covering.DensityTheorem import Mathlib.MeasureTheory.Group.AddCircle import Mathlib.MeasureTheory.Measure.Haar.Unique #align_import dynamics.ergodic.add_circle from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655" open Set Function MeasureTheory MeasureTheory.Measure Filter Metric open scoped MeasureTheory NNReal ENNReal Topology Pointwise namespace AddCircle variable {T : ℝ} [hT : Fact (0 < T)]
Mathlib/Dynamics/Ergodic/AddCircle.lean
45
101
theorem ae_empty_or_univ_of_forall_vadd_ae_eq_self {s : Set <| AddCircle T} (hs : NullMeasurableSet s volume) {ι : Type*} {l : Filter ι} [l.NeBot] {u : ι → AddCircle T} (hu₁ : ∀ i, (u i +ᵥ s : Set _) =ᵐ[volume] s) (hu₂ : Tendsto (addOrderOf ∘ u) l atTop) : s =ᵐ[volume] (∅ : Set <| AddCircle T) ∨ s =ᵐ[volume] univ := by
/- Sketch of proof: Assume `T = 1` for simplicity and let `μ` be the Haar measure. We may assume `s` has positive measure since otherwise there is nothing to prove. In this case, by Lebesgue's density theorem, there exists a point `d` of positive density. Let `Iⱼ` be the sequence of closed balls about `d` of diameter `1 / nⱼ` where `nⱼ` is the additive order of `uⱼ`. Since `d` has positive density we must have `μ (s ∩ Iⱼ) / μ Iⱼ → 1` along `l`. However since `s` is invariant under the action of `uⱼ` and since `Iⱼ` is a fundamental domain for this action, we must have `μ (s ∩ Iⱼ) = nⱼ * μ s = (μ Iⱼ) * μ s`. We thus have `μ s → 1` and thus `μ s = 1`. -/ set μ := (volume : Measure <| AddCircle T) set n : ι → ℕ := addOrderOf ∘ u have hT₀ : 0 < T := hT.out have hT₁ : ENNReal.ofReal T ≠ 0 := by simpa rw [ae_eq_empty, ae_eq_univ_iff_measure_eq hs, AddCircle.measure_univ] rcases eq_or_ne (μ s) 0 with h | h; · exact Or.inl h right obtain ⟨d, -, hd⟩ : ∃ d, d ∈ s ∧ ∀ {ι'} {l : Filter ι'} (w : ι' → AddCircle T) (δ : ι' → ℝ), Tendsto δ l (𝓝[>] 0) → (∀ᶠ j in l, d ∈ closedBall (w j) (1 * δ j)) → Tendsto (fun j => μ (s ∩ closedBall (w j) (δ j)) / μ (closedBall (w j) (δ j))) l (𝓝 1) := exists_mem_of_measure_ne_zero_of_ae h (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ s 1) let I : ι → Set (AddCircle T) := fun j => closedBall d (T / (2 * ↑(n j))) replace hd : Tendsto (fun j => μ (s ∩ I j) / μ (I j)) l (𝓝 1) := by let δ : ι → ℝ := fun j => T / (2 * ↑(n j)) have hδ₀ : ∀ᶠ j in l, 0 < δ j := (hu₂.eventually_gt_atTop 0).mono fun j hj => div_pos hT₀ <| by positivity have hδ₁ : Tendsto δ l (𝓝[>] 0) := by refine tendsto_nhdsWithin_iff.mpr ⟨?_, hδ₀⟩ replace hu₂ : Tendsto (fun j => T⁻¹ * 2 * n j) l atTop := (tendsto_natCast_atTop_iff.mpr hu₂).const_mul_atTop (by positivity : 0 < T⁻¹ * 2) convert hu₂.inv_tendsto_atTop ext j simp only [δ, Pi.inv_apply, mul_inv_rev, inv_inv, div_eq_inv_mul, ← mul_assoc] have hw : ∀ᶠ j in l, d ∈ closedBall d (1 * δ j) := hδ₀.mono fun j hj => by simp only [comp_apply, one_mul, mem_closedBall, dist_self] apply hj.le exact hd _ δ hδ₁ hw suffices ∀ᶠ j in l, μ (s ∩ I j) / μ (I j) = μ s / ENNReal.ofReal T by replace hd := hd.congr' this rwa [tendsto_const_nhds_iff, ENNReal.div_eq_one_iff hT₁ ENNReal.ofReal_ne_top] at hd refine (hu₂.eventually_gt_atTop 0).mono fun j hj => ?_ have : addOrderOf (u j) = n j := rfl have huj : IsOfFinAddOrder (u j) := addOrderOf_pos_iff.mp hj have huj' : 1 ≤ (↑(n j) : ℝ) := by norm_cast have hI₀ : μ (I j) ≠ 0 := (measure_closedBall_pos _ d <| by positivity).ne.symm have hI₁ : μ (I j) ≠ ⊤ := measure_ne_top _ _ have hI₂ : μ (I j) * ↑(n j) = ENNReal.ofReal T := by rw [volume_closedBall, mul_div, mul_div_mul_left T _ two_ne_zero, min_eq_right (div_le_self hT₀.le huj'), mul_comm, ← nsmul_eq_mul, ← ENNReal.ofReal_nsmul, nsmul_eq_mul, mul_div_cancel₀] exact Nat.cast_ne_zero.mpr hj.ne' rw [ENNReal.div_eq_div_iff hT₁ ENNReal.ofReal_ne_top hI₀ hI₁, volume_of_add_preimage_eq s _ (u j) d huj (hu₁ j) closedBall_ae_eq_ball, nsmul_eq_mul, ← mul_assoc, this, hI₂]
53
104,137,594,330,290,870,000,000
2
2
2
2,345
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Set.Pointwise.Iterate import Mathlib.Dynamics.Ergodic.Ergodic import Mathlib.MeasureTheory.Covering.DensityTheorem import Mathlib.MeasureTheory.Group.AddCircle import Mathlib.MeasureTheory.Measure.Haar.Unique #align_import dynamics.ergodic.add_circle from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655" open Set Function MeasureTheory MeasureTheory.Measure Filter Metric open scoped MeasureTheory NNReal ENNReal Topology Pointwise namespace AddCircle variable {T : ℝ} [hT : Fact (0 < T)] theorem ae_empty_or_univ_of_forall_vadd_ae_eq_self {s : Set <| AddCircle T} (hs : NullMeasurableSet s volume) {ι : Type*} {l : Filter ι} [l.NeBot] {u : ι → AddCircle T} (hu₁ : ∀ i, (u i +ᵥ s : Set _) =ᵐ[volume] s) (hu₂ : Tendsto (addOrderOf ∘ u) l atTop) : s =ᵐ[volume] (∅ : Set <| AddCircle T) ∨ s =ᵐ[volume] univ := by set μ := (volume : Measure <| AddCircle T) set n : ι → ℕ := addOrderOf ∘ u have hT₀ : 0 < T := hT.out have hT₁ : ENNReal.ofReal T ≠ 0 := by simpa rw [ae_eq_empty, ae_eq_univ_iff_measure_eq hs, AddCircle.measure_univ] rcases eq_or_ne (μ s) 0 with h | h; · exact Or.inl h right obtain ⟨d, -, hd⟩ : ∃ d, d ∈ s ∧ ∀ {ι'} {l : Filter ι'} (w : ι' → AddCircle T) (δ : ι' → ℝ), Tendsto δ l (𝓝[>] 0) → (∀ᶠ j in l, d ∈ closedBall (w j) (1 * δ j)) → Tendsto (fun j => μ (s ∩ closedBall (w j) (δ j)) / μ (closedBall (w j) (δ j))) l (𝓝 1) := exists_mem_of_measure_ne_zero_of_ae h (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ s 1) let I : ι → Set (AddCircle T) := fun j => closedBall d (T / (2 * ↑(n j))) replace hd : Tendsto (fun j => μ (s ∩ I j) / μ (I j)) l (𝓝 1) := by let δ : ι → ℝ := fun j => T / (2 * ↑(n j)) have hδ₀ : ∀ᶠ j in l, 0 < δ j := (hu₂.eventually_gt_atTop 0).mono fun j hj => div_pos hT₀ <| by positivity have hδ₁ : Tendsto δ l (𝓝[>] 0) := by refine tendsto_nhdsWithin_iff.mpr ⟨?_, hδ₀⟩ replace hu₂ : Tendsto (fun j => T⁻¹ * 2 * n j) l atTop := (tendsto_natCast_atTop_iff.mpr hu₂).const_mul_atTop (by positivity : 0 < T⁻¹ * 2) convert hu₂.inv_tendsto_atTop ext j simp only [δ, Pi.inv_apply, mul_inv_rev, inv_inv, div_eq_inv_mul, ← mul_assoc] have hw : ∀ᶠ j in l, d ∈ closedBall d (1 * δ j) := hδ₀.mono fun j hj => by simp only [comp_apply, one_mul, mem_closedBall, dist_self] apply hj.le exact hd _ δ hδ₁ hw suffices ∀ᶠ j in l, μ (s ∩ I j) / μ (I j) = μ s / ENNReal.ofReal T by replace hd := hd.congr' this rwa [tendsto_const_nhds_iff, ENNReal.div_eq_one_iff hT₁ ENNReal.ofReal_ne_top] at hd refine (hu₂.eventually_gt_atTop 0).mono fun j hj => ?_ have : addOrderOf (u j) = n j := rfl have huj : IsOfFinAddOrder (u j) := addOrderOf_pos_iff.mp hj have huj' : 1 ≤ (↑(n j) : ℝ) := by norm_cast have hI₀ : μ (I j) ≠ 0 := (measure_closedBall_pos _ d <| by positivity).ne.symm have hI₁ : μ (I j) ≠ ⊤ := measure_ne_top _ _ have hI₂ : μ (I j) * ↑(n j) = ENNReal.ofReal T := by rw [volume_closedBall, mul_div, mul_div_mul_left T _ two_ne_zero, min_eq_right (div_le_self hT₀.le huj'), mul_comm, ← nsmul_eq_mul, ← ENNReal.ofReal_nsmul, nsmul_eq_mul, mul_div_cancel₀] exact Nat.cast_ne_zero.mpr hj.ne' rw [ENNReal.div_eq_div_iff hT₁ ENNReal.ofReal_ne_top hI₀ hI₁, volume_of_add_preimage_eq s _ (u j) d huj (hu₁ j) closedBall_ae_eq_ball, nsmul_eq_mul, ← mul_assoc, this, hI₂] #align add_circle.ae_empty_or_univ_of_forall_vadd_ae_eq_self AddCircle.ae_empty_or_univ_of_forall_vadd_ae_eq_self
Mathlib/Dynamics/Ergodic/AddCircle.lean
104
120
theorem ergodic_zsmul {n : ℤ} (hn : 1 < |n|) : Ergodic fun y : AddCircle T => n • y := { measurePreserving_zsmul volume (abs_pos.mp <| lt_trans zero_lt_one hn) with ae_empty_or_univ := fun s hs hs' => by let u : ℕ → AddCircle T := fun j => ↑((↑1 : ℝ) / ↑(n.natAbs ^ j) * T) replace hn : 1 < n.natAbs := by
rwa [Int.abs_eq_natAbs, Nat.one_lt_cast] at hn have hu₀ : ∀ j, addOrderOf (u j) = n.natAbs ^ j := fun j => by convert addOrderOf_div_of_gcd_eq_one (p := T) (m := 1) (pow_pos (pos_of_gt hn) j) (gcd_one_left _) norm_cast have hnu : ∀ j, n ^ j • u j = 0 := fun j => by rw [← addOrderOf_dvd_iff_zsmul_eq_zero, hu₀, Int.natCast_pow, Int.natCast_natAbs, ← abs_pow, abs_dvd] have hu₁ : ∀ j, (u j +ᵥ s : Set _) =ᵐ[volume] s := fun j => by rw [vadd_eq_self_of_preimage_zsmul_eq_self hs' (hnu j)] have hu₂ : Tendsto (fun j => addOrderOf <| u j) atTop atTop := by simp_rw [hu₀]; exact Nat.tendsto_pow_atTop_atTop_of_one_lt hn exact ae_empty_or_univ_of_forall_vadd_ae_eq_self hs.nullMeasurableSet hu₁ hu₂ }
13
442,413.392009
2
2
2
2,345
import Mathlib.CategoryTheory.Comma.Over import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Yoneda import Mathlib.Data.Set.Lattice import Mathlib.Order.CompleteLattice #align_import category_theory.sites.sieves from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory open Category Limits variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) variable {X Y Z : C} (f : Y ⟶ X) def Presieve (X : C) := ∀ ⦃Y⦄, Set (Y ⟶ X)-- deriving CompleteLattice #align category_theory.presieve CategoryTheory.Presieve instance : CompleteLattice (Presieve X) := by dsimp [Presieve] infer_instance namespace Presieve noncomputable instance : Inhabited (Presieve X) := ⟨⊤⟩ abbrev category {X : C} (P : Presieve X) := FullSubcategory fun f : Over X => P f.hom abbrev categoryMk {X : C} (P : Presieve X) {Y : C} (f : Y ⟶ X) (hf : P f) : P.category := ⟨Over.mk f, hf⟩ abbrev diagram (S : Presieve X) : S.category ⥤ C := fullSubcategoryInclusion _ ⋙ Over.forget X #align category_theory.presieve.diagram CategoryTheory.Presieve.diagram abbrev cocone (S : Presieve X) : Cocone S.diagram := (Over.forgetCocone X).whisker (fullSubcategoryInclusion _) #align category_theory.presieve.cocone CategoryTheory.Presieve.cocone def bind (S : Presieve X) (R : ∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y) : Presieve X := fun Z h => ∃ (Y : C) (g : Z ⟶ Y) (f : Y ⟶ X) (H : S f), R H g ∧ g ≫ f = h #align category_theory.presieve.bind CategoryTheory.Presieve.bind @[simp] theorem bind_comp {S : Presieve X} {R : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y} {g : Z ⟶ Y} (h₁ : S f) (h₂ : R h₁ g) : bind S R (g ≫ f) := ⟨_, _, _, h₁, h₂, rfl⟩ #align category_theory.presieve.bind_comp CategoryTheory.Presieve.bind_comp -- Porting note: it seems the definition of `Presieve` must be unfolded in order to define -- this inductive type, it was thus renamed `singleton'` -- Note we can't make this into `HasSingleton` because of the out-param. inductive singleton' : ⦃Y : C⦄ → (Y ⟶ X) → Prop | mk : singleton' f def singleton : Presieve X := singleton' f lemma singleton.mk {f : Y ⟶ X} : singleton f f := singleton'.mk #align category_theory.presieve.singleton CategoryTheory.Presieve.singleton @[simp]
Mathlib/CategoryTheory/Sites/Sieves.lean
104
109
theorem singleton_eq_iff_domain (f g : Y ⟶ X) : singleton f g ↔ f = g := by
constructor · rintro ⟨a, rfl⟩ rfl · rintro rfl apply singleton.mk
5
148.413159
2
2
5
2,346
import Mathlib.CategoryTheory.Comma.Over import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Yoneda import Mathlib.Data.Set.Lattice import Mathlib.Order.CompleteLattice #align_import category_theory.sites.sieves from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory open Category Limits variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) variable {X Y Z : C} (f : Y ⟶ X) def Presieve (X : C) := ∀ ⦃Y⦄, Set (Y ⟶ X)-- deriving CompleteLattice #align category_theory.presieve CategoryTheory.Presieve instance : CompleteLattice (Presieve X) := by dsimp [Presieve] infer_instance namespace Presieve noncomputable instance : Inhabited (Presieve X) := ⟨⊤⟩ abbrev category {X : C} (P : Presieve X) := FullSubcategory fun f : Over X => P f.hom abbrev categoryMk {X : C} (P : Presieve X) {Y : C} (f : Y ⟶ X) (hf : P f) : P.category := ⟨Over.mk f, hf⟩ abbrev diagram (S : Presieve X) : S.category ⥤ C := fullSubcategoryInclusion _ ⋙ Over.forget X #align category_theory.presieve.diagram CategoryTheory.Presieve.diagram abbrev cocone (S : Presieve X) : Cocone S.diagram := (Over.forgetCocone X).whisker (fullSubcategoryInclusion _) #align category_theory.presieve.cocone CategoryTheory.Presieve.cocone def bind (S : Presieve X) (R : ∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y) : Presieve X := fun Z h => ∃ (Y : C) (g : Z ⟶ Y) (f : Y ⟶ X) (H : S f), R H g ∧ g ≫ f = h #align category_theory.presieve.bind CategoryTheory.Presieve.bind @[simp] theorem bind_comp {S : Presieve X} {R : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y} {g : Z ⟶ Y} (h₁ : S f) (h₂ : R h₁ g) : bind S R (g ≫ f) := ⟨_, _, _, h₁, h₂, rfl⟩ #align category_theory.presieve.bind_comp CategoryTheory.Presieve.bind_comp -- Porting note: it seems the definition of `Presieve` must be unfolded in order to define -- this inductive type, it was thus renamed `singleton'` -- Note we can't make this into `HasSingleton` because of the out-param. inductive singleton' : ⦃Y : C⦄ → (Y ⟶ X) → Prop | mk : singleton' f def singleton : Presieve X := singleton' f lemma singleton.mk {f : Y ⟶ X} : singleton f f := singleton'.mk #align category_theory.presieve.singleton CategoryTheory.Presieve.singleton @[simp] theorem singleton_eq_iff_domain (f g : Y ⟶ X) : singleton f g ↔ f = g := by constructor · rintro ⟨a, rfl⟩ rfl · rintro rfl apply singleton.mk #align category_theory.presieve.singleton_eq_iff_domain CategoryTheory.Presieve.singleton_eq_iff_domain theorem singleton_self : singleton f f := singleton.mk #align category_theory.presieve.singleton_self CategoryTheory.Presieve.singleton_self inductive pullbackArrows [HasPullbacks C] (R : Presieve X) : Presieve Y | mk (Z : C) (h : Z ⟶ X) : R h → pullbackArrows _ (pullback.snd : pullback h f ⟶ Y) #align category_theory.presieve.pullback_arrows CategoryTheory.Presieve.pullbackArrows
Mathlib/CategoryTheory/Sites/Sieves.lean
125
133
theorem pullback_singleton [HasPullbacks C] (g : Z ⟶ X) : pullbackArrows f (singleton g) = singleton (pullback.snd : pullback g f ⟶ _) := by
funext W ext h constructor · rintro ⟨W, _, _, _⟩ exact singleton.mk · rintro ⟨_⟩ exact pullbackArrows.mk Z g singleton.mk
7
1,096.633158
2
2
5
2,346
import Mathlib.CategoryTheory.Comma.Over import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Yoneda import Mathlib.Data.Set.Lattice import Mathlib.Order.CompleteLattice #align_import category_theory.sites.sieves from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory open Category Limits variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) variable {X Y Z : C} (f : Y ⟶ X) def Presieve (X : C) := ∀ ⦃Y⦄, Set (Y ⟶ X)-- deriving CompleteLattice #align category_theory.presieve CategoryTheory.Presieve instance : CompleteLattice (Presieve X) := by dsimp [Presieve] infer_instance namespace Presieve noncomputable instance : Inhabited (Presieve X) := ⟨⊤⟩ abbrev category {X : C} (P : Presieve X) := FullSubcategory fun f : Over X => P f.hom abbrev categoryMk {X : C} (P : Presieve X) {Y : C} (f : Y ⟶ X) (hf : P f) : P.category := ⟨Over.mk f, hf⟩ abbrev diagram (S : Presieve X) : S.category ⥤ C := fullSubcategoryInclusion _ ⋙ Over.forget X #align category_theory.presieve.diagram CategoryTheory.Presieve.diagram abbrev cocone (S : Presieve X) : Cocone S.diagram := (Over.forgetCocone X).whisker (fullSubcategoryInclusion _) #align category_theory.presieve.cocone CategoryTheory.Presieve.cocone def bind (S : Presieve X) (R : ∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y) : Presieve X := fun Z h => ∃ (Y : C) (g : Z ⟶ Y) (f : Y ⟶ X) (H : S f), R H g ∧ g ≫ f = h #align category_theory.presieve.bind CategoryTheory.Presieve.bind @[simp] theorem bind_comp {S : Presieve X} {R : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y} {g : Z ⟶ Y} (h₁ : S f) (h₂ : R h₁ g) : bind S R (g ≫ f) := ⟨_, _, _, h₁, h₂, rfl⟩ #align category_theory.presieve.bind_comp CategoryTheory.Presieve.bind_comp -- Porting note: it seems the definition of `Presieve` must be unfolded in order to define -- this inductive type, it was thus renamed `singleton'` -- Note we can't make this into `HasSingleton` because of the out-param. inductive singleton' : ⦃Y : C⦄ → (Y ⟶ X) → Prop | mk : singleton' f def singleton : Presieve X := singleton' f lemma singleton.mk {f : Y ⟶ X} : singleton f f := singleton'.mk #align category_theory.presieve.singleton CategoryTheory.Presieve.singleton @[simp] theorem singleton_eq_iff_domain (f g : Y ⟶ X) : singleton f g ↔ f = g := by constructor · rintro ⟨a, rfl⟩ rfl · rintro rfl apply singleton.mk #align category_theory.presieve.singleton_eq_iff_domain CategoryTheory.Presieve.singleton_eq_iff_domain theorem singleton_self : singleton f f := singleton.mk #align category_theory.presieve.singleton_self CategoryTheory.Presieve.singleton_self inductive pullbackArrows [HasPullbacks C] (R : Presieve X) : Presieve Y | mk (Z : C) (h : Z ⟶ X) : R h → pullbackArrows _ (pullback.snd : pullback h f ⟶ Y) #align category_theory.presieve.pullback_arrows CategoryTheory.Presieve.pullbackArrows theorem pullback_singleton [HasPullbacks C] (g : Z ⟶ X) : pullbackArrows f (singleton g) = singleton (pullback.snd : pullback g f ⟶ _) := by funext W ext h constructor · rintro ⟨W, _, _, _⟩ exact singleton.mk · rintro ⟨_⟩ exact pullbackArrows.mk Z g singleton.mk #align category_theory.presieve.pullback_singleton CategoryTheory.Presieve.pullback_singleton inductive ofArrows {ι : Type*} (Y : ι → C) (f : ∀ i, Y i ⟶ X) : Presieve X | mk (i : ι) : ofArrows _ _ (f i) #align category_theory.presieve.of_arrows CategoryTheory.Presieve.ofArrows
Mathlib/CategoryTheory/Sites/Sieves.lean
141
148
theorem ofArrows_pUnit : (ofArrows _ fun _ : PUnit => f) = singleton f := by
funext Y ext g constructor · rintro ⟨_⟩ apply singleton.mk · rintro ⟨_⟩ exact ofArrows.mk PUnit.unit
7
1,096.633158
2
2
5
2,346
import Mathlib.CategoryTheory.Comma.Over import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Yoneda import Mathlib.Data.Set.Lattice import Mathlib.Order.CompleteLattice #align_import category_theory.sites.sieves from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory open Category Limits variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) variable {X Y Z : C} (f : Y ⟶ X) def Presieve (X : C) := ∀ ⦃Y⦄, Set (Y ⟶ X)-- deriving CompleteLattice #align category_theory.presieve CategoryTheory.Presieve instance : CompleteLattice (Presieve X) := by dsimp [Presieve] infer_instance namespace Presieve noncomputable instance : Inhabited (Presieve X) := ⟨⊤⟩ abbrev category {X : C} (P : Presieve X) := FullSubcategory fun f : Over X => P f.hom abbrev categoryMk {X : C} (P : Presieve X) {Y : C} (f : Y ⟶ X) (hf : P f) : P.category := ⟨Over.mk f, hf⟩ abbrev diagram (S : Presieve X) : S.category ⥤ C := fullSubcategoryInclusion _ ⋙ Over.forget X #align category_theory.presieve.diagram CategoryTheory.Presieve.diagram abbrev cocone (S : Presieve X) : Cocone S.diagram := (Over.forgetCocone X).whisker (fullSubcategoryInclusion _) #align category_theory.presieve.cocone CategoryTheory.Presieve.cocone def bind (S : Presieve X) (R : ∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y) : Presieve X := fun Z h => ∃ (Y : C) (g : Z ⟶ Y) (f : Y ⟶ X) (H : S f), R H g ∧ g ≫ f = h #align category_theory.presieve.bind CategoryTheory.Presieve.bind @[simp] theorem bind_comp {S : Presieve X} {R : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y} {g : Z ⟶ Y} (h₁ : S f) (h₂ : R h₁ g) : bind S R (g ≫ f) := ⟨_, _, _, h₁, h₂, rfl⟩ #align category_theory.presieve.bind_comp CategoryTheory.Presieve.bind_comp -- Porting note: it seems the definition of `Presieve` must be unfolded in order to define -- this inductive type, it was thus renamed `singleton'` -- Note we can't make this into `HasSingleton` because of the out-param. inductive singleton' : ⦃Y : C⦄ → (Y ⟶ X) → Prop | mk : singleton' f def singleton : Presieve X := singleton' f lemma singleton.mk {f : Y ⟶ X} : singleton f f := singleton'.mk #align category_theory.presieve.singleton CategoryTheory.Presieve.singleton @[simp] theorem singleton_eq_iff_domain (f g : Y ⟶ X) : singleton f g ↔ f = g := by constructor · rintro ⟨a, rfl⟩ rfl · rintro rfl apply singleton.mk #align category_theory.presieve.singleton_eq_iff_domain CategoryTheory.Presieve.singleton_eq_iff_domain theorem singleton_self : singleton f f := singleton.mk #align category_theory.presieve.singleton_self CategoryTheory.Presieve.singleton_self inductive pullbackArrows [HasPullbacks C] (R : Presieve X) : Presieve Y | mk (Z : C) (h : Z ⟶ X) : R h → pullbackArrows _ (pullback.snd : pullback h f ⟶ Y) #align category_theory.presieve.pullback_arrows CategoryTheory.Presieve.pullbackArrows theorem pullback_singleton [HasPullbacks C] (g : Z ⟶ X) : pullbackArrows f (singleton g) = singleton (pullback.snd : pullback g f ⟶ _) := by funext W ext h constructor · rintro ⟨W, _, _, _⟩ exact singleton.mk · rintro ⟨_⟩ exact pullbackArrows.mk Z g singleton.mk #align category_theory.presieve.pullback_singleton CategoryTheory.Presieve.pullback_singleton inductive ofArrows {ι : Type*} (Y : ι → C) (f : ∀ i, Y i ⟶ X) : Presieve X | mk (i : ι) : ofArrows _ _ (f i) #align category_theory.presieve.of_arrows CategoryTheory.Presieve.ofArrows theorem ofArrows_pUnit : (ofArrows _ fun _ : PUnit => f) = singleton f := by funext Y ext g constructor · rintro ⟨_⟩ apply singleton.mk · rintro ⟨_⟩ exact ofArrows.mk PUnit.unit #align category_theory.presieve.of_arrows_punit CategoryTheory.Presieve.ofArrows_pUnit
Mathlib/CategoryTheory/Sites/Sieves.lean
151
161
theorem ofArrows_pullback [HasPullbacks C] {ι : Type*} (Z : ι → C) (g : ∀ i : ι, Z i ⟶ X) : (ofArrows (fun i => pullback (g i) f) fun i => pullback.snd) = pullbackArrows f (ofArrows Z g) := by
funext T ext h constructor · rintro ⟨hk⟩ exact pullbackArrows.mk _ _ (ofArrows.mk hk) · rintro ⟨W, k, hk₁⟩ cases' hk₁ with i hi apply ofArrows.mk
8
2,980.957987
2
2
5
2,346
import Mathlib.CategoryTheory.Comma.Over import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Yoneda import Mathlib.Data.Set.Lattice import Mathlib.Order.CompleteLattice #align_import category_theory.sites.sieves from "leanprover-community/mathlib"@"239d882c4fb58361ee8b3b39fb2091320edef10a" universe v₁ v₂ v₃ u₁ u₂ u₃ namespace CategoryTheory open Category Limits variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) variable {X Y Z : C} (f : Y ⟶ X) def Presieve (X : C) := ∀ ⦃Y⦄, Set (Y ⟶ X)-- deriving CompleteLattice #align category_theory.presieve CategoryTheory.Presieve instance : CompleteLattice (Presieve X) := by dsimp [Presieve] infer_instance namespace Presieve noncomputable instance : Inhabited (Presieve X) := ⟨⊤⟩ abbrev category {X : C} (P : Presieve X) := FullSubcategory fun f : Over X => P f.hom abbrev categoryMk {X : C} (P : Presieve X) {Y : C} (f : Y ⟶ X) (hf : P f) : P.category := ⟨Over.mk f, hf⟩ abbrev diagram (S : Presieve X) : S.category ⥤ C := fullSubcategoryInclusion _ ⋙ Over.forget X #align category_theory.presieve.diagram CategoryTheory.Presieve.diagram abbrev cocone (S : Presieve X) : Cocone S.diagram := (Over.forgetCocone X).whisker (fullSubcategoryInclusion _) #align category_theory.presieve.cocone CategoryTheory.Presieve.cocone def bind (S : Presieve X) (R : ∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y) : Presieve X := fun Z h => ∃ (Y : C) (g : Z ⟶ Y) (f : Y ⟶ X) (H : S f), R H g ∧ g ≫ f = h #align category_theory.presieve.bind CategoryTheory.Presieve.bind @[simp] theorem bind_comp {S : Presieve X} {R : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → Presieve Y} {g : Z ⟶ Y} (h₁ : S f) (h₂ : R h₁ g) : bind S R (g ≫ f) := ⟨_, _, _, h₁, h₂, rfl⟩ #align category_theory.presieve.bind_comp CategoryTheory.Presieve.bind_comp -- Porting note: it seems the definition of `Presieve` must be unfolded in order to define -- this inductive type, it was thus renamed `singleton'` -- Note we can't make this into `HasSingleton` because of the out-param. inductive singleton' : ⦃Y : C⦄ → (Y ⟶ X) → Prop | mk : singleton' f def singleton : Presieve X := singleton' f lemma singleton.mk {f : Y ⟶ X} : singleton f f := singleton'.mk #align category_theory.presieve.singleton CategoryTheory.Presieve.singleton @[simp] theorem singleton_eq_iff_domain (f g : Y ⟶ X) : singleton f g ↔ f = g := by constructor · rintro ⟨a, rfl⟩ rfl · rintro rfl apply singleton.mk #align category_theory.presieve.singleton_eq_iff_domain CategoryTheory.Presieve.singleton_eq_iff_domain theorem singleton_self : singleton f f := singleton.mk #align category_theory.presieve.singleton_self CategoryTheory.Presieve.singleton_self inductive pullbackArrows [HasPullbacks C] (R : Presieve X) : Presieve Y | mk (Z : C) (h : Z ⟶ X) : R h → pullbackArrows _ (pullback.snd : pullback h f ⟶ Y) #align category_theory.presieve.pullback_arrows CategoryTheory.Presieve.pullbackArrows theorem pullback_singleton [HasPullbacks C] (g : Z ⟶ X) : pullbackArrows f (singleton g) = singleton (pullback.snd : pullback g f ⟶ _) := by funext W ext h constructor · rintro ⟨W, _, _, _⟩ exact singleton.mk · rintro ⟨_⟩ exact pullbackArrows.mk Z g singleton.mk #align category_theory.presieve.pullback_singleton CategoryTheory.Presieve.pullback_singleton inductive ofArrows {ι : Type*} (Y : ι → C) (f : ∀ i, Y i ⟶ X) : Presieve X | mk (i : ι) : ofArrows _ _ (f i) #align category_theory.presieve.of_arrows CategoryTheory.Presieve.ofArrows theorem ofArrows_pUnit : (ofArrows _ fun _ : PUnit => f) = singleton f := by funext Y ext g constructor · rintro ⟨_⟩ apply singleton.mk · rintro ⟨_⟩ exact ofArrows.mk PUnit.unit #align category_theory.presieve.of_arrows_punit CategoryTheory.Presieve.ofArrows_pUnit theorem ofArrows_pullback [HasPullbacks C] {ι : Type*} (Z : ι → C) (g : ∀ i : ι, Z i ⟶ X) : (ofArrows (fun i => pullback (g i) f) fun i => pullback.snd) = pullbackArrows f (ofArrows Z g) := by funext T ext h constructor · rintro ⟨hk⟩ exact pullbackArrows.mk _ _ (ofArrows.mk hk) · rintro ⟨W, k, hk₁⟩ cases' hk₁ with i hi apply ofArrows.mk #align category_theory.presieve.of_arrows_pullback CategoryTheory.Presieve.ofArrows_pullback
Mathlib/CategoryTheory/Sites/Sieves.lean
164
176
theorem ofArrows_bind {ι : Type*} (Z : ι → C) (g : ∀ i : ι, Z i ⟶ X) (j : ∀ ⦃Y⦄ (f : Y ⟶ X), ofArrows Z g f → Type*) (W : ∀ ⦃Y⦄ (f : Y ⟶ X) (H), j f H → C) (k : ∀ ⦃Y⦄ (f : Y ⟶ X) (H i), W f H i ⟶ Y) : ((ofArrows Z g).bind fun Y f H => ofArrows (W f H) (k f H)) = ofArrows (fun i : Σi, j _ (ofArrows.mk i) => W (g i.1) _ i.2) fun ij => k (g ij.1) _ ij.2 ≫ g ij.1 := by
funext Y ext f constructor · rintro ⟨_, _, _, ⟨i⟩, ⟨i'⟩, rfl⟩ exact ofArrows.mk (Sigma.mk _ _) · rintro ⟨i⟩ exact bind_comp _ (ofArrows.mk _) (ofArrows.mk _)
7
1,096.633158
2
2
5
2,346
import Mathlib.Topology.CompactOpen import Mathlib.Topology.Connected.PathConnected import Mathlib.Topology.Homotopy.Basic #align_import topology.homotopy.H_spaces from "leanprover-community/mathlib"@"729d23f9e1640e1687141be89b106d3c8f9d10c0" -- Porting note: `HSpace` already contains an upper case letter set_option linter.uppercaseLean3 false universe u v noncomputable section open scoped unitInterval open Path ContinuousMap Set.Icc TopologicalSpace class HSpace (X : Type u) [TopologicalSpace X] where hmul : C(X × X, X) e : X hmul_e_e : hmul (e, e) = e eHmul : (hmul.comp <| (const X e).prodMk <| ContinuousMap.id X).HomotopyRel (ContinuousMap.id X) {e} hmulE : (hmul.comp <| (ContinuousMap.id X).prodMk <| const X e).HomotopyRel (ContinuousMap.id X) {e} #align H_space HSpace scoped[HSpaces] notation x "⋀" y => HSpace.hmul (x, y) -- Porting note: opening `HSpaces` so that the above notation works open HSpaces instance HSpace.prod (X : Type u) (Y : Type v) [TopologicalSpace X] [TopologicalSpace Y] [HSpace X] [HSpace Y] : HSpace (X × Y) where hmul := ⟨fun p => (p.1.1 ⋀ p.2.1, p.1.2 ⋀ p.2.2), by -- Porting note: was `continuity` exact ((map_continuous HSpace.hmul).comp ((continuous_fst.comp continuous_fst).prod_mk (continuous_fst.comp continuous_snd))).prod_mk ((map_continuous HSpace.hmul).comp ((continuous_snd.comp continuous_fst).prod_mk (continuous_snd.comp continuous_snd))) ⟩ e := (HSpace.e, HSpace.e) hmul_e_e := by simp only [ContinuousMap.coe_mk, Prod.mk.inj_iff] exact ⟨HSpace.hmul_e_e, HSpace.hmul_e_e⟩ eHmul := by let G : I × X × Y → X × Y := fun p => (HSpace.eHmul (p.1, p.2.1), HSpace.eHmul (p.1, p.2.2)) have hG : Continuous G := (Continuous.comp HSpace.eHmul.1.1.2 (continuous_fst.prod_mk (continuous_fst.comp continuous_snd))).prod_mk (Continuous.comp HSpace.eHmul.1.1.2 (continuous_fst.prod_mk (continuous_snd.comp continuous_snd))) use! ⟨G, hG⟩ · rintro ⟨x, y⟩ exact Prod.ext (HSpace.eHmul.1.2 x) (HSpace.eHmul.1.2 y) · rintro ⟨x, y⟩ exact Prod.ext (HSpace.eHmul.1.3 x) (HSpace.eHmul.1.3 y) · rintro t ⟨x, y⟩ h replace h := Prod.mk.inj_iff.mp h exact Prod.ext (HSpace.eHmul.2 t x h.1) (HSpace.eHmul.2 t y h.2) hmulE := by let G : I × X × Y → X × Y := fun p => (HSpace.hmulE (p.1, p.2.1), HSpace.hmulE (p.1, p.2.2)) have hG : Continuous G := (Continuous.comp HSpace.hmulE.1.1.2 (continuous_fst.prod_mk (continuous_fst.comp continuous_snd))).prod_mk (Continuous.comp HSpace.hmulE.1.1.2 (continuous_fst.prod_mk (continuous_snd.comp continuous_snd))) use! ⟨G, hG⟩ · rintro ⟨x, y⟩ exact Prod.ext (HSpace.hmulE.1.2 x) (HSpace.hmulE.1.2 y) · rintro ⟨x, y⟩ exact Prod.ext (HSpace.hmulE.1.3 x) (HSpace.hmulE.1.3 y) · rintro t ⟨x, y⟩ h replace h := Prod.mk.inj_iff.mp h exact Prod.ext (HSpace.hmulE.2 t x h.1) (HSpace.hmulE.2 t y h.2) #align H_space.prod HSpace.prod namespace unitInterval def qRight (p : I × I) : I := Set.projIcc 0 1 zero_le_one (2 * p.1 / (1 + p.2)) #align unit_interval.Q_right unitInterval.qRight theorem continuous_qRight : Continuous qRight := continuous_projIcc.comp <| Continuous.div (by continuity) (by continuity) fun x => (add_pos zero_lt_one).ne' #align unit_interval.continuous_Q_right unitInterval.continuous_qRight theorem qRight_zero_left (θ : I) : qRight (0, θ) = 0 := Set.projIcc_of_le_left _ <| by simp only [coe_zero, mul_zero, zero_div, le_refl] #align unit_interval.Q_right_zero_left unitInterval.qRight_zero_left theorem qRight_one_left (θ : I) : qRight (1, θ) = 1 := Set.projIcc_of_right_le _ <| (le_div_iff <| add_pos zero_lt_one).2 <| by dsimp only rw [coe_one, one_mul, mul_one, add_comm, ← one_add_one_eq_two] simp only [add_le_add_iff_right] exact le_one _ #align unit_interval.Q_right_one_left unitInterval.qRight_one_left
Mathlib/Topology/Homotopy/HSpaces.lean
193
202
theorem qRight_zero_right (t : I) : (qRight (t, 0) : ℝ) = if (t : ℝ) ≤ 1 / 2 then (2 : ℝ) * t else 1 := by
simp only [qRight, coe_zero, add_zero, div_one] split_ifs · rw [Set.projIcc_of_mem _ ((mul_pos_mem_iff zero_lt_two).2 _)] refine ⟨t.2.1, ?_⟩ tauto · rw [(Set.projIcc_eq_right _).2] · linarith · exact zero_lt_one
8
2,980.957987
2
2
1
2,347
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β γ δ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~ᵤ " => Associated namespace Prime variable [CommMonoidWithZero α] {p : α} (hp : Prime p)
Mathlib/Algebra/BigOperators/Associated.lean
29
36
theorem exists_mem_multiset_dvd {s : Multiset α} : p ∣ s.prod → ∃ a ∈ s, p ∣ a := Multiset.induction_on s (fun h => (hp.not_dvd_one h).elim) fun a s ih h => have : p ∣ a * s.prod := by
simpa using h match hp.dvd_or_dvd this with | Or.inl h => ⟨a, Multiset.mem_cons_self a s, h⟩ | Or.inr h => let ⟨a, has, h⟩ := ih h ⟨a, Multiset.mem_cons_of_mem has, h⟩
6
403.428793
2
2
6
2,348
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β γ δ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~ᵤ " => Associated theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} : x ~ᵤ z ↔ x.1 ~ᵤ z.1 ∧ x.2 ~ᵤ z.2 := ⟨fun ⟨u, hu⟩ => ⟨⟨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1⟩, ⟨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2⟩⟩, fun ⟨⟨u₁, h₁⟩, ⟨u₂, h₂⟩⟩ => ⟨MulEquiv.prodUnits.invFun (u₁, u₂), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, h₂⟩⟩⟩
Mathlib/Algebra/BigOperators/Associated.lean
58
69
theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M) (g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i ∈ s, f i) ~ᵤ (∏ i ∈ s, g i) := by
induction s using Finset.induction with | empty => simp only [Finset.prod_empty] rfl | @insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~ᵤ (∏ i ∈ insert j s, g i) rw [Finset.prod_insert hjs, Finset.prod_insert hjs] exact Associated.mul_mul (h j (Finset.mem_insert_self j s)) (IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi)))
10
22,026.465795
2
2
6
2,348
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β γ δ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~ᵤ " => Associated theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} : x ~ᵤ z ↔ x.1 ~ᵤ z.1 ∧ x.2 ~ᵤ z.2 := ⟨fun ⟨u, hu⟩ => ⟨⟨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1⟩, ⟨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2⟩⟩, fun ⟨⟨u₁, h₁⟩, ⟨u₂, h₂⟩⟩ => ⟨MulEquiv.prodUnits.invFun (u₁, u₂), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, h₂⟩⟩⟩ theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M) (g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i ∈ s, f i) ~ᵤ (∏ i ∈ s, g i) := by induction s using Finset.induction with | empty => simp only [Finset.prod_empty] rfl | @insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~ᵤ (∏ i ∈ insert j s, g i) rw [Finset.prod_insert hjs, Finset.prod_insert hjs] exact Associated.mul_mul (h j (Finset.mem_insert_self j s)) (IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi))) theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero α] {p : α} (hp : Prime p) {s : Multiset α} : (∀ r ∈ s, Prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q := Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by rw [Multiset.prod_cons] at hps cases' hp.dvd_or_dvd hps with h h · have hap := hs a (Multiset.mem_cons.2 (Or.inl rfl)) exact ⟨a, Multiset.mem_cons_self a _, hp.associated_of_dvd hap h⟩ · rcases ih (fun r hr => hs _ (Multiset.mem_cons.2 (Or.inr hr))) h with ⟨q, hq₁, hq₂⟩ exact ⟨q, Multiset.mem_cons.2 (Or.inr hq₁), hq₂⟩ #align exists_associated_mem_of_dvd_prod exists_associated_mem_of_dvd_prod
Mathlib/Algebra/BigOperators/Associated.lean
82
100
theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero α] [∀ a : α, DecidablePred (Associated a)] {s : Multiset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) (uniq : ∀ a, s.countP (Associated a) ≤ 1) : s.prod ∣ n := by
induction' s using Multiset.induction_on with a s induct n primes divs generalizing n · simp only [Multiset.prod_zero, one_dvd] · rw [Multiset.prod_cons] obtain ⟨k, rfl⟩ : a ∣ n := div a (Multiset.mem_cons_self a s) apply mul_dvd_mul_left a refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_) fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a) have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s) have a_prime := h a (Multiset.mem_cons_self a s) have b_prime := h b (Multiset.mem_cons_of_mem b_in_s) refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_ have assoc := b_prime.associated_of_dvd a_prime b_div_a have := uniq a rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, ← not_lt, Multiset.countP_pos] at this exact this ⟨b, b_in_s, assoc.symm⟩
16
8,886,110.520508
2
2
6
2,348
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β γ δ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~ᵤ " => Associated theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} : x ~ᵤ z ↔ x.1 ~ᵤ z.1 ∧ x.2 ~ᵤ z.2 := ⟨fun ⟨u, hu⟩ => ⟨⟨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1⟩, ⟨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2⟩⟩, fun ⟨⟨u₁, h₁⟩, ⟨u₂, h₂⟩⟩ => ⟨MulEquiv.prodUnits.invFun (u₁, u₂), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, h₂⟩⟩⟩ theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M) (g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i ∈ s, f i) ~ᵤ (∏ i ∈ s, g i) := by induction s using Finset.induction with | empty => simp only [Finset.prod_empty] rfl | @insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~ᵤ (∏ i ∈ insert j s, g i) rw [Finset.prod_insert hjs, Finset.prod_insert hjs] exact Associated.mul_mul (h j (Finset.mem_insert_self j s)) (IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi))) theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero α] {p : α} (hp : Prime p) {s : Multiset α} : (∀ r ∈ s, Prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q := Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by rw [Multiset.prod_cons] at hps cases' hp.dvd_or_dvd hps with h h · have hap := hs a (Multiset.mem_cons.2 (Or.inl rfl)) exact ⟨a, Multiset.mem_cons_self a _, hp.associated_of_dvd hap h⟩ · rcases ih (fun r hr => hs _ (Multiset.mem_cons.2 (Or.inr hr))) h with ⟨q, hq₁, hq₂⟩ exact ⟨q, Multiset.mem_cons.2 (Or.inr hq₁), hq₂⟩ #align exists_associated_mem_of_dvd_prod exists_associated_mem_of_dvd_prod theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero α] [∀ a : α, DecidablePred (Associated a)] {s : Multiset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) (uniq : ∀ a, s.countP (Associated a) ≤ 1) : s.prod ∣ n := by induction' s using Multiset.induction_on with a s induct n primes divs generalizing n · simp only [Multiset.prod_zero, one_dvd] · rw [Multiset.prod_cons] obtain ⟨k, rfl⟩ : a ∣ n := div a (Multiset.mem_cons_self a s) apply mul_dvd_mul_left a refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_) fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a) have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s) have a_prime := h a (Multiset.mem_cons_self a s) have b_prime := h b (Multiset.mem_cons_of_mem b_in_s) refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_ have assoc := b_prime.associated_of_dvd a_prime b_div_a have := uniq a rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, ← not_lt, Multiset.countP_pos] at this exact this ⟨b, b_in_s, assoc.symm⟩ #align multiset.prod_primes_dvd Multiset.prod_primes_dvd
Mathlib/Algebra/BigOperators/Associated.lean
103
111
theorem Finset.prod_primes_dvd [CancelCommMonoidWithZero α] [Unique αˣ] {s : Finset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) : (∏ p ∈ s, p) ∣ n := by
classical exact Multiset.prod_primes_dvd n (by simpa only [Multiset.map_id', Finset.mem_def] using h) (by simpa only [Multiset.map_id', Finset.mem_def] using div) (by simp only [Multiset.map_id', associated_eq_eq, Multiset.countP_eq_card_filter, ← s.val.count_eq_card_filter_eq, ← Multiset.nodup_iff_count_le_one, s.nodup])
7
1,096.633158
2
2
6
2,348
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β γ δ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~ᵤ " => Associated theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} : x ~ᵤ z ↔ x.1 ~ᵤ z.1 ∧ x.2 ~ᵤ z.2 := ⟨fun ⟨u, hu⟩ => ⟨⟨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1⟩, ⟨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2⟩⟩, fun ⟨⟨u₁, h₁⟩, ⟨u₂, h₂⟩⟩ => ⟨MulEquiv.prodUnits.invFun (u₁, u₂), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, h₂⟩⟩⟩ theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M) (g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i ∈ s, f i) ~ᵤ (∏ i ∈ s, g i) := by induction s using Finset.induction with | empty => simp only [Finset.prod_empty] rfl | @insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~ᵤ (∏ i ∈ insert j s, g i) rw [Finset.prod_insert hjs, Finset.prod_insert hjs] exact Associated.mul_mul (h j (Finset.mem_insert_self j s)) (IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi))) theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero α] {p : α} (hp : Prime p) {s : Multiset α} : (∀ r ∈ s, Prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q := Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by rw [Multiset.prod_cons] at hps cases' hp.dvd_or_dvd hps with h h · have hap := hs a (Multiset.mem_cons.2 (Or.inl rfl)) exact ⟨a, Multiset.mem_cons_self a _, hp.associated_of_dvd hap h⟩ · rcases ih (fun r hr => hs _ (Multiset.mem_cons.2 (Or.inr hr))) h with ⟨q, hq₁, hq₂⟩ exact ⟨q, Multiset.mem_cons.2 (Or.inr hq₁), hq₂⟩ #align exists_associated_mem_of_dvd_prod exists_associated_mem_of_dvd_prod theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero α] [∀ a : α, DecidablePred (Associated a)] {s : Multiset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) (uniq : ∀ a, s.countP (Associated a) ≤ 1) : s.prod ∣ n := by induction' s using Multiset.induction_on with a s induct n primes divs generalizing n · simp only [Multiset.prod_zero, one_dvd] · rw [Multiset.prod_cons] obtain ⟨k, rfl⟩ : a ∣ n := div a (Multiset.mem_cons_self a s) apply mul_dvd_mul_left a refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_) fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a) have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s) have a_prime := h a (Multiset.mem_cons_self a s) have b_prime := h b (Multiset.mem_cons_of_mem b_in_s) refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_ have assoc := b_prime.associated_of_dvd a_prime b_div_a have := uniq a rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, ← not_lt, Multiset.countP_pos] at this exact this ⟨b, b_in_s, assoc.symm⟩ #align multiset.prod_primes_dvd Multiset.prod_primes_dvd theorem Finset.prod_primes_dvd [CancelCommMonoidWithZero α] [Unique αˣ] {s : Finset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) : (∏ p ∈ s, p) ∣ n := by classical exact Multiset.prod_primes_dvd n (by simpa only [Multiset.map_id', Finset.mem_def] using h) (by simpa only [Multiset.map_id', Finset.mem_def] using div) (by simp only [Multiset.map_id', associated_eq_eq, Multiset.countP_eq_card_filter, ← s.val.count_eq_card_filter_eq, ← Multiset.nodup_iff_count_le_one, s.nodup]) #align finset.prod_primes_dvd Finset.prod_primes_dvd namespace Associates section CommMonoid variable [CommMonoid α] theorem prod_mk {p : Multiset α} : (p.map Associates.mk).prod = Associates.mk p.prod := Multiset.induction_on p (by simp) fun a s ih => by simp [ih, Associates.mk_mul_mk] #align associates.prod_mk Associates.prod_mk
Mathlib/Algebra/BigOperators/Associated.lean
124
130
theorem finset_prod_mk {p : Finset β} {f : β → α} : (∏ i ∈ p, Associates.mk (f i)) = Associates.mk (∏ i ∈ p, f i) := by
-- Porting note: added have : (fun i => Associates.mk (f i)) = Associates.mk ∘ f := funext fun x => Function.comp_apply rw [Finset.prod_eq_multiset_prod, this, ← Multiset.map_map, prod_mk, ← Finset.prod_eq_multiset_prod]
5
148.413159
2
2
6
2,348
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {α β γ δ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~ᵤ " => Associated theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} : x ~ᵤ z ↔ x.1 ~ᵤ z.1 ∧ x.2 ~ᵤ z.2 := ⟨fun ⟨u, hu⟩ => ⟨⟨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1⟩, ⟨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2⟩⟩, fun ⟨⟨u₁, h₁⟩, ⟨u₂, h₂⟩⟩ => ⟨MulEquiv.prodUnits.invFun (u₁, u₂), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, h₂⟩⟩⟩ theorem Associated.prod {M : Type*} [CommMonoid M] {ι : Type*} (s : Finset ι) (f : ι → M) (g : ι → M) (h : ∀ i, i ∈ s → (f i) ~ᵤ (g i)) : (∏ i ∈ s, f i) ~ᵤ (∏ i ∈ s, g i) := by induction s using Finset.induction with | empty => simp only [Finset.prod_empty] rfl | @insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~ᵤ (∏ i ∈ insert j s, g i) rw [Finset.prod_insert hjs, Finset.prod_insert hjs] exact Associated.mul_mul (h j (Finset.mem_insert_self j s)) (IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi))) theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero α] {p : α} (hp : Prime p) {s : Multiset α} : (∀ r ∈ s, Prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q := Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by rw [Multiset.prod_cons] at hps cases' hp.dvd_or_dvd hps with h h · have hap := hs a (Multiset.mem_cons.2 (Or.inl rfl)) exact ⟨a, Multiset.mem_cons_self a _, hp.associated_of_dvd hap h⟩ · rcases ih (fun r hr => hs _ (Multiset.mem_cons.2 (Or.inr hr))) h with ⟨q, hq₁, hq₂⟩ exact ⟨q, Multiset.mem_cons.2 (Or.inr hq₁), hq₂⟩ #align exists_associated_mem_of_dvd_prod exists_associated_mem_of_dvd_prod theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero α] [∀ a : α, DecidablePred (Associated a)] {s : Multiset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) (uniq : ∀ a, s.countP (Associated a) ≤ 1) : s.prod ∣ n := by induction' s using Multiset.induction_on with a s induct n primes divs generalizing n · simp only [Multiset.prod_zero, one_dvd] · rw [Multiset.prod_cons] obtain ⟨k, rfl⟩ : a ∣ n := div a (Multiset.mem_cons_self a s) apply mul_dvd_mul_left a refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_) fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a) have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s) have a_prime := h a (Multiset.mem_cons_self a s) have b_prime := h b (Multiset.mem_cons_of_mem b_in_s) refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_ have assoc := b_prime.associated_of_dvd a_prime b_div_a have := uniq a rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, ← not_lt, Multiset.countP_pos] at this exact this ⟨b, b_in_s, assoc.symm⟩ #align multiset.prod_primes_dvd Multiset.prod_primes_dvd theorem Finset.prod_primes_dvd [CancelCommMonoidWithZero α] [Unique αˣ] {s : Finset α} (n : α) (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) : (∏ p ∈ s, p) ∣ n := by classical exact Multiset.prod_primes_dvd n (by simpa only [Multiset.map_id', Finset.mem_def] using h) (by simpa only [Multiset.map_id', Finset.mem_def] using div) (by simp only [Multiset.map_id', associated_eq_eq, Multiset.countP_eq_card_filter, ← s.val.count_eq_card_filter_eq, ← Multiset.nodup_iff_count_le_one, s.nodup]) #align finset.prod_primes_dvd Finset.prod_primes_dvd namespace Associates section CancelCommMonoidWithZero variable [CancelCommMonoidWithZero α]
Mathlib/Algebra/BigOperators/Associated.lean
159
168
theorem exists_mem_multiset_le_of_prime {s : Multiset (Associates α)} {p : Associates α} (hp : Prime p) : p ≤ s.prod → ∃ a ∈ s, p ≤ a := Multiset.induction_on s (fun ⟨d, Eq⟩ => (hp.ne_one (mul_eq_one_iff.1 Eq.symm).1).elim) fun a s ih h => have : p ≤ a * s.prod := by
simpa using h match Prime.le_or_le hp this with | Or.inl h => ⟨a, Multiset.mem_cons_self a s, h⟩ | Or.inr h => let ⟨a, has, h⟩ := ih h ⟨a, Multiset.mem_cons_of_mem has, h⟩
6
403.428793
2
2
6
2,348
import Mathlib.Topology.Sheaves.Sheaf import Mathlib.CategoryTheory.Sites.Limits import Mathlib.CategoryTheory.Limits.FunctorCategory #align_import topology.sheaves.limits from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe v u open CategoryTheory open CategoryTheory.Limits variable {C : Type u} [Category.{v} C] {J : Type v} [SmallCategory J] namespace TopCat instance [HasLimits C] (X : TopCat) : HasLimits (Presheaf C X) := Limits.functorCategoryHasLimitsOfSize.{v, v} instance [HasColimits C] (X : TopCat) : HasColimitsOfSize.{v} (Presheaf C X) := Limits.functorCategoryHasColimitsOfSize instance [HasLimits C] (X : TopCat) : CreatesLimits (Sheaf.forget C X) := Sheaf.createsLimits.{u, v, v} instance [HasLimits C] (X : TopCat) : HasLimitsOfSize.{v} (Sheaf.{v} C X) := hasLimits_of_hasLimits_createsLimits (Sheaf.forget C X)
Mathlib/Topology/Sheaves/Limits.lean
41
49
theorem isSheaf_of_isLimit [HasLimits C] {X : TopCat} (F : J ⥤ Presheaf.{v} C X) (H : ∀ j, (F.obj j).IsSheaf) {c : Cone F} (hc : IsLimit c) : c.pt.IsSheaf := by
let F' : J ⥤ Sheaf C X := { obj := fun j => ⟨F.obj j, H j⟩ map := fun f => ⟨F.map f⟩ } let e : F' ⋙ Sheaf.forget C X ≅ F := NatIso.ofComponents fun _ => Iso.refl _ exact Presheaf.isSheaf_of_iso ((isLimitOfPreserves (Sheaf.forget C X) (limit.isLimit F')).conePointsIsoOfNatIso hc e) (limit F').2
7
1,096.633158
2
2
1
2,349
import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral #align_import analysis.special_functions.gamma.bohr_mollerup from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" set_option linter.uppercaseLean3 false noncomputable section open Filter Set MeasureTheory open scoped Nat ENNReal Topology Real namespace Real section Convexity
Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean
106
161
theorem Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma {s t a b : ℝ} (hs : 0 < s) (ht : 0 < t) (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b := by
-- We will apply Hölder's inequality, for the conjugate exponents `p = 1 / a` -- and `q = 1 / b`, to the functions `f a s` and `f b t`, where `f` is as follows: let f : ℝ → ℝ → ℝ → ℝ := fun c u x => exp (-c * x) * x ^ (c * (u - 1)) have e : IsConjExponent (1 / a) (1 / b) := Real.isConjExponent_one_div ha hb hab have hab' : b = 1 - a := by linarith have hst : 0 < a * s + b * t := add_pos (mul_pos ha hs) (mul_pos hb ht) -- some properties of f: have posf : ∀ c u x : ℝ, x ∈ Ioi (0 : ℝ) → 0 ≤ f c u x := fun c u x hx => mul_nonneg (exp_pos _).le (rpow_pos_of_pos hx _).le have posf' : ∀ c u : ℝ, ∀ᵐ x : ℝ ∂volume.restrict (Ioi 0), 0 ≤ f c u x := fun c u => (ae_restrict_iff' measurableSet_Ioi).mpr (ae_of_all _ (posf c u)) have fpow : ∀ {c x : ℝ} (_ : 0 < c) (u : ℝ) (_ : 0 < x), exp (-x) * x ^ (u - 1) = f c u x ^ (1 / c) := by intro c x hc u hx dsimp only [f] rw [mul_rpow (exp_pos _).le ((rpow_nonneg hx.le) _), ← exp_mul, ← rpow_mul hx.le] congr 2 <;> field_simp [hc.ne']; ring -- show `f c u` is in `ℒp` for `p = 1/c`: have f_mem_Lp : ∀ {c u : ℝ} (hc : 0 < c) (hu : 0 < u), Memℒp (f c u) (ENNReal.ofReal (1 / c)) (volume.restrict (Ioi 0)) := by intro c u hc hu have A : ENNReal.ofReal (1 / c) ≠ 0 := by rwa [Ne, ENNReal.ofReal_eq_zero, not_le, one_div_pos] have B : ENNReal.ofReal (1 / c) ≠ ∞ := ENNReal.ofReal_ne_top rw [← memℒp_norm_rpow_iff _ A B, ENNReal.toReal_ofReal (one_div_nonneg.mpr hc.le), ENNReal.div_self A B, memℒp_one_iff_integrable] · apply Integrable.congr (GammaIntegral_convergent hu) refine eventuallyEq_of_mem (self_mem_ae_restrict measurableSet_Ioi) fun x hx => ?_ dsimp only rw [fpow hc u hx] congr 1 exact (norm_of_nonneg (posf _ _ x hx)).symm · refine ContinuousOn.aestronglyMeasurable ?_ measurableSet_Ioi refine (Continuous.continuousOn ?_).mul (ContinuousAt.continuousOn fun x hx => ?_) · exact continuous_exp.comp (continuous_const.mul continuous_id') · exact continuousAt_rpow_const _ _ (Or.inl (mem_Ioi.mp hx).ne') -- now apply Hölder: rw [Gamma_eq_integral hs, Gamma_eq_integral ht, Gamma_eq_integral hst] convert MeasureTheory.integral_mul_le_Lp_mul_Lq_of_nonneg e (posf' a s) (posf' b t) (f_mem_Lp ha hs) (f_mem_Lp hb ht) using 1 · refine setIntegral_congr measurableSet_Ioi fun x hx => ?_ dsimp only have A : exp (-x) = exp (-a * x) * exp (-b * x) := by rw [← exp_add, ← add_mul, ← neg_add, hab, neg_one_mul] have B : x ^ (a * s + b * t - 1) = x ^ (a * (s - 1)) * x ^ (b * (t - 1)) := by rw [← rpow_add hx, hab']; congr 1; ring rw [A, B] ring · rw [one_div_one_div, one_div_one_div] congr 2 <;> exact setIntegral_congr measurableSet_Ioi fun x hx => fpow (by assumption) _ hx
53
104,137,594,330,290,870,000,000
2
2
2
2,350
import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral #align_import analysis.special_functions.gamma.bohr_mollerup from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" set_option linter.uppercaseLean3 false noncomputable section open Filter Set MeasureTheory open scoped Nat ENNReal Topology Real namespace Real section Convexity theorem Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma {s t a b : ℝ} (hs : 0 < s) (ht : 0 < t) (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : Gamma (a * s + b * t) ≤ Gamma s ^ a * Gamma t ^ b := by -- We will apply Hölder's inequality, for the conjugate exponents `p = 1 / a` -- and `q = 1 / b`, to the functions `f a s` and `f b t`, where `f` is as follows: let f : ℝ → ℝ → ℝ → ℝ := fun c u x => exp (-c * x) * x ^ (c * (u - 1)) have e : IsConjExponent (1 / a) (1 / b) := Real.isConjExponent_one_div ha hb hab have hab' : b = 1 - a := by linarith have hst : 0 < a * s + b * t := add_pos (mul_pos ha hs) (mul_pos hb ht) -- some properties of f: have posf : ∀ c u x : ℝ, x ∈ Ioi (0 : ℝ) → 0 ≤ f c u x := fun c u x hx => mul_nonneg (exp_pos _).le (rpow_pos_of_pos hx _).le have posf' : ∀ c u : ℝ, ∀ᵐ x : ℝ ∂volume.restrict (Ioi 0), 0 ≤ f c u x := fun c u => (ae_restrict_iff' measurableSet_Ioi).mpr (ae_of_all _ (posf c u)) have fpow : ∀ {c x : ℝ} (_ : 0 < c) (u : ℝ) (_ : 0 < x), exp (-x) * x ^ (u - 1) = f c u x ^ (1 / c) := by intro c x hc u hx dsimp only [f] rw [mul_rpow (exp_pos _).le ((rpow_nonneg hx.le) _), ← exp_mul, ← rpow_mul hx.le] congr 2 <;> field_simp [hc.ne']; ring -- show `f c u` is in `ℒp` for `p = 1/c`: have f_mem_Lp : ∀ {c u : ℝ} (hc : 0 < c) (hu : 0 < u), Memℒp (f c u) (ENNReal.ofReal (1 / c)) (volume.restrict (Ioi 0)) := by intro c u hc hu have A : ENNReal.ofReal (1 / c) ≠ 0 := by rwa [Ne, ENNReal.ofReal_eq_zero, not_le, one_div_pos] have B : ENNReal.ofReal (1 / c) ≠ ∞ := ENNReal.ofReal_ne_top rw [← memℒp_norm_rpow_iff _ A B, ENNReal.toReal_ofReal (one_div_nonneg.mpr hc.le), ENNReal.div_self A B, memℒp_one_iff_integrable] · apply Integrable.congr (GammaIntegral_convergent hu) refine eventuallyEq_of_mem (self_mem_ae_restrict measurableSet_Ioi) fun x hx => ?_ dsimp only rw [fpow hc u hx] congr 1 exact (norm_of_nonneg (posf _ _ x hx)).symm · refine ContinuousOn.aestronglyMeasurable ?_ measurableSet_Ioi refine (Continuous.continuousOn ?_).mul (ContinuousAt.continuousOn fun x hx => ?_) · exact continuous_exp.comp (continuous_const.mul continuous_id') · exact continuousAt_rpow_const _ _ (Or.inl (mem_Ioi.mp hx).ne') -- now apply Hölder: rw [Gamma_eq_integral hs, Gamma_eq_integral ht, Gamma_eq_integral hst] convert MeasureTheory.integral_mul_le_Lp_mul_Lq_of_nonneg e (posf' a s) (posf' b t) (f_mem_Lp ha hs) (f_mem_Lp hb ht) using 1 · refine setIntegral_congr measurableSet_Ioi fun x hx => ?_ dsimp only have A : exp (-x) = exp (-a * x) * exp (-b * x) := by rw [← exp_add, ← add_mul, ← neg_add, hab, neg_one_mul] have B : x ^ (a * s + b * t - 1) = x ^ (a * (s - 1)) * x ^ (b * (t - 1)) := by rw [← rpow_add hx, hab']; congr 1; ring rw [A, B] ring · rw [one_div_one_div, one_div_one_div] congr 2 <;> exact setIntegral_congr measurableSet_Ioi fun x hx => fpow (by assumption) _ hx #align real.Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma Real.Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma
Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean
164
173
theorem convexOn_log_Gamma : ConvexOn ℝ (Ioi 0) (log ∘ Gamma) := by
refine convexOn_iff_forall_pos.mpr ⟨convex_Ioi _, fun x hx y hy a b ha hb hab => ?_⟩ have : b = 1 - a := by linarith subst this simp_rw [Function.comp_apply, smul_eq_mul] simp only [mem_Ioi] at hx hy rw [← log_rpow, ← log_rpow, ← log_mul] · gcongr exact Gamma_mul_add_mul_le_rpow_Gamma_mul_rpow_Gamma hx hy ha hb hab all_goals positivity
9
8,103.083928
2
2
2
2,350
import Mathlib.RingTheory.WittVector.Domain import Mathlib.RingTheory.WittVector.MulCoeff import Mathlib.RingTheory.DiscreteValuationRing.Basic import Mathlib.Tactic.LinearCombination #align_import ring_theory.witt_vector.discrete_valuation_ring from "leanprover-community/mathlib"@"c163ec99dfc664628ca15d215fce0a5b9c265b68" noncomputable section namespace WittVector variable {p : ℕ} [hp : Fact p.Prime] local notation "𝕎" => WittVector p section PerfectRing variable {k : Type*} [CommRing k] [CharP k p] [PerfectRing k p]
Mathlib/RingTheory/WittVector/DiscreteValuationRing.lean
121
135
theorem exists_eq_pow_p_mul (a : 𝕎 k) (ha : a ≠ 0) : ∃ (m : ℕ) (b : 𝕎 k), b.coeff 0 ≠ 0 ∧ a = (p : 𝕎 k) ^ m * b := by
obtain ⟨m, c, hc, hcm⟩ := WittVector.verschiebung_nonzero ha obtain ⟨b, rfl⟩ := (frobenius_bijective p k).surjective.iterate m c rw [WittVector.iterate_frobenius_coeff] at hc have := congr_fun (WittVector.verschiebung_frobenius_comm.comp_iterate m) b simp only [Function.comp_apply] at this rw [← this] at hcm refine ⟨m, b, ?_, ?_⟩ · contrapose! hc simp [hc, zero_pow $ pow_ne_zero _ hp.out.ne_zero] · simp_rw [← mul_left_iterate (p : 𝕎 k) m] convert hcm using 2 ext1 x rw [mul_comm, ← WittVector.verschiebung_frobenius x]; rfl
13
442,413.392009
2
2
1
2,351
import Mathlib.LinearAlgebra.Alternating.Basic import Mathlib.LinearAlgebra.Multilinear.TensorProduct import Mathlib.GroupTheory.GroupAction.Quotient #align_import linear_algebra.alternating from "leanprover-community/mathlib"@"0c1d80f5a86b36c1db32e021e8d19ae7809d5b79" suppress_compilation open TensorProduct variable {ιa ιb : Type*} [Fintype ιa] [Fintype ιb] variable {R' : Type*} {Mᵢ N₁ N₂ : Type*} [CommSemiring R'] [AddCommGroup N₁] [Module R' N₁] [AddCommGroup N₂] [Module R' N₂] [AddCommMonoid Mᵢ] [Module R' Mᵢ] open Equiv
Mathlib/LinearAlgebra/Alternating/DomCoprod.lean
212
222
theorem MultilinearMap.domCoprod_alternization_coe [DecidableEq ιa] [DecidableEq ιb] (a : MultilinearMap R' (fun _ : ιa => Mᵢ) N₁) (b : MultilinearMap R' (fun _ : ιb => Mᵢ) N₂) : MultilinearMap.domCoprod (MultilinearMap.alternatization a) (MultilinearMap.alternatization b) = ∑ σa : Perm ιa, ∑ σb : Perm ιb, Equiv.Perm.sign σa • Equiv.Perm.sign σb • MultilinearMap.domCoprod (a.domDomCongr σa) (b.domDomCongr σb) := by
simp_rw [← MultilinearMap.domCoprod'_apply, MultilinearMap.alternatization_coe] simp_rw [TensorProduct.sum_tmul, TensorProduct.tmul_sum, _root_.map_sum, ← TensorProduct.smul_tmul', TensorProduct.tmul_smul] rfl
4
54.59815
2
2
1
2,352
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.TensorProduct.Opposite import Mathlib.RingTheory.TensorProduct.Basic variable {R A V : Type*} variable [CommRing R] [CommRing A] [AddCommGroup V] variable [Algebra R A] [Module R V] [Module A V] [IsScalarTower R A V] variable [Invertible (2 : R)] open scoped TensorProduct namespace CliffordAlgebra variable (A) -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChangeAux (Q : QuadraticForm R V) : CliffordAlgebra Q →ₐ[R] CliffordAlgebra (Q.baseChange A) := CliffordAlgebra.lift Q <| by refine ⟨(ι (Q.baseChange A)).restrictScalars R ∘ₗ TensorProduct.mk R A V 1, fun v => ?_⟩ refine (CliffordAlgebra.ι_sq_scalar (Q.baseChange A) (1 ⊗ₜ v)).trans ?_ rw [QuadraticForm.baseChange_tmul, one_mul, ← Algebra.algebraMap_eq_smul_one, ← IsScalarTower.algebraMap_apply] @[simp] theorem ofBaseChangeAux_ι (Q : QuadraticForm R V) (v : V) : ofBaseChangeAux A Q (ι Q v) = ι (Q.baseChange A) (1 ⊗ₜ v) := CliffordAlgebra.lift_ι_apply _ _ v -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChange (Q : QuadraticForm R V) : A ⊗[R] CliffordAlgebra Q →ₐ[A] CliffordAlgebra (Q.baseChange A) := Algebra.TensorProduct.lift (Algebra.ofId _ _) (ofBaseChangeAux A Q) fun _a _x => Algebra.commutes _ _ @[simp] theorem ofBaseChange_tmul_ι (Q : QuadraticForm R V) (z : A) (v : V) : ofBaseChange A Q (z ⊗ₜ ι Q v) = ι (Q.baseChange A) (z ⊗ₜ v) := by show algebraMap _ _ z * ofBaseChangeAux A Q (ι Q v) = ι (Q.baseChange A) (z ⊗ₜ[R] v) rw [ofBaseChangeAux_ι, ← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] @[simp] theorem ofBaseChange_tmul_one (Q : QuadraticForm R V) (z : A) : ofBaseChange A Q (z ⊗ₜ 1) = algebraMap _ _ z := by show algebraMap _ _ z * ofBaseChangeAux A Q 1 = _ rw [map_one, mul_one] -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def toBaseChange (Q : QuadraticForm R V) : CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q := CliffordAlgebra.lift _ <| by refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩ letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) := (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) = QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by -- the crux is that by converting to a statement about linear maps instead of quadratic forms, -- we then have access to all the partially-applied `ext` lemmas. rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)] refine TensorProduct.AlgebraTensorModule.curry_injective ?_ ext v w exact hpure_tensor v w intros v w rw [← TensorProduct.tmul_add, CliffordAlgebra.ι_mul_ι_add_swap, QuadraticForm.polarBilin_baseChange, LinearMap.BilinForm.baseChange_tmul, one_mul, TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one, QuadraticForm.polarBilin_apply_apply] @[simp] theorem toBaseChange_ι (Q : QuadraticForm R V) (z : A) (v : V) : toBaseChange A Q (ι (Q.baseChange A) (z ⊗ₜ v)) = z ⊗ₜ ι Q v := CliffordAlgebra.lift_ι_apply _ _ _
Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean
104
113
theorem toBaseChange_comp_involute (Q : QuadraticForm R V) : (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by
ext v show toBaseChange A Q (involute (ι (Q.baseChange A) (1 ⊗ₜ[R] v))) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute : A ⊗[R] CliffordAlgebra Q →ₐ[A] _) (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v))) rw [toBaseChange_ι, involute_ι, map_neg (toBaseChange A Q), toBaseChange_ι, Algebra.TensorProduct.map_tmul, AlgHom.id_apply, involute_ι, TensorProduct.tmul_neg]
7
1,096.633158
2
2
2
2,353
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.TensorProduct.Opposite import Mathlib.RingTheory.TensorProduct.Basic variable {R A V : Type*} variable [CommRing R] [CommRing A] [AddCommGroup V] variable [Algebra R A] [Module R V] [Module A V] [IsScalarTower R A V] variable [Invertible (2 : R)] open scoped TensorProduct namespace CliffordAlgebra variable (A) -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChangeAux (Q : QuadraticForm R V) : CliffordAlgebra Q →ₐ[R] CliffordAlgebra (Q.baseChange A) := CliffordAlgebra.lift Q <| by refine ⟨(ι (Q.baseChange A)).restrictScalars R ∘ₗ TensorProduct.mk R A V 1, fun v => ?_⟩ refine (CliffordAlgebra.ι_sq_scalar (Q.baseChange A) (1 ⊗ₜ v)).trans ?_ rw [QuadraticForm.baseChange_tmul, one_mul, ← Algebra.algebraMap_eq_smul_one, ← IsScalarTower.algebraMap_apply] @[simp] theorem ofBaseChangeAux_ι (Q : QuadraticForm R V) (v : V) : ofBaseChangeAux A Q (ι Q v) = ι (Q.baseChange A) (1 ⊗ₜ v) := CliffordAlgebra.lift_ι_apply _ _ v -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChange (Q : QuadraticForm R V) : A ⊗[R] CliffordAlgebra Q →ₐ[A] CliffordAlgebra (Q.baseChange A) := Algebra.TensorProduct.lift (Algebra.ofId _ _) (ofBaseChangeAux A Q) fun _a _x => Algebra.commutes _ _ @[simp] theorem ofBaseChange_tmul_ι (Q : QuadraticForm R V) (z : A) (v : V) : ofBaseChange A Q (z ⊗ₜ ι Q v) = ι (Q.baseChange A) (z ⊗ₜ v) := by show algebraMap _ _ z * ofBaseChangeAux A Q (ι Q v) = ι (Q.baseChange A) (z ⊗ₜ[R] v) rw [ofBaseChangeAux_ι, ← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] @[simp] theorem ofBaseChange_tmul_one (Q : QuadraticForm R V) (z : A) : ofBaseChange A Q (z ⊗ₜ 1) = algebraMap _ _ z := by show algebraMap _ _ z * ofBaseChangeAux A Q 1 = _ rw [map_one, mul_one] -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def toBaseChange (Q : QuadraticForm R V) : CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q := CliffordAlgebra.lift _ <| by refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩ letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) := (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) = QuadraticForm.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by -- the crux is that by converting to a statement about linear maps instead of quadratic forms, -- we then have access to all the partially-applied `ext` lemmas. rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)] refine TensorProduct.AlgebraTensorModule.curry_injective ?_ ext v w exact hpure_tensor v w intros v w rw [← TensorProduct.tmul_add, CliffordAlgebra.ι_mul_ι_add_swap, QuadraticForm.polarBilin_baseChange, LinearMap.BilinForm.baseChange_tmul, one_mul, TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one, QuadraticForm.polarBilin_apply_apply] @[simp] theorem toBaseChange_ι (Q : QuadraticForm R V) (z : A) (v : V) : toBaseChange A Q (ι (Q.baseChange A) (z ⊗ₜ v)) = z ⊗ₜ ι Q v := CliffordAlgebra.lift_ι_apply _ _ _ theorem toBaseChange_comp_involute (Q : QuadraticForm R V) : (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by ext v show toBaseChange A Q (involute (ι (Q.baseChange A) (1 ⊗ₜ[R] v))) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute : A ⊗[R] CliffordAlgebra Q →ₐ[A] _) (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v))) rw [toBaseChange_ι, involute_ι, map_neg (toBaseChange A Q), toBaseChange_ι, Algebra.TensorProduct.map_tmul, AlgHom.id_apply, involute_ι, TensorProduct.tmul_neg] theorem toBaseChange_involute (Q : QuadraticForm R V) (x : CliffordAlgebra (Q.baseChange A)) : toBaseChange A Q (involute x) = TensorProduct.map LinearMap.id (involute.toLinearMap) (toBaseChange A Q x) := DFunLike.congr_fun (toBaseChange_comp_involute A Q) x open MulOpposite
Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean
124
137
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) : (toBaseChange A Q).op.comp reverseOp = ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <| (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp (toBaseChange A Q)) := by
ext v show op (toBaseChange A Q (reverse (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))) = Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q) (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q)) (toBaseChange A Q (ι (Q.baseChange A) (1 ⊗ₜ[R] v)))) rw [toBaseChange_ι, reverse_ι, toBaseChange_ι, Algebra.TensorProduct.map_tmul, Algebra.TensorProduct.opAlgEquiv_tmul, reverseOp_ι] rfl
8
2,980.957987
2
2
2
2,353
import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.RCLike.Basic #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal
Mathlib/Analysis/Calculus/MeanValue.lean
92
124
theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ → ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≤ f' x` (hf' : ∀ x ∈ Ico a b, ∀ r, f' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r) {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b)) (hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : ∀ x ∈ Ico a b, f x = B x → f' x < B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x := by
change Icc a b ⊆ { x | f x ≤ B x } set s := { x | f x ≤ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [s, inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≤ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB · -- If `f x < B x`, then all we need is continuity of both sides refine nonempty_of_mem (inter_mem ?_ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : ∀ᶠ x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : ∀ᶠ x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt · rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : ∀ᶠ z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : ∃ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y := (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine ⟨z, ?_, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this
26
195,729,609,428.83878
2
2
2
2,354
import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.RCLike.Basic #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ → ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≤ f' x` (hf' : ∀ x ∈ Ico a b, ∀ r, f' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r) {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b)) (hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : ∀ x ∈ Ico a b, f x = B x → f' x < B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x := by change Icc a b ⊆ { x | f x ≤ B x } set s := { x | f x ≤ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [s, inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≤ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB · -- If `f x < B x`, then all we need is continuity of both sides refine nonempty_of_mem (inter_mem ?_ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : ∀ᶠ x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : ∀ᶠ x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt · rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : ∀ᶠ z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : ∃ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y := (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine ⟨z, ?_, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ → ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≤ f' x` (hf' : ∀ x ∈ Ico a b, ∀ r, f' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r) {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ∀ x, HasDerivAt B (B' x) x) (bound : ∀ x ∈ Ico a b, f x = B x → f' x < B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary
Mathlib/Analysis/Calculus/MeanValue.lean
156
175
theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ → ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b)) (hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≤ B' x` (bound : ∀ x ∈ Ico a b, ∀ r, B' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x := by
have Hr : ∀ x ∈ Icc a b, ∀ r > 0, f x ≤ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound · rwa [sub_self, mul_zero, add_zero] · exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) · intro x hx exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r) · intro x _ _ rw [mul_one] exact (lt_add_iff_pos_right _).2 hr exact hx intro x hx have : ContinuousWithinAt (fun r => B x + r * (x - a)) (Ioi 0) 0 := continuousWithinAt_const.add (continuousWithinAt_id.mul continuousWithinAt_const) convert continuousWithinAt_const.closure_le _ this (Hr x hx) using 1 <;> simp
14
1,202,604.284165
2
2
2
2,354
import Mathlib.GroupTheory.GroupAction.Basic import Mathlib.Topology.Algebra.ConstMulAction #align_import dynamics.minimal from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514" open Pointwise class AddAction.IsMinimal (M α : Type*) [AddMonoid M] [TopologicalSpace α] [AddAction M α] : Prop where dense_orbit : ∀ x : α, Dense (AddAction.orbit M x) #align add_action.is_minimal AddAction.IsMinimal @[to_additive] class MulAction.IsMinimal (M α : Type*) [Monoid M] [TopologicalSpace α] [MulAction M α] : Prop where dense_orbit : ∀ x : α, Dense (MulAction.orbit M x) #align mul_action.is_minimal MulAction.IsMinimal open MulAction Set variable (M G : Type*) {α : Type*} [Monoid M] [Group G] [TopologicalSpace α] [MulAction M α] [MulAction G α] @[to_additive] theorem MulAction.dense_orbit [IsMinimal M α] (x : α) : Dense (orbit M x) := MulAction.IsMinimal.dense_orbit x #align mul_action.dense_orbit MulAction.dense_orbit #align add_action.dense_orbit AddAction.dense_orbit @[to_additive] theorem denseRange_smul [IsMinimal M α] (x : α) : DenseRange fun c : M ↦ c • x := MulAction.dense_orbit M x #align dense_range_smul denseRange_smul #align dense_range_vadd denseRange_vadd @[to_additive] instance (priority := 100) MulAction.isMinimal_of_pretransitive [IsPretransitive M α] : IsMinimal M α := ⟨fun x ↦ (surjective_smul M x).denseRange⟩ #align mul_action.is_minimal_of_pretransitive MulAction.isMinimal_of_pretransitive #align add_action.is_minimal_of_pretransitive AddAction.isMinimal_of_pretransitive @[to_additive] theorem IsOpen.exists_smul_mem [IsMinimal M α] (x : α) {U : Set α} (hUo : IsOpen U) (hne : U.Nonempty) : ∃ c : M, c • x ∈ U := (denseRange_smul M x).exists_mem_open hUo hne #align is_open.exists_smul_mem IsOpen.exists_smul_mem #align is_open.exists_vadd_mem IsOpen.exists_vadd_mem @[to_additive] theorem IsOpen.iUnion_preimage_smul [IsMinimal M α] {U : Set α} (hUo : IsOpen U) (hne : U.Nonempty) : ⋃ c : M, (c • ·) ⁻¹' U = univ := iUnion_eq_univ_iff.2 fun x ↦ hUo.exists_smul_mem M x hne #align is_open.Union_preimage_smul IsOpen.iUnion_preimage_smul #align is_open.Union_preimage_vadd IsOpen.iUnion_preimage_vadd @[to_additive] theorem IsOpen.iUnion_smul [IsMinimal G α] {U : Set α} (hUo : IsOpen U) (hne : U.Nonempty) : ⋃ g : G, g • U = univ := iUnion_eq_univ_iff.2 fun x ↦ let ⟨g, hg⟩ := hUo.exists_smul_mem G x hne ⟨g⁻¹, _, hg, inv_smul_smul _ _⟩ #align is_open.Union_smul IsOpen.iUnion_smul #align is_open.Union_vadd IsOpen.iUnion_vadd @[to_additive] theorem IsCompact.exists_finite_cover_smul [IsMinimal G α] [ContinuousConstSMul G α] {K U : Set α} (hK : IsCompact K) (hUo : IsOpen U) (hne : U.Nonempty) : ∃ I : Finset G, K ⊆ ⋃ g ∈ I, g • U := (hK.elim_finite_subcover (fun g ↦ g • U) fun _ ↦ hUo.smul _) <| calc K ⊆ univ := subset_univ K _ = ⋃ g : G, g • U := (hUo.iUnion_smul G hne).symm #align is_compact.exists_finite_cover_smul IsCompact.exists_finite_cover_smul #align is_compact.exists_finite_cover_vadd IsCompact.exists_finite_cover_vadd @[to_additive] theorem dense_of_nonempty_smul_invariant [IsMinimal M α] {s : Set α} (hne : s.Nonempty) (hsmul : ∀ c : M, c • s ⊆ s) : Dense s := let ⟨x, hx⟩ := hne (MulAction.dense_orbit M x).mono (range_subset_iff.2 fun c ↦ hsmul c ⟨x, hx, rfl⟩) #align dense_of_nonempty_smul_invariant dense_of_nonempty_smul_invariant #align dense_of_nonempty_vadd_invariant dense_of_nonempty_vadd_invariant @[to_additive] theorem eq_empty_or_univ_of_smul_invariant_closed [IsMinimal M α] {s : Set α} (hs : IsClosed s) (hsmul : ∀ c : M, c • s ⊆ s) : s = ∅ ∨ s = univ := s.eq_empty_or_nonempty.imp_right fun hne ↦ hs.closure_eq ▸ (dense_of_nonempty_smul_invariant M hne hsmul).closure_eq #align eq_empty_or_univ_of_smul_invariant_closed eq_empty_or_univ_of_smul_invariant_closed #align eq_empty_or_univ_of_vadd_invariant_closed eq_empty_or_univ_of_vadd_invariant_closed @[to_additive]
Mathlib/Dynamics/Minimal.lean
119
126
theorem isMinimal_iff_closed_smul_invariant [ContinuousConstSMul M α] : IsMinimal M α ↔ ∀ s : Set α, IsClosed s → (∀ c : M, c • s ⊆ s) → s = ∅ ∨ s = univ := by
constructor · intro _ _ exact eq_empty_or_univ_of_smul_invariant_closed M refine fun H ↦ ⟨fun _ ↦ dense_iff_closure_eq.2 <| (H _ ?_ ?_).resolve_left ?_⟩ exacts [isClosed_closure, fun _ ↦ smul_closure_orbit_subset _ _, (orbit_nonempty _).closure.ne_empty]
6
403.428793
2
2
1
2,355
import Mathlib.Geometry.Manifold.Diffeomorph import Mathlib.Geometry.Manifold.Instances.Real import Mathlib.Geometry.Manifold.PartitionOfUnity #align_import geometry.manifold.whitney_embedding from "leanprover-community/mathlib"@"86c29aefdba50b3f33e86e52e3b2f51a0d8f0282" universe uι uE uH uM variable {ι : Type uι} {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {H : Type uH} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} {M : Type uM} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] open Function Filter FiniteDimensional Set open scoped Topology Manifold Classical Filter noncomputable section namespace SmoothBumpCovering variable [T2Space M] [hi : Fintype ι] {s : Set M} (f : SmoothBumpCovering ι I M s) def embeddingPiTangent : C^∞⟮I, M; 𝓘(ℝ, ι → E × ℝ), ι → E × ℝ⟯ where val x i := (f i x • extChartAt I (f.c i) x, f i x) property := contMDiff_pi_space.2 fun i => ((f i).smooth_smul contMDiffOn_extChartAt).prod_mk_space (f i).smooth #align smooth_bump_covering.embedding_pi_tangent SmoothBumpCovering.embeddingPiTangent @[local simp] theorem embeddingPiTangent_coe : ⇑f.embeddingPiTangent = fun x i => (f i x • extChartAt I (f.c i) x, f i x) := rfl #align smooth_bump_covering.embedding_pi_tangent_coe SmoothBumpCovering.embeddingPiTangent_coe
Mathlib/Geometry/Manifold/WhitneyEmbedding.lean
68
75
theorem embeddingPiTangent_injOn : InjOn f.embeddingPiTangent s := by
intro x hx y _ h simp only [embeddingPiTangent_coe, funext_iff] at h obtain ⟨h₁, h₂⟩ := Prod.mk.inj_iff.1 (h (f.ind x hx)) rw [f.apply_ind x hx] at h₂ rw [← h₂, f.apply_ind x hx, one_smul, one_smul] at h₁ have := f.mem_extChartAt_source_of_eq_one h₂.symm exact (extChartAt I (f.c _)).injOn (f.mem_extChartAt_ind_source x hx) this h₁
7
1,096.633158
2
2
4
2,356
import Mathlib.Geometry.Manifold.Diffeomorph import Mathlib.Geometry.Manifold.Instances.Real import Mathlib.Geometry.Manifold.PartitionOfUnity #align_import geometry.manifold.whitney_embedding from "leanprover-community/mathlib"@"86c29aefdba50b3f33e86e52e3b2f51a0d8f0282" universe uι uE uH uM variable {ι : Type uι} {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {H : Type uH} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} {M : Type uM} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] open Function Filter FiniteDimensional Set open scoped Topology Manifold Classical Filter noncomputable section namespace SmoothBumpCovering variable [T2Space M] [hi : Fintype ι] {s : Set M} (f : SmoothBumpCovering ι I M s) def embeddingPiTangent : C^∞⟮I, M; 𝓘(ℝ, ι → E × ℝ), ι → E × ℝ⟯ where val x i := (f i x • extChartAt I (f.c i) x, f i x) property := contMDiff_pi_space.2 fun i => ((f i).smooth_smul contMDiffOn_extChartAt).prod_mk_space (f i).smooth #align smooth_bump_covering.embedding_pi_tangent SmoothBumpCovering.embeddingPiTangent @[local simp] theorem embeddingPiTangent_coe : ⇑f.embeddingPiTangent = fun x i => (f i x • extChartAt I (f.c i) x, f i x) := rfl #align smooth_bump_covering.embedding_pi_tangent_coe SmoothBumpCovering.embeddingPiTangent_coe theorem embeddingPiTangent_injOn : InjOn f.embeddingPiTangent s := by intro x hx y _ h simp only [embeddingPiTangent_coe, funext_iff] at h obtain ⟨h₁, h₂⟩ := Prod.mk.inj_iff.1 (h (f.ind x hx)) rw [f.apply_ind x hx] at h₂ rw [← h₂, f.apply_ind x hx, one_smul, one_smul] at h₁ have := f.mem_extChartAt_source_of_eq_one h₂.symm exact (extChartAt I (f.c _)).injOn (f.mem_extChartAt_ind_source x hx) this h₁ #align smooth_bump_covering.embedding_pi_tangent_inj_on SmoothBumpCovering.embeddingPiTangent_injOn theorem embeddingPiTangent_injective (f : SmoothBumpCovering ι I M) : Injective f.embeddingPiTangent := injective_iff_injOn_univ.2 f.embeddingPiTangent_injOn #align smooth_bump_covering.embedding_pi_tangent_injective SmoothBumpCovering.embeddingPiTangent_injective
Mathlib/Geometry/Manifold/WhitneyEmbedding.lean
83
98
theorem comp_embeddingPiTangent_mfderiv (x : M) (hx : x ∈ s) : ((ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx))).comp (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = mfderiv I I (chartAt H (f.c (f.ind x hx))) x := by
set L := (ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx)) have := L.hasMFDerivAt.comp x f.embeddingPiTangent.smooth.mdifferentiableAt.hasMFDerivAt convert hasMFDerivAt_unique this _ refine (hasMFDerivAt_extChartAt I (f.mem_chartAt_ind_source x hx)).congr_of_eventuallyEq ?_ refine (f.eventuallyEq_one x hx).mono fun y hy => ?_ simp only [L, embeddingPiTangent_coe, ContinuousLinearMap.coe_comp', (· ∘ ·), ContinuousLinearMap.coe_fst', ContinuousLinearMap.proj_apply] rw [hy, Pi.one_apply, one_smul]
10
22,026.465795
2
2
4
2,356
import Mathlib.Geometry.Manifold.Diffeomorph import Mathlib.Geometry.Manifold.Instances.Real import Mathlib.Geometry.Manifold.PartitionOfUnity #align_import geometry.manifold.whitney_embedding from "leanprover-community/mathlib"@"86c29aefdba50b3f33e86e52e3b2f51a0d8f0282" universe uι uE uH uM variable {ι : Type uι} {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {H : Type uH} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} {M : Type uM} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] open Function Filter FiniteDimensional Set open scoped Topology Manifold Classical Filter noncomputable section namespace SmoothBumpCovering variable [T2Space M] [hi : Fintype ι] {s : Set M} (f : SmoothBumpCovering ι I M s) def embeddingPiTangent : C^∞⟮I, M; 𝓘(ℝ, ι → E × ℝ), ι → E × ℝ⟯ where val x i := (f i x • extChartAt I (f.c i) x, f i x) property := contMDiff_pi_space.2 fun i => ((f i).smooth_smul contMDiffOn_extChartAt).prod_mk_space (f i).smooth #align smooth_bump_covering.embedding_pi_tangent SmoothBumpCovering.embeddingPiTangent @[local simp] theorem embeddingPiTangent_coe : ⇑f.embeddingPiTangent = fun x i => (f i x • extChartAt I (f.c i) x, f i x) := rfl #align smooth_bump_covering.embedding_pi_tangent_coe SmoothBumpCovering.embeddingPiTangent_coe theorem embeddingPiTangent_injOn : InjOn f.embeddingPiTangent s := by intro x hx y _ h simp only [embeddingPiTangent_coe, funext_iff] at h obtain ⟨h₁, h₂⟩ := Prod.mk.inj_iff.1 (h (f.ind x hx)) rw [f.apply_ind x hx] at h₂ rw [← h₂, f.apply_ind x hx, one_smul, one_smul] at h₁ have := f.mem_extChartAt_source_of_eq_one h₂.symm exact (extChartAt I (f.c _)).injOn (f.mem_extChartAt_ind_source x hx) this h₁ #align smooth_bump_covering.embedding_pi_tangent_inj_on SmoothBumpCovering.embeddingPiTangent_injOn theorem embeddingPiTangent_injective (f : SmoothBumpCovering ι I M) : Injective f.embeddingPiTangent := injective_iff_injOn_univ.2 f.embeddingPiTangent_injOn #align smooth_bump_covering.embedding_pi_tangent_injective SmoothBumpCovering.embeddingPiTangent_injective theorem comp_embeddingPiTangent_mfderiv (x : M) (hx : x ∈ s) : ((ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx))).comp (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = mfderiv I I (chartAt H (f.c (f.ind x hx))) x := by set L := (ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx)) have := L.hasMFDerivAt.comp x f.embeddingPiTangent.smooth.mdifferentiableAt.hasMFDerivAt convert hasMFDerivAt_unique this _ refine (hasMFDerivAt_extChartAt I (f.mem_chartAt_ind_source x hx)).congr_of_eventuallyEq ?_ refine (f.eventuallyEq_one x hx).mono fun y hy => ?_ simp only [L, embeddingPiTangent_coe, ContinuousLinearMap.coe_comp', (· ∘ ·), ContinuousLinearMap.coe_fst', ContinuousLinearMap.proj_apply] rw [hy, Pi.one_apply, one_smul] #align smooth_bump_covering.comp_embedding_pi_tangent_mfderiv SmoothBumpCovering.comp_embeddingPiTangent_mfderiv
Mathlib/Geometry/Manifold/WhitneyEmbedding.lean
101
107
theorem embeddingPiTangent_ker_mfderiv (x : M) (hx : x ∈ s) : LinearMap.ker (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = ⊥ := by
apply bot_unique rw [← (mdifferentiable_chart I (f.c (f.ind x hx))).ker_mfderiv_eq_bot (f.mem_chartAt_ind_source x hx), ← comp_embeddingPiTangent_mfderiv] exact LinearMap.ker_le_ker_comp _ _
5
148.413159
2
2
4
2,356
import Mathlib.Geometry.Manifold.Diffeomorph import Mathlib.Geometry.Manifold.Instances.Real import Mathlib.Geometry.Manifold.PartitionOfUnity #align_import geometry.manifold.whitney_embedding from "leanprover-community/mathlib"@"86c29aefdba50b3f33e86e52e3b2f51a0d8f0282" universe uι uE uH uM variable {ι : Type uι} {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {H : Type uH} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} {M : Type uM} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] open Function Filter FiniteDimensional Set open scoped Topology Manifold Classical Filter noncomputable section namespace SmoothBumpCovering variable [T2Space M] [hi : Fintype ι] {s : Set M} (f : SmoothBumpCovering ι I M s) def embeddingPiTangent : C^∞⟮I, M; 𝓘(ℝ, ι → E × ℝ), ι → E × ℝ⟯ where val x i := (f i x • extChartAt I (f.c i) x, f i x) property := contMDiff_pi_space.2 fun i => ((f i).smooth_smul contMDiffOn_extChartAt).prod_mk_space (f i).smooth #align smooth_bump_covering.embedding_pi_tangent SmoothBumpCovering.embeddingPiTangent @[local simp] theorem embeddingPiTangent_coe : ⇑f.embeddingPiTangent = fun x i => (f i x • extChartAt I (f.c i) x, f i x) := rfl #align smooth_bump_covering.embedding_pi_tangent_coe SmoothBumpCovering.embeddingPiTangent_coe theorem embeddingPiTangent_injOn : InjOn f.embeddingPiTangent s := by intro x hx y _ h simp only [embeddingPiTangent_coe, funext_iff] at h obtain ⟨h₁, h₂⟩ := Prod.mk.inj_iff.1 (h (f.ind x hx)) rw [f.apply_ind x hx] at h₂ rw [← h₂, f.apply_ind x hx, one_smul, one_smul] at h₁ have := f.mem_extChartAt_source_of_eq_one h₂.symm exact (extChartAt I (f.c _)).injOn (f.mem_extChartAt_ind_source x hx) this h₁ #align smooth_bump_covering.embedding_pi_tangent_inj_on SmoothBumpCovering.embeddingPiTangent_injOn theorem embeddingPiTangent_injective (f : SmoothBumpCovering ι I M) : Injective f.embeddingPiTangent := injective_iff_injOn_univ.2 f.embeddingPiTangent_injOn #align smooth_bump_covering.embedding_pi_tangent_injective SmoothBumpCovering.embeddingPiTangent_injective theorem comp_embeddingPiTangent_mfderiv (x : M) (hx : x ∈ s) : ((ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx))).comp (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = mfderiv I I (chartAt H (f.c (f.ind x hx))) x := by set L := (ContinuousLinearMap.fst ℝ E ℝ).comp (@ContinuousLinearMap.proj ℝ _ ι (fun _ => E × ℝ) _ _ (fun _ => inferInstance) (f.ind x hx)) have := L.hasMFDerivAt.comp x f.embeddingPiTangent.smooth.mdifferentiableAt.hasMFDerivAt convert hasMFDerivAt_unique this _ refine (hasMFDerivAt_extChartAt I (f.mem_chartAt_ind_source x hx)).congr_of_eventuallyEq ?_ refine (f.eventuallyEq_one x hx).mono fun y hy => ?_ simp only [L, embeddingPiTangent_coe, ContinuousLinearMap.coe_comp', (· ∘ ·), ContinuousLinearMap.coe_fst', ContinuousLinearMap.proj_apply] rw [hy, Pi.one_apply, one_smul] #align smooth_bump_covering.comp_embedding_pi_tangent_mfderiv SmoothBumpCovering.comp_embeddingPiTangent_mfderiv theorem embeddingPiTangent_ker_mfderiv (x : M) (hx : x ∈ s) : LinearMap.ker (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) = ⊥ := by apply bot_unique rw [← (mdifferentiable_chart I (f.c (f.ind x hx))).ker_mfderiv_eq_bot (f.mem_chartAt_ind_source x hx), ← comp_embeddingPiTangent_mfderiv] exact LinearMap.ker_le_ker_comp _ _ #align smooth_bump_covering.embedding_pi_tangent_ker_mfderiv SmoothBumpCovering.embeddingPiTangent_ker_mfderiv theorem embeddingPiTangent_injective_mfderiv (x : M) (hx : x ∈ s) : Injective (mfderiv I 𝓘(ℝ, ι → E × ℝ) f.embeddingPiTangent x) := LinearMap.ker_eq_bot.1 (f.embeddingPiTangent_ker_mfderiv x hx) #align smooth_bump_covering.embedding_pi_tangent_injective_mfderiv SmoothBumpCovering.embeddingPiTangent_injective_mfderiv
Mathlib/Geometry/Manifold/WhitneyEmbedding.lean
118
133
theorem exists_immersion_euclidean [Finite ι] (f : SmoothBumpCovering ι I M) : ∃ (n : ℕ) (e : M → EuclideanSpace ℝ (Fin n)), Smooth I (𝓡 n) e ∧ Injective e ∧ ∀ x : M, Injective (mfderiv I (𝓡 n) e x) := by
cases nonempty_fintype ι set F := EuclideanSpace ℝ (Fin <| finrank ℝ (ι → E × ℝ)) letI : IsNoetherian ℝ (E × ℝ) := IsNoetherian.iff_fg.2 inferInstance letI : FiniteDimensional ℝ (ι → E × ℝ) := IsNoetherian.iff_fg.1 inferInstance set eEF : (ι → E × ℝ) ≃L[ℝ] F := ContinuousLinearEquiv.ofFinrankEq finrank_euclideanSpace_fin.symm refine ⟨_, eEF ∘ f.embeddingPiTangent, eEF.toDiffeomorph.smooth.comp f.embeddingPiTangent.smooth, eEF.injective.comp f.embeddingPiTangent_injective, fun x => ?_⟩ rw [mfderiv_comp _ eEF.differentiableAt.mdifferentiableAt f.embeddingPiTangent.smooth.mdifferentiableAt, eEF.mfderiv_eq] exact eEF.injective.comp (f.embeddingPiTangent_injective_mfderiv _ trivial)
13
442,413.392009
2
2
4
2,356
import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho import Mathlib.LinearAlgebra.Matrix.PosDef #align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" variable {𝕜 : Type*} [RCLike 𝕜] variable {n : Type*} [LinearOrder n] [IsWellOrder n (· < ·)] [LocallyFiniteOrderBot n] section set_options set_option linter.uppercaseLean3 false set_option quotPrecheck false local notation "⟪" x ", " y "⟫ₑ" => @inner 𝕜 _ _ ((WithLp.equiv 2 _).symm x) ((WithLp.equiv _ _).symm y) open Matrix open scoped Matrix ComplexOrder variable {S : Matrix n n 𝕜} [Fintype n] (hS : S.PosDef) noncomputable def LDL.lowerInv : Matrix n n 𝕜 := @gramSchmidt 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n) #align LDL.lower_inv LDL.lowerInv
Mathlib/LinearAlgebra/Matrix/LDL.lean
57
66
theorem LDL.lowerInv_eq_gramSchmidtBasis : LDL.lowerInv hS = ((Pi.basisFun 𝕜 n).toMatrix (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)))ᵀ := by
letI := NormedAddCommGroup.ofMatrix hS.transpose letI := InnerProductSpace.ofMatrix hS.transpose ext i j rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis] rfl
5
148.413159
2
2
4
2,357
import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho import Mathlib.LinearAlgebra.Matrix.PosDef #align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" variable {𝕜 : Type*} [RCLike 𝕜] variable {n : Type*} [LinearOrder n] [IsWellOrder n (· < ·)] [LocallyFiniteOrderBot n] section set_options set_option linter.uppercaseLean3 false set_option quotPrecheck false local notation "⟪" x ", " y "⟫ₑ" => @inner 𝕜 _ _ ((WithLp.equiv 2 _).symm x) ((WithLp.equiv _ _).symm y) open Matrix open scoped Matrix ComplexOrder variable {S : Matrix n n 𝕜} [Fintype n] (hS : S.PosDef) noncomputable def LDL.lowerInv : Matrix n n 𝕜 := @gramSchmidt 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n) #align LDL.lower_inv LDL.lowerInv theorem LDL.lowerInv_eq_gramSchmidtBasis : LDL.lowerInv hS = ((Pi.basisFun 𝕜 n).toMatrix (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)))ᵀ := by letI := NormedAddCommGroup.ofMatrix hS.transpose letI := InnerProductSpace.ofMatrix hS.transpose ext i j rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis] rfl #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) := by rw [LDL.lowerInv_eq_gramSchmidtBasis] haveI := Basis.invertibleToMatrix (Pi.basisFun 𝕜 n) (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)) infer_instance #align LDL.invertible_lower_inv LDL.invertibleLowerInv theorem LDL.lowerInv_orthogonal {i j : n} (h₀ : i ≠ j) : ⟪LDL.lowerInv hS i, Sᵀ *ᵥ LDL.lowerInv hS j⟫ₑ = 0 := @gramSchmidt_orthogonal 𝕜 _ _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ h₀ #align LDL.lower_inv_orthogonal LDL.lowerInv_orthogonal noncomputable def LDL.diagEntries : n → 𝕜 := fun i => ⟪star (LDL.lowerInv hS i), S *ᵥ star (LDL.lowerInv hS i)⟫ₑ #align LDL.diag_entries LDL.diagEntries noncomputable def LDL.diag : Matrix n n 𝕜 := Matrix.diagonal (LDL.diagEntries hS) #align LDL.diag LDL.diag
Mathlib/LinearAlgebra/Matrix/LDL.lean
93
97
theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j = 0 := by
rw [← @gramSchmidt_triangular 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ i j hij (Pi.basisFun 𝕜 n), Pi.basisFun_repr, LDL.lowerInv]
4
54.59815
2
2
4
2,357
import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho import Mathlib.LinearAlgebra.Matrix.PosDef #align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" variable {𝕜 : Type*} [RCLike 𝕜] variable {n : Type*} [LinearOrder n] [IsWellOrder n (· < ·)] [LocallyFiniteOrderBot n] section set_options set_option linter.uppercaseLean3 false set_option quotPrecheck false local notation "⟪" x ", " y "⟫ₑ" => @inner 𝕜 _ _ ((WithLp.equiv 2 _).symm x) ((WithLp.equiv _ _).symm y) open Matrix open scoped Matrix ComplexOrder variable {S : Matrix n n 𝕜} [Fintype n] (hS : S.PosDef) noncomputable def LDL.lowerInv : Matrix n n 𝕜 := @gramSchmidt 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n) #align LDL.lower_inv LDL.lowerInv theorem LDL.lowerInv_eq_gramSchmidtBasis : LDL.lowerInv hS = ((Pi.basisFun 𝕜 n).toMatrix (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)))ᵀ := by letI := NormedAddCommGroup.ofMatrix hS.transpose letI := InnerProductSpace.ofMatrix hS.transpose ext i j rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis] rfl #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) := by rw [LDL.lowerInv_eq_gramSchmidtBasis] haveI := Basis.invertibleToMatrix (Pi.basisFun 𝕜 n) (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)) infer_instance #align LDL.invertible_lower_inv LDL.invertibleLowerInv theorem LDL.lowerInv_orthogonal {i j : n} (h₀ : i ≠ j) : ⟪LDL.lowerInv hS i, Sᵀ *ᵥ LDL.lowerInv hS j⟫ₑ = 0 := @gramSchmidt_orthogonal 𝕜 _ _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ h₀ #align LDL.lower_inv_orthogonal LDL.lowerInv_orthogonal noncomputable def LDL.diagEntries : n → 𝕜 := fun i => ⟪star (LDL.lowerInv hS i), S *ᵥ star (LDL.lowerInv hS i)⟫ₑ #align LDL.diag_entries LDL.diagEntries noncomputable def LDL.diag : Matrix n n 𝕜 := Matrix.diagonal (LDL.diagEntries hS) #align LDL.diag LDL.diag theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j = 0 := by rw [← @gramSchmidt_triangular 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ i j hij (Pi.basisFun 𝕜 n), Pi.basisFun_repr, LDL.lowerInv] #align LDL.lower_inv_triangular LDL.lowerInv_triangular
Mathlib/LinearAlgebra/Matrix/LDL.lean
102
113
theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS * S * (LDL.lowerInv hS)ᴴ := by
ext i j by_cases hij : i = j · simp only [diag, diagEntries, EuclideanSpace.inner_piLp_equiv_symm, star_star, hij, diagonal_apply_eq, Matrix.mul_assoc] rfl · simp only [LDL.diag, hij, diagonal_apply_ne, Ne, not_false_iff, mul_mul_apply] rw [conjTranspose, transpose_map, transpose_transpose, dotProduct_mulVec, (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm, mulVec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← RCLike.star_def, ← star_dotProduct_star, dotProduct_comm, star_star] rfl
11
59,874.141715
2
2
4
2,357
import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho import Mathlib.LinearAlgebra.Matrix.PosDef #align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" variable {𝕜 : Type*} [RCLike 𝕜] variable {n : Type*} [LinearOrder n] [IsWellOrder n (· < ·)] [LocallyFiniteOrderBot n] section set_options set_option linter.uppercaseLean3 false set_option quotPrecheck false local notation "⟪" x ", " y "⟫ₑ" => @inner 𝕜 _ _ ((WithLp.equiv 2 _).symm x) ((WithLp.equiv _ _).symm y) open Matrix open scoped Matrix ComplexOrder variable {S : Matrix n n 𝕜} [Fintype n] (hS : S.PosDef) noncomputable def LDL.lowerInv : Matrix n n 𝕜 := @gramSchmidt 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n) #align LDL.lower_inv LDL.lowerInv theorem LDL.lowerInv_eq_gramSchmidtBasis : LDL.lowerInv hS = ((Pi.basisFun 𝕜 n).toMatrix (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)))ᵀ := by letI := NormedAddCommGroup.ofMatrix hS.transpose letI := InnerProductSpace.ofMatrix hS.transpose ext i j rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis] rfl #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) := by rw [LDL.lowerInv_eq_gramSchmidtBasis] haveI := Basis.invertibleToMatrix (Pi.basisFun 𝕜 n) (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun 𝕜 n)) infer_instance #align LDL.invertible_lower_inv LDL.invertibleLowerInv theorem LDL.lowerInv_orthogonal {i j : n} (h₀ : i ≠ j) : ⟪LDL.lowerInv hS i, Sᵀ *ᵥ LDL.lowerInv hS j⟫ₑ = 0 := @gramSchmidt_orthogonal 𝕜 _ _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ h₀ #align LDL.lower_inv_orthogonal LDL.lowerInv_orthogonal noncomputable def LDL.diagEntries : n → 𝕜 := fun i => ⟪star (LDL.lowerInv hS i), S *ᵥ star (LDL.lowerInv hS i)⟫ₑ #align LDL.diag_entries LDL.diagEntries noncomputable def LDL.diag : Matrix n n 𝕜 := Matrix.diagonal (LDL.diagEntries hS) #align LDL.diag LDL.diag theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j = 0 := by rw [← @gramSchmidt_triangular 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ i j hij (Pi.basisFun 𝕜 n), Pi.basisFun_repr, LDL.lowerInv] #align LDL.lower_inv_triangular LDL.lowerInv_triangular theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS * S * (LDL.lowerInv hS)ᴴ := by ext i j by_cases hij : i = j · simp only [diag, diagEntries, EuclideanSpace.inner_piLp_equiv_symm, star_star, hij, diagonal_apply_eq, Matrix.mul_assoc] rfl · simp only [LDL.diag, hij, diagonal_apply_ne, Ne, not_false_iff, mul_mul_apply] rw [conjTranspose, transpose_map, transpose_transpose, dotProduct_mulVec, (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm, mulVec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← RCLike.star_def, ← star_dotProduct_star, dotProduct_comm, star_star] rfl #align LDL.diag_eq_lower_inv_conj LDL.diag_eq_lowerInv_conj noncomputable def LDL.lower := (LDL.lowerInv hS)⁻¹ #align LDL.lower LDL.lower
Mathlib/LinearAlgebra/Matrix/LDL.lean
123
127
theorem LDL.lower_conj_diag : LDL.lower hS * LDL.diag hS * (LDL.lower hS)ᴴ = S := by
rw [LDL.lower, conjTranspose_nonsing_inv, Matrix.mul_assoc, Matrix.inv_mul_eq_iff_eq_mul_of_invertible (LDL.lowerInv hS), Matrix.mul_inv_eq_iff_eq_mul_of_invertible] exact LDL.diag_eq_lowerInv_conj hS
4
54.59815
2
2
4
2,357
import Mathlib.Control.Traversable.Instances import Mathlib.Order.Filter.Basic #align_import order.filter.basic from "leanprover-community/mathlib"@"d4f691b9e5f94cfc64639973f3544c95f8d5d494" open Set List namespace Filter universe u variable {α β γ : Type u} {f : β → Filter α} {s : γ → Set α} theorem sequence_mono : ∀ as bs : List (Filter α), Forall₂ (· ≤ ·) as bs → sequence as ≤ sequence bs | [], [], Forall₂.nil => le_rfl | _::as, _::bs, Forall₂.cons h hs => seq_mono (map_mono h) (sequence_mono as bs hs) #align filter.sequence_mono Filter.sequence_mono theorem mem_traverse : ∀ (fs : List β) (us : List γ), Forall₂ (fun b c => s c ∈ f b) fs us → traverse s us ∈ traverse f fs | [], [], Forall₂.nil => mem_pure.2 <| mem_singleton _ | _::fs, _::us, Forall₂.cons h hs => seq_mem_seq (image_mem_map h) (mem_traverse fs us hs) #align filter.mem_traverse Filter.mem_traverse -- TODO: add a `Filter.HasBasis` statement
Mathlib/Order/Filter/ListTraverse.lean
38
53
theorem mem_traverse_iff (fs : List β) (t : Set (List α)) : t ∈ traverse f fs ↔ ∃ us : List (Set α), Forall₂ (fun b (s : Set α) => s ∈ f b) fs us ∧ sequence us ⊆ t := by
constructor · induction fs generalizing t with | nil => simp only [sequence, mem_pure, imp_self, forall₂_nil_left_iff, exists_eq_left, Set.pure_def, singleton_subset_iff, traverse_nil] | cons b fs ih => intro ht rcases mem_seq_iff.1 ht with ⟨u, hu, v, hv, ht⟩ rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hwu⟩ rcases ih v hv with ⟨us, hus, hu⟩ exact ⟨w::us, Forall₂.cons hw hus, (Set.seq_mono hwu hu).trans ht⟩ · rintro ⟨us, hus, hs⟩ exact mem_of_superset (mem_traverse _ _ hus) hs
13
442,413.392009
2
2
1
2,358
import Mathlib.Order.Filter.Basic import Mathlib.Data.PFun #align_import order.filter.partial from "leanprover-community/mathlib"@"b363547b3113d350d053abdf2884e9850a56b205" universe u v w namespace Filter variable {α : Type u} {β : Type v} {γ : Type w} open Filter def rmap (r : Rel α β) (l : Filter α) : Filter β where sets := { s | r.core s ∈ l } univ_sets := by simp sets_of_superset hs st := mem_of_superset hs (Rel.core_mono _ st) inter_sets hs ht := by simp only [Set.mem_setOf_eq] convert inter_mem hs ht rw [← Rel.core_inter] #align filter.rmap Filter.rmap theorem rmap_sets (r : Rel α β) (l : Filter α) : (l.rmap r).sets = r.core ⁻¹' l.sets := rfl #align filter.rmap_sets Filter.rmap_sets @[simp] theorem mem_rmap (r : Rel α β) (l : Filter α) (s : Set β) : s ∈ l.rmap r ↔ r.core s ∈ l := Iff.rfl #align filter.mem_rmap Filter.mem_rmap @[simp] theorem rmap_rmap (r : Rel α β) (s : Rel β γ) (l : Filter α) : rmap s (rmap r l) = rmap (r.comp s) l := filter_eq <| by simp [rmap_sets, Set.preimage, Rel.core_comp] #align filter.rmap_rmap Filter.rmap_rmap @[simp] theorem rmap_compose (r : Rel α β) (s : Rel β γ) : rmap s ∘ rmap r = rmap (r.comp s) := funext <| rmap_rmap _ _ #align filter.rmap_compose Filter.rmap_compose def RTendsto (r : Rel α β) (l₁ : Filter α) (l₂ : Filter β) := l₁.rmap r ≤ l₂ #align filter.rtendsto Filter.RTendsto theorem rtendsto_def (r : Rel α β) (l₁ : Filter α) (l₂ : Filter β) : RTendsto r l₁ l₂ ↔ ∀ s ∈ l₂, r.core s ∈ l₁ := Iff.rfl #align filter.rtendsto_def Filter.rtendsto_def def rcomap (r : Rel α β) (f : Filter β) : Filter α where sets := Rel.image (fun s t => r.core s ⊆ t) f.sets univ_sets := ⟨Set.univ, univ_mem, Set.subset_univ _⟩ sets_of_superset := fun ⟨a', ha', ma'a⟩ ab => ⟨a', ha', ma'a.trans ab⟩ inter_sets := fun ⟨a', ha₁, ha₂⟩ ⟨b', hb₁, hb₂⟩ => ⟨a' ∩ b', inter_mem ha₁ hb₁, (r.core_inter a' b').subset.trans (Set.inter_subset_inter ha₂ hb₂)⟩ #align filter.rcomap Filter.rcomap theorem rcomap_sets (r : Rel α β) (f : Filter β) : (rcomap r f).sets = Rel.image (fun s t => r.core s ⊆ t) f.sets := rfl #align filter.rcomap_sets Filter.rcomap_sets theorem rcomap_rcomap (r : Rel α β) (s : Rel β γ) (l : Filter γ) : rcomap r (rcomap s l) = rcomap (r.comp s) l := filter_eq <| by ext t; simp [rcomap_sets, Rel.image, Rel.core_comp]; constructor · rintro ⟨u, ⟨v, vsets, hv⟩, h⟩ exact ⟨v, vsets, Set.Subset.trans (Rel.core_mono _ hv) h⟩ rintro ⟨t, tsets, ht⟩ exact ⟨Rel.core s t, ⟨t, tsets, Set.Subset.rfl⟩, ht⟩ #align filter.rcomap_rcomap Filter.rcomap_rcomap @[simp] theorem rcomap_compose (r : Rel α β) (s : Rel β γ) : rcomap r ∘ rcomap s = rcomap (r.comp s) := funext <| rcomap_rcomap _ _ #align filter.rcomap_compose Filter.rcomap_compose
Mathlib/Order/Filter/Partial.lean
130
136
theorem rtendsto_iff_le_rcomap (r : Rel α β) (l₁ : Filter α) (l₂ : Filter β) : RTendsto r l₁ l₂ ↔ l₁ ≤ l₂.rcomap r := by
rw [rtendsto_def] simp_rw [← l₂.mem_sets] simp [Filter.le_def, rcomap, Rel.mem_image]; constructor · exact fun h s t tl₂ => mem_of_superset (h t tl₂) · exact fun h t tl₂ => h _ t tl₂ Set.Subset.rfl
5
148.413159
2
2
1
2,359