Skip to content

Commit 4e57a4f

Browse files
committed
Merge branch 'j-loreaux/EMetric-UniformFun' into j-loreaux/joint-continuity-cfc
2 parents 3568d1a + 4b6ee3a commit 4e57a4f

113 files changed

Lines changed: 1841 additions & 1007 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Archive/Imo/Imo1960Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Kevin Lacker. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kevin Lacker
55
-/
6-
import Mathlib.Data.Nat.Digits
6+
import Mathlib.Data.Nat.Digits.Lemmas
77

88
/-!
99
# IMO 1960 Q1

Archive/Imo/Imo1962Q1.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Kevin Lacker. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kevin Lacker
55
-/
6-
import Mathlib.Data.Nat.Digits
6+
import Mathlib.Data.Nat.Digits.Lemmas
77

88
/-!
99
# IMO 1962 Q1

Archive/Wiedijk100Theorems/BuffonsNeedle.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Enrico Z. Borba
55
-/
66

7-
import Mathlib.Analysis.SpecialFunctions.Integrals
7+
import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
88
import Mathlib.MeasureTheory.Integral.Prod
99
import Mathlib.Probability.Density
1010
import Mathlib.Probability.Distributions.Uniform
@@ -77,21 +77,17 @@ namespace BuffonsNeedle
7777
variable
7878
/- Probability theory variables. -/
7979
{Ω : Type*} [MeasureSpace Ω]
80-
8180
/- Buffon's needle variables. -/
82-
8381
/-
8482
- `d > 0` is the distance between parallel lines.
8583
- `l > 0` is the length of the needle.
8684
-/
8785
(d l : ℝ)
8886
(hd : 0 < d)
8987
(hl : 0 < l)
90-
9188
/- `B = (X, Θ)` is the joint random variable for the x-position and angle of the needle. -/
9289
(B : Ω → ℝ × ℝ)
9390
(hBₘ : Measurable B)
94-
9591
/- `B` is uniformly distributed on `[-d/2, d/2] × [0, π]`. -/
9692
(hB : pdf.IsUniform B ((Set.Icc (-d / 2) (d / 2)) ×ˢ (Set.Icc 0 π)) ℙ)
9793

Counterexamples/AharoniKorman.lean

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -828,15 +828,13 @@ lemma square_subset_above (h : (C ∩ level n).Finite) :
828828
-- If `(C ∩ level n)` is empty, trivially we are done.
829829
obtain h | hne := (C ∩ level n).eq_empty_or_nonempty
830830
· simp [h]
831-
832831
-- Otherwise take a maximal pair `(a, b)` so that any `(c, d, n)` in `C` satisfies
833832
-- `(c, d, n) ≤ (a, b, n)`.
834833
obtain ⟨a, b, hab⟩ : ∃ a b, ∀ c d, h(c, d, n) ∈ C → c ≤ a ∧ d ≤ b := by
835834
obtain ⟨⟨a, b⟩, hab⟩ := (h.image (fun t ↦ ((ofHollom t).1, (ofHollom t).2.1))).bddAbove
836835
use a, b
837836
intro c d hcd
838837
simpa using hab ⟨h(_, _, _), ⟨hcd, by simp⟩, rfl⟩
839-
840838
-- With this pair, we can use the "base" of the square as `max a b + 1`.
841839
rw [eventually_atTop]
842840
refine ⟨max a b + 1, ?_⟩
@@ -846,7 +844,6 @@ lemma square_subset_above (h : (C ∩ level n).Finite) :
846844
Set.mem_setOf_eq, forall_exists_index, EmbeddingLike.apply_eq_iff_eq, Prod.mk.injEq,
847845
toHollom_le_toHollom_iff_fixed_right, Set.mem_diff, and_true, ← max_add_add_right,
848846
Hollom.ext_iff]
849-
850847
-- After simplifying, direct calculations show the subset relation as required.
851848
rintro k hak hbk _ _ _ f g hkf hkg rfl rfl rfl
852849
constructor
@@ -947,15 +944,13 @@ We will later show the same assuming `C ∩ level (n + 1)` is infinite.
947944
lemma square_subset_S_case_1 (h : (C ∩ level n).Finite) (h' : (C ∩ level (n + 1)).Finite) :
948945
∀ᶠ a in atTop, embed n '' Set.Ici (a, a) ⊆ S n C \ (C ∩ level n) := by
949946
rw [S, if_pos h']
950-
951947
-- Take a maximal pair `(b, c)` so that any `(d, e, n)` in `C` satisfies
952948
-- `(d, e, n) ≤ (b, c, n)`.
953949
obtain ⟨b, c, hab⟩ : ∃ b c, ∀ d e, h(d, e, n + 1) ∈ C → (d, e) ≤ (b, c) := by
954950
obtain ⟨⟨b, c⟩, hbc⟩ := (h'.image (fun t ↦ ((ofHollom t).1, (ofHollom t).2.1))).bddAbove
955951
use b, c
956952
intro d e hde
957953
simpa using hbc ⟨h(_, _, _), ⟨hde, by simp⟩, rfl⟩
958-
959954
-- Using `a ≥ max b c`, we have that all elements of `{(x, y, n) | x ≥ a ∧ y ≥ a}` are comparable
960955
-- to all elements of `C ∩ level (n + 1)`.
961956
have : ∀ᶠ a in atTop, embed n '' .Ici (a, a) ⊆ {x | ∀ y ∈ C ∩ level (n + 1), x ≤ y ∨ y ≤ x} := by
@@ -971,7 +966,6 @@ lemma square_subset_S_case_1 (h : (C ∩ level n).Finite) (h' : (C ∩ level (n
971966
have := hab _ _ hgh
972967
simp only [Prod.mk_le_mk] at this ⊢
973968
omega
974-
975969
-- Combined with the fact that sufficiently large `a` have
976970
-- `{(x, y, n) | x ≥ a ∧ y ≥ a} ⊆ R \ (C ∩ level n)`, we can easily finish.
977971
filter_upwards [square_subset_R h, this] with a h₁ h₂
@@ -1041,7 +1035,6 @@ theorem not_S_hits_next (f : SpinalMap C) (hC : IsChain (· ≤ ·) C)
10411035
simp only [level_eq, Set.mem_setOf_eq] at this
10421036
intro h
10431037
simp [level_eq, h, this] at hy
1044-
10451038
-- So suppose it is infinite
10461039
case inr h =>
10471040
-- Write `(x, y, n)` for our given point, and set `(a, b, n + 1) := f(x, y, n)`

Mathlib.lean

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@ import Mathlib.Analysis.SpecialFunctions.Gaussian.PoissonSummation
18021802
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals
18031803
import Mathlib.Analysis.SpecialFunctions.Integrability.Basic
18041804
import Mathlib.Analysis.SpecialFunctions.Integrability.LogMeromorphic
1805-
import Mathlib.Analysis.SpecialFunctions.Integrals
1805+
import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
18061806
import Mathlib.Analysis.SpecialFunctions.JapaneseBracket
18071807
import Mathlib.Analysis.SpecialFunctions.Log.Base
18081808
import Mathlib.Analysis.SpecialFunctions.Log.Basic
@@ -2382,6 +2382,7 @@ import Mathlib.CategoryTheory.Monoidal.Comon_
23822382
import Mathlib.CategoryTheory.Monoidal.Conv
23832383
import Mathlib.CategoryTheory.Monoidal.Discrete
23842384
import Mathlib.CategoryTheory.Monoidal.End
2385+
import Mathlib.CategoryTheory.Monoidal.ExternalProduct
23852386
import Mathlib.CategoryTheory.Monoidal.Free.Basic
23862387
import Mathlib.CategoryTheory.Monoidal.Free.Coherence
23872388
import Mathlib.CategoryTheory.Monoidal.Functor
@@ -3248,7 +3249,9 @@ import Mathlib.Data.Nat.Choose.Multinomial
32483249
import Mathlib.Data.Nat.Choose.Sum
32493250
import Mathlib.Data.Nat.Choose.Vandermonde
32503251
import Mathlib.Data.Nat.Count
3251-
import Mathlib.Data.Nat.Digits
3252+
import Mathlib.Data.Nat.Digits.Defs
3253+
import Mathlib.Data.Nat.Digits.Div
3254+
import Mathlib.Data.Nat.Digits.Lemmas
32523255
import Mathlib.Data.Nat.Dist
32533256
import Mathlib.Data.Nat.EvenOddRec
32543257
import Mathlib.Data.Nat.Factorial.Basic
@@ -3550,6 +3553,7 @@ import Mathlib.FieldTheory.Fixed
35503553
import Mathlib.FieldTheory.Galois.Basic
35513554
import Mathlib.FieldTheory.Galois.GaloisClosure
35523555
import Mathlib.FieldTheory.Galois.Infinite
3556+
import Mathlib.FieldTheory.Galois.IsGaloisGroup
35533557
import Mathlib.FieldTheory.Galois.Profinite
35543558
import Mathlib.FieldTheory.IntermediateField.Adjoin.Algebra
35553559
import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic
@@ -5259,6 +5263,7 @@ import Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Defs
52595263
import Mathlib.RingTheory.IntegralDomain
52605264
import Mathlib.RingTheory.Invariant
52615265
import Mathlib.RingTheory.Invariant.Basic
5266+
import Mathlib.RingTheory.Invariant.Defs
52625267
import Mathlib.RingTheory.Invariant.Profinite
52635268
import Mathlib.RingTheory.IsAdjoinRoot
52645269
import Mathlib.RingTheory.IsPrimary
@@ -5305,6 +5310,7 @@ import Mathlib.RingTheory.LocalRing.ResidueField.Basic
53055310
import Mathlib.RingTheory.LocalRing.ResidueField.Defs
53065311
import Mathlib.RingTheory.LocalRing.ResidueField.Fiber
53075312
import Mathlib.RingTheory.LocalRing.ResidueField.Ideal
5313+
import Mathlib.RingTheory.LocalRing.ResidueField.Instances
53085314
import Mathlib.RingTheory.LocalRing.RingHom.Basic
53095315
import Mathlib.RingTheory.LocalRing.Subring
53105316
import Mathlib.RingTheory.Localization.Algebra
@@ -6011,6 +6017,7 @@ import Mathlib.Topology.Algebra.Module.ModuleTopology
60116017
import Mathlib.Topology.Algebra.Module.Multilinear.Basic
60126018
import Mathlib.Topology.Algebra.Module.Multilinear.Bounded
60136019
import Mathlib.Topology.Algebra.Module.Multilinear.Topology
6020+
import Mathlib.Topology.Algebra.Module.PerfectPairing
60146021
import Mathlib.Topology.Algebra.Module.PerfectSpace
60156022
import Mathlib.Topology.Algebra.Module.Simple
60166023
import Mathlib.Topology.Algebra.Module.Star

Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ protected theorem gc : GaloisConnection (adjoin R : Set A → NonUnitalSubalgebr
588588
show NonUnitalSubsemiring.closure s ≤ S.toNonUnitalSubsemiring from
589589
NonUnitalSubsemiring.closure_le.2 H⟩
590590

591-
/-- Galois insertion between `adjoin` and `Subtype.val`. -/
591+
/-- Galois insertion between `adjoin` and `SetLike.coe`. -/
592592
protected def gi : GaloisInsertion (adjoin R : Set A → NonUnitalSubalgebra R A) (↑) where
593593
choice s hs := (adjoin R s).copy s <| le_antisymm (NonUnitalAlgebra.gc.le_u_l s) hs
594594
gc := NonUnitalAlgebra.gc
@@ -604,6 +604,10 @@ theorem adjoin_le {S : NonUnitalSubalgebra R A} {s : Set A} (hs : s ⊆ S) : adj
604604
theorem adjoin_le_iff {S : NonUnitalSubalgebra R A} {s : Set A} : adjoin R s ≤ S ↔ s ⊆ S :=
605605
NonUnitalAlgebra.gc _ _
606606

607+
@[gcongr]
608+
theorem adjoin_mono {s t : Set A} (H : s ⊆ t) : adjoin R s ≤ adjoin R t :=
609+
NonUnitalAlgebra.gc.monotone_l H
610+
607611
theorem adjoin_union (s t : Set A) : adjoin R (s ∪ t) = adjoin R s ⊔ adjoin R t :=
608612
(NonUnitalAlgebra.gc : GaloisConnection _ ((↑) : NonUnitalSubalgebra R A → Set A)).l_sup
609613

Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ theorem adjoin_eq_sInf : adjoin R s = sInf { p : Subalgebra R A | s ⊆ p } :=
435435
theorem adjoin_le_iff {S : Subalgebra R A} : adjoin R s ≤ S ↔ s ⊆ S :=
436436
Algebra.gc _ _
437437

438+
@[gcongr]
438439
theorem adjoin_mono (H : s ⊆ t) : adjoin R s ≤ adjoin R t :=
439440
Algebra.gc.monotone_l H
440441

Mathlib/Algebra/Category/CoalgCat/ComonEquivalence.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ variable {R : Type u} [CommRing R]
4444
noncomputable instance (X : CoalgCat R) : Comon_Class (ModuleCat.of R X) where
4545
counit := ModuleCat.ofHom Coalgebra.counit
4646
comul := ModuleCat.ofHom Coalgebra.comul
47-
counit_comul' := ModuleCat.hom_ext <| by simpa using Coalgebra.rTensor_counit_comp_comul
48-
comul_counit' := ModuleCat.hom_ext <| by simpa using Coalgebra.lTensor_counit_comp_comul
49-
comul_assoc' := ModuleCat.hom_ext <| by simp_rw [ModuleCat.of_coe]; exact Coalgebra.coassoc.symm
47+
counit_comul := ModuleCat.hom_ext <| by simpa using Coalgebra.rTensor_counit_comp_comul
48+
comul_counit := ModuleCat.hom_ext <| by simpa using Coalgebra.lTensor_counit_comp_comul
49+
comul_assoc := ModuleCat.hom_ext <| by simp_rw [ModuleCat.of_coe]; exact Coalgebra.coassoc.symm
5050

5151
/-- An `R`-coalgebra is a comonoid object in the category of `R`-modules. -/
5252
@[simps X]

Mathlib/Algebra/Exact.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ end LinearMap
259259
variable (f g) in
260260
lemma LinearEquiv.conj_exact_iff_exact (e : N ≃ₗ[R] N') :
261261
Function.Exact (e ∘ₗ f) (g ∘ₗ (e.symm : N' →ₗ[R] N)) ↔ Exact f g := by
262-
simp_rw [LinearMap.exact_iff, LinearMap.ker_comp, ← e.map_eq_comap, LinearMap.range_comp]
262+
simp_rw [LinearMap.exact_iff, LinearMap.ker_comp, ← Submodule.map_equiv_eq_comap_symm,
263+
LinearMap.range_comp]
263264
exact (Submodule.map_injective_of_injective e.injective).eq_iff
264265

265266
namespace Function

Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,28 @@ lemma inf_mul_right {β} [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f
489489
inf (s * t) f = inf t fun y ↦ inf s (f <| · * y) :=
490490
inf_image₂_right ..
491491

492+
/--
493+
See `card_le_card_mul_left` for a more convenient but less general version for types with a
494+
left-cancellative multiplication.
495+
-/
496+
@[to_additive
497+
"See `card_le_card_add_left` for a more convenient but less general version for types with a
498+
left-cancellative addition."]
499+
lemma card_le_card_mul_left_of_injective (has : a ∈ s) (ha : Function.Injective (a * ·)) :
500+
#t ≤ #(s * t) :=
501+
card_le_card_image₂_left _ has ha
502+
503+
/--
504+
See `card_le_card_mul_right` for a more convenient but less general version for types with a
505+
right-cancellative multiplication.
506+
-/
507+
@[to_additive
508+
"See `card_le_card_add_right` for a more convenient but less general version for types with a
509+
right-cancellative addition."]
510+
lemma card_le_card_mul_right_of_injective (hat : a ∈ t) (ha : Function.Injective (· * a)) :
511+
#s ≤ #(s * t) :=
512+
card_le_card_image₂_right _ hat ha
513+
492514
end Mul
493515

494516
/-! ### Finset subtraction/division -/
@@ -1154,7 +1176,7 @@ theorem singleton_mul_inter (a : α) (s t : Finset α) : {a} * (s ∩ t) = {a} *
11541176

11551177
@[to_additive]
11561178
theorem card_le_card_mul_left {s : Finset α} (hs : s.Nonempty) : #t ≤ #(s * t) :=
1157-
card_le_card_image₂_left _ hs mul_right_injective
1179+
have ⟨_, ha⟩ := hs; card_le_card_mul_left_of_injective ha (mul_right_injective _)
11581180

11591181
/--
11601182
The size of `s * s` is at least the size of `s`, version with left-cancellative multiplication.
@@ -1187,7 +1209,7 @@ theorem inter_mul_singleton (s t : Finset α) (a : α) : s ∩ t * {a} = s * {a}
11871209

11881210
@[to_additive]
11891211
theorem card_le_card_mul_right (ht : t.Nonempty) : #s ≤ #(s * t) :=
1190-
card_le_card_image₂_right _ ht mul_left_injective
1212+
have ⟨_, ha⟩ := ht; card_le_card_mul_right_of_injective ha (mul_left_injective _)
11911213

11921214
/--
11931215
The size of `s * s` is at least the size of `s`, version with right-cancellative multiplication.
@@ -1231,10 +1253,10 @@ section Group
12311253
variable [Group α] [DecidableEq α] {s t : Finset α}
12321254

12331255
@[to_additive] lemma card_le_card_div_left (hs : s.Nonempty) : #t ≤ #(s / t) :=
1234-
card_le_card_image₂_left _ hs fun _ div_right_injective
1256+
have ⟨_, ha⟩ := hs; card_le_card_image₂_left _ ha div_right_injective
12351257

12361258
@[to_additive] lemma card_le_card_div_right (ht : t.Nonempty) : #s ≤ #(s / t) :=
1237-
card_le_card_image₂_right _ ht fun _ div_left_injective
1259+
have ⟨_, ha⟩ := ht; card_le_card_image₂_right _ ha div_left_injective
12381260

12391261
@[to_additive] lemma card_le_card_div_self : #s ≤ #(s / s) := by
12401262
cases s.eq_empty_or_nonempty <;> simp [card_le_card_div_left, *]

0 commit comments

Comments
 (0)