Skip to content

Commit 00b209d

Browse files
committed
Merge branch 'aliu/complete_univ' into aliu/krullTopology
2 parents 5c062b8 + 36cf747 commit 00b209d

38 files changed

Lines changed: 1054 additions & 173 deletions

File tree

Counterexamples/Pseudoelement.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ theorem snd_x_pseudo_eq_snd_y : PseudoEqual _ (app biprod.snd x) (app biprod.snd
6565
simp_rw [biprod.lift_snd]; rfl
6666

6767
set_option backward.isDefEq.respectTransparency false in
68-
-- Porting note: locally disable instance to avoid inferred/synthesized clash
69-
attribute [-instance] AddCommGroup.toIntModule in
7068
/-- `x` is not pseudoequal to `y`. -/
7169
theorem x_not_pseudo_eq : ¬PseudoEqual _ x y := by
7270
intro h

Mathlib.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,6 +2046,7 @@ public import Mathlib.Analysis.InnerProductSpace.Convex
20462046
public import Mathlib.Analysis.InnerProductSpace.Defs
20472047
public import Mathlib.Analysis.InnerProductSpace.Dual
20482048
public import Mathlib.Analysis.InnerProductSpace.EuclideanDist
2049+
public import Mathlib.Analysis.InnerProductSpace.ExteriorPower
20492050
public import Mathlib.Analysis.InnerProductSpace.GramMatrix
20502051
public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho
20512052
public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic
@@ -4904,6 +4905,7 @@ public import Mathlib.InformationTheory.Coding.UniquelyDecodable
49044905
public import Mathlib.InformationTheory.Hamming
49054906
public import Mathlib.InformationTheory.KullbackLeibler.Basic
49064907
public import Mathlib.InformationTheory.KullbackLeibler.ChainRule
4908+
public import Mathlib.InformationTheory.KullbackLeibler.DataProcessing
49074909
public import Mathlib.InformationTheory.KullbackLeibler.KLFun
49084910
public import Mathlib.Init
49094911
public import Mathlib.Lean.ContextInfo
@@ -6134,6 +6136,7 @@ public import Mathlib.Order.Interval.Finset.Box
61346136
public import Mathlib.Order.Interval.Finset.Defs
61356137
public import Mathlib.Order.Interval.Finset.DenselyOrdered
61366138
public import Mathlib.Order.Interval.Finset.Fin
6139+
public import Mathlib.Order.Interval.Finset.Floor
61376140
public import Mathlib.Order.Interval.Finset.Gaps
61386141
public import Mathlib.Order.Interval.Finset.Nat
61396142
public import Mathlib.Order.Interval.Finset.SuccPred

Mathlib/Algebra/Algebra/Equiv.lean

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,68 @@ end Semiring
777777

778778
end AlgEquiv
779779

780+
namespace RingEquiv
781+
782+
variable {R S : Type*}
783+
784+
/-- Reinterpret a `RingEquiv` as an `ℕ`-algebra isomorphism. -/
785+
@[simps! -isSimp apply]
786+
def toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) : R ≃ₐ[ℕ] S where
787+
toEquiv := f
788+
__ := f.toRingHom.toNatAlgHom
789+
790+
@[simp]
791+
lemma coe_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
792+
⇑f.toNatAlgEquiv = ⇑f := rfl
793+
794+
lemma toAlgHom_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
795+
f.toNatAlgEquiv.toAlgHom = (f : R →+* S).toNatAlgHom := rfl
796+
797+
@[simp]
798+
lemma symm_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
799+
f.toNatAlgEquiv.symm = f.symm.toNatAlgEquiv := rfl
800+
801+
variable (R) (S) in
802+
/-- The equivalence between `RingEquiv` and `ℕ`-algebra isomorphisms. -/
803+
@[simps apply symm_apply]
804+
def equivNatAlgEquiv [Semiring R] [Semiring S] : (R ≃+* S) ≃ (R ≃ₐ[ℕ] S) where
805+
toFun := toNatAlgEquiv
806+
invFun := AlgEquiv.toRingEquiv
807+
808+
lemma toNatAlgEquiv_injective [Semiring R] [Semiring S] :
809+
Function.Injective (RingEquiv.toNatAlgEquiv : (R ≃+* S) → _) :=
810+
(equivNatAlgEquiv R S).injective
811+
812+
/-- Reinterpret a `RingEquiv` as a `ℤ`-algebra isomorphism. -/
813+
@[simps! -isSimp apply]
814+
def toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) : R ≃ₐ[ℤ] S where
815+
toEquiv := f
816+
__ := f.toRingHom.toIntAlgHom
817+
818+
@[simp]
819+
lemma coe_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
820+
⇑f.toIntAlgEquiv = ⇑f := rfl
821+
822+
lemma toAlgHom_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
823+
f.toIntAlgEquiv.toAlgHom = (f : R →+* S).toIntAlgHom := rfl
824+
825+
@[simp]
826+
lemma symm_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
827+
f.toIntAlgEquiv.symm = f.symm.toIntAlgEquiv := rfl
828+
829+
variable (R) (S) in
830+
/-- The equivalence between `RingEquiv` and `ℤ`-algebra isomorphisms. -/
831+
@[simps apply symm_apply]
832+
def equivIntAlgEquiv [Ring R] [Ring S] : (R ≃+* S) ≃ (R ≃ₐ[ℤ] S) where
833+
toFun := toIntAlgEquiv
834+
invFun := AlgEquiv.toRingEquiv
835+
836+
lemma toIntAlgEquiv_injective [Ring R] [Ring S] :
837+
Function.Injective (RingEquiv.toIntAlgEquiv : (R ≃+* S) → _) :=
838+
(equivIntAlgEquiv R S).injective
839+
840+
end RingEquiv
841+
780842
namespace MulSemiringAction
781843

782844
variable {M G : Type*} (R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A]

Mathlib/Algebra/Algebra/Hom/Rat.lean

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Kenny Lau, Yury Kudryashov
55
-/
66
module
77

8+
public import Mathlib.Algebra.Algebra.Equiv
89
public import Mathlib.Algebra.Algebra.Hom
910
public import Mathlib.Algebra.Algebra.Rat
1011

@@ -15,43 +16,77 @@ public import Mathlib.Algebra.Algebra.Rat
1516

1617
@[expose] public section
1718

19+
variable {R S : Type*} [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S]
1820

1921
namespace RingHom
2022

21-
variable {R S : Type*}
22-
2323
/-- Reinterpret a `RingHom` as a `ℚ`-algebra homomorphism. This actually yields an equivalence,
2424
see `RingHom.equivRatAlgHom`. -/
25-
def toRatAlgHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] (f : R →+* S) : R →ₐ[ℚ] S :=
25+
def toRatAlgHom (f : R →+* S) : R →ₐ[ℚ] S :=
2626
{ f with commutes' := f.map_rat_algebraMap }
2727

2828
@[simp]
29-
theorem toRatAlgHom_toRingHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] (f : R →+* S) :
29+
theorem toRatAlgHom_toRingHom (f : R →+* S) :
3030
↑f.toRatAlgHom = f :=
3131
RingHom.ext fun _x => rfl
3232

3333
@[simp]
34-
theorem toRatAlgHom_apply [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] (f : R →+* S) (x : R) :
34+
theorem toRatAlgHom_apply (f : R →+* S) (x : R) :
3535
f.toRatAlgHom x = f x :=
3636
rfl
3737

3838
end RingHom
3939

40-
section
41-
42-
variable {R S : Type*}
43-
4440
@[simp]
45-
theorem AlgHom.toRingHom_toRatAlgHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S]
46-
(f : R →ₐ[ℚ] S) : (f : R →+* S).toRatAlgHom = f :=
41+
theorem AlgHom.toRingHom_toRatAlgHom (f : R →ₐ[ℚ] S) : (f : R →+* S).toRatAlgHom = f :=
4742
AlgHom.ext fun _x => rfl
4843

4944
variable (R) (S) in
5045
/-- The equivalence between `RingHom` and `ℚ`-algebra homomorphisms. -/
5146
@[simps]
52-
def RingHom.equivRatAlgHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] :
53-
(R →+* S) ≃ (R →ₐ[ℚ] S) where
47+
def RingHom.equivRatAlgHom : (R →+* S) ≃ (R →ₐ[ℚ] S) where
5448
toFun := RingHom.toRatAlgHom
5549
invFun := AlgHom.toRingHom
5650

57-
end
51+
namespace RingEquiv
52+
53+
/-- Reinterpret a `RingEquiv` as a `ℚ`-algebra isomorphism. This actually yields an
54+
equivalence, see `RingEquiv.equivRatAlgEquiv`. -/
55+
@[simps! -isSimp apply]
56+
def toRatAlgEquiv (f : R ≃+* S) : R ≃ₐ[ℚ] S where
57+
toEquiv := f
58+
__ := f.toRingHom.toRatAlgHom
59+
60+
@[simp]
61+
theorem coe_toRatAlgEquiv (f : R ≃+* S) : ⇑f.toRatAlgEquiv = ⇑f := rfl
62+
63+
@[simp]
64+
theorem toRingEquiv_toRatAlgEquiv (f : R ≃+* S) :
65+
f.toRatAlgEquiv = f :=
66+
rfl
67+
68+
theorem toAlgHom_toRatAlgEquiv (f : R ≃+* S) :
69+
f.toRatAlgEquiv.toAlgHom = (f : R →+* S).toRatAlgHom :=
70+
rfl
71+
72+
@[simp]
73+
theorem symm_toRatAlgEquiv (f : R ≃+* S) :
74+
f.toRatAlgEquiv.symm = f.symm.toRatAlgEquiv :=
75+
rfl
76+
77+
end RingEquiv
78+
79+
@[simp]
80+
theorem AlgEquiv.toRatAlgEquiv_toRingEquiv (f : R ≃ₐ[ℚ] S) : (f : R ≃+* S).toRatAlgEquiv = f :=
81+
rfl
82+
83+
variable (R) (S) in
84+
/-- The equivalence between `RingEquiv` and `ℚ`-algebra isomorphisms. -/
85+
@[simps apply symm_apply]
86+
def RingEquiv.equivRatAlgEquiv : (R ≃+* S) ≃ (R ≃ₐ[ℚ] S) where
87+
toFun := RingEquiv.toRatAlgEquiv
88+
invFun := AlgEquiv.toRingEquiv
89+
90+
lemma RingEquiv.toRatAlgEquiv_injective :
91+
Function.Injective (RingEquiv.toRatAlgEquiv : (R ≃+* S) → _) :=
92+
(RingEquiv.equivRatAlgEquiv R S).injective

Mathlib/Algebra/Group/Subgroup/Basic.lean

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,46 @@ instance botCharacteristic : Characteristic (⊥ : Subgroup G) :=
316316
instance topCharacteristic : Characteristic (⊤ : Subgroup G) :=
317317
characteristic_iff_map_le.mpr fun _ϕ => le_top
318318

319+
@[to_additive]
320+
instance characteristic_sup [H.Characteristic] [K.Characteristic] :
321+
(H ⊔ K).Characteristic := by
322+
simp_all [characteristic_iff_map_eq, map_sup]
323+
324+
@[to_additive]
325+
instance characteristic_iSup {ι : Sort*} {H : ι → Subgroup G} [∀ i, (H i).Characteristic] :
326+
(⨆ i, H i).Characteristic := by
327+
simp_all [characteristic_iff_map_eq, map_iSup]
328+
329+
@[to_additive]
330+
theorem characteristic_biSup {ι : Type*} {s : Set ι} {H : ι → Subgroup G}
331+
(h : ∀ i ∈ s, (H i).Characteristic) : (⨆ i ∈ s, H i).Characteristic := by
332+
simp [← iSup_subtype'', characteristic_iSup, h]
333+
334+
@[to_additive]
335+
theorem characteristic_sSup {Hs : Set (Subgroup G)} (h : ∀ H ∈ Hs, H.Characteristic) :
336+
(sSup Hs).Characteristic := by
337+
simp [sSup_eq_iSup', characteristic_iSup, h]
338+
339+
@[to_additive]
340+
instance characteristic_inf [H.Characteristic] [K.Characteristic] :
341+
(H ⊓ K).Characteristic := by
342+
simp_all [characteristic_iff_comap_eq, comap_inf]
343+
344+
@[to_additive]
345+
instance characteristic_iInf {ι : Sort*} {H : ι → Subgroup G} [∀ i, (H i).Characteristic] :
346+
(⨅ i, H i).Characteristic := by
347+
simp_all [characteristic_iff_comap_eq, comap_iInf]
348+
349+
@[to_additive]
350+
theorem characteristic_biInf {ι : Type*} {s : Set ι} {H : ι → Subgroup G}
351+
(h : ∀ i ∈ s, (H i).Characteristic) : (⨅ i ∈ s, H i).Characteristic := by
352+
simp [← iInf_subtype'', characteristic_iInf, h]
353+
354+
@[to_additive]
355+
theorem characteristic_sInf {Hs : Set (Subgroup G)} (h : ∀ H ∈ Hs, H.Characteristic) :
356+
(sInf Hs).Characteristic := by
357+
simp [sInf_eq_iInf', characteristic_iInf, h]
358+
319359
/-- If `H` is a characteristic subgroup of `G`, then every automorphism of `G` induces an
320360
automorphism of `H`. -/
321361
@[to_additive (attr := simps!)

Mathlib/Analysis/Calculus/FDeriv/Measurable.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ variable [CompleteSpace F]
372372
/-- The set of differentiability points of a function taking values in a complete space is
373373
Borel-measurable. -/
374374
theorem measurableSet_of_differentiableAt : MeasurableSet { x | DifferentiableAt 𝕜 f x } := by
375-
have : IsComplete (univ : Set (E →L[𝕜] F)) := complete_univ
375+
have : IsComplete (univ : Set (E →L[𝕜] F)) := isComplete_univ
376376
convert! measurableSet_of_differentiableAt_of_isComplete 𝕜 f this
377377
simp
378378

@@ -700,7 +700,7 @@ variable [CompleteSpace F]
700700
Borel-measurable. -/
701701
theorem measurableSet_of_differentiableWithinAt_Ici :
702702
MeasurableSet { x | DifferentiableWithinAt ℝ f (Ici x) x } := by
703-
have : IsComplete (univ : Set F) := complete_univ
703+
have : IsComplete (univ : Set F) := isComplete_univ
704704
convert! measurableSet_of_differentiableWithinAt_Ici_of_isComplete f this
705705
simp
706706

@@ -893,7 +893,7 @@ variable [CompleteSpace F]
893893
values in a complete space is Borel-measurable. -/
894894
theorem measurableSet_of_differentiableAt_with_param (hf : Continuous f.uncurry) :
895895
MeasurableSet {p : α × E | DifferentiableAt 𝕜 (f p.1) p.2} := by
896-
have : IsComplete (univ : Set (E →L[𝕜] F)) := complete_univ
896+
have : IsComplete (univ : Set (E →L[𝕜] F)) := isComplete_univ
897897
convert! measurableSet_of_differentiableAt_of_isComplete_with_param hf this
898898
simp
899899

Mathlib/Analysis/Convex/Continuous.lean

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,96 @@ protected lemma ConcaveOn.locallyLipschitz (hf : ConcaveOn ℝ univ f) : Locally
233233

234234
-- proof_wanted ConcaveOn.continuousOn_intrinsicInterior (hf : ConcaveOn ℝ C f) :
235235
-- ContinuousOn f (intrinsicInterior ℝ C)
236+
237+
section Intervals
238+
239+
lemma ConvexOn.continuousOn_Ici {f : ℝ → ℝ} {y : ℝ} (hf_cvx : ConvexOn ℝ (Ici y) f)
240+
(hf_cont : ContinuousWithinAt f (Ici y) y) :
241+
ContinuousOn f (Ici y) := by
242+
intro x hx
243+
rcases eq_or_lt_of_le (α := ℝ) hx with rfl | hxy
244+
· exact hf_cont
245+
· have h := hf_cvx.continuousOn_interior x
246+
simp only [nonempty_Iio, interior_Ici', mem_Ioi] at h
247+
rw [continuousWithinAt_iff_continuousAt (Ioi_mem_nhds hxy)] at h
248+
exact (h hxy).continuousWithinAt
249+
250+
lemma ConcaveOn.continuousOn_Ici {f : ℝ → ℝ} {y : ℝ} (hf_cnv : ConcaveOn ℝ (Ici y) f)
251+
(hf_cont : ContinuousWithinAt f (Ici y) y) :
252+
ContinuousOn f (Ici y) := by
253+
simpa using hf_cnv.neg.continuousOn_Ici hf_cont.neg
254+
255+
lemma ConvexOn.continuousOn_Iic {f : ℝ → ℝ} {y : ℝ} (hf_cvx : ConvexOn ℝ (Iic y) f)
256+
(hf_cont : ContinuousWithinAt f (Iic y) y) :
257+
ContinuousOn f (Iic y) := by
258+
intro x hx
259+
rcases eq_or_lt_of_le (α := ℝ) hx with rfl | hxy
260+
· exact hf_cont
261+
· have h := hf_cvx.continuousOn_interior x
262+
simp only [nonempty_Ioi, interior_Iic', mem_Iio] at h
263+
rw [continuousWithinAt_iff_continuousAt (Iio_mem_nhds hxy)] at h
264+
exact (h hxy).continuousWithinAt
265+
266+
lemma ConcaveOn.continuousOn_Iic {f : ℝ → ℝ} {y : ℝ} (hf_cnv : ConcaveOn ℝ (Iic y) f)
267+
(hf_cont : ContinuousWithinAt f (Iic y) y) :
268+
ContinuousOn f (Iic y) := by
269+
simpa using hf_cnv.neg.continuousOn_Iic hf_cont.neg
270+
271+
lemma ConvexOn.continuousOn_Ioc {f : ℝ → ℝ} {y z : ℝ} (hf_cvx : ConvexOn ℝ (Ioc y z) f)
272+
(hf_cont : ContinuousWithinAt f (Iic z) z) :
273+
ContinuousOn f (Ioc y z) := by
274+
intro x hx
275+
rcases eq_or_lt_of_le (α := ℝ) hx.2 with rfl | hxz
276+
· rw [continuousWithinAt_Ioc_iff_Iic hx.1]
277+
exact hf_cont
278+
· have h := hf_cvx.continuousOn_interior x
279+
simp only [interior_Ioc, mem_Ioo, hx.1, hxz, and_self, forall_const] at h
280+
rw [continuousWithinAt_iff_continuousAt (Ioo_mem_nhds hx.1 hxz)] at h
281+
exact h.continuousWithinAt
282+
283+
lemma ConcaveOn.continuousOn_Ioc {f : ℝ → ℝ} {y z : ℝ} (hf_cnv : ConcaveOn ℝ (Ioc y z) f)
284+
(hf_cont : ContinuousWithinAt f (Iic z) z) :
285+
ContinuousOn f (Ioc y z) := by
286+
simpa using hf_cnv.neg.continuousOn_Ioc hf_cont.neg
287+
288+
lemma ConvexOn.continuousOn_Ico {f : ℝ → ℝ} {y z : ℝ} (hf_cvx : ConvexOn ℝ (Ico y z) f)
289+
(hf_cont : ContinuousWithinAt f (Ici y) y) :
290+
ContinuousOn f (Ico y z) := by
291+
intro x hx
292+
rcases eq_or_lt_of_le (α := ℝ) hx.1 with rfl | hyx
293+
· rw [continuousWithinAt_Ico_iff_Ici hx.2]
294+
exact hf_cont
295+
· have h := hf_cvx.continuousOn_interior x
296+
simp only [interior_Ico, mem_Ioo, hyx, hx.2, and_self, forall_const] at h
297+
rw [continuousWithinAt_iff_continuousAt (Ioo_mem_nhds hyx hx.2)] at h
298+
exact h.continuousWithinAt
299+
300+
lemma ConcaveOn.continuousOn_Ico {f : ℝ → ℝ} {y z : ℝ} (hf_cnv : ConcaveOn ℝ (Ico y z) f)
301+
(hf_cont : ContinuousWithinAt f (Ici y) y) :
302+
ContinuousOn f (Ico y z) := by
303+
simpa using hf_cnv.neg.continuousOn_Ico hf_cont.neg
304+
305+
lemma ConvexOn.continuousOn_Icc {f : ℝ → ℝ} {y z : ℝ} (hf_cvx : ConvexOn ℝ (Icc y z) f)
306+
(hyz : y < z)
307+
(hfy : ContinuousWithinAt f (Ici y) y) (hfz : ContinuousWithinAt f (Iic z) z) :
308+
ContinuousOn f (Icc y z) := by
309+
suffices ContinuousOn f (Ico y z) ∧ ContinuousOn f (Ioc y z) by
310+
intro x hx
311+
rcases eq_or_lt_of_le (α := ℝ) hx.1 with rfl | hyx
312+
· exact hfy.mono (by grind)
313+
rcases eq_or_lt_of_le (α := ℝ) hx.2 with rfl | hxz
314+
· exact hfz.mono (by grind)
315+
have hx := this.1 x (by grind)
316+
rw [continuousWithinAt_iff_continuousAt (Ico_mem_nhds hyx hxz)] at hx
317+
exact hx.continuousWithinAt
318+
refine ⟨ConvexOn.continuousOn_Ico ?_ hfy, ConvexOn.continuousOn_Ioc ?_ hfz⟩
319+
· exact hf_cvx.subset Ico_subset_Icc_self (convex_Ico y z)
320+
· exact hf_cvx.subset Ioc_subset_Icc_self (convex_Ioc y z)
321+
322+
lemma ConcaveOn.continuousOn_Icc {f : ℝ → ℝ} {y z : ℝ} (hf_cnv : ConcaveOn ℝ (Icc y z) f)
323+
(hyz : y < z)
324+
(hfy : ContinuousWithinAt f (Ici y) y) (hfz : ContinuousWithinAt f (Iic z) z) :
325+
ContinuousOn f (Icc y z) := by
326+
simpa using hf_cnv.neg.continuousOn_Icc hyz hfy.neg hfz.neg
327+
328+
end Intervals

Mathlib/Analysis/InnerProductSpace/Adjoint.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ namespace ContinuousLinearMap
6868

6969
variable [CompleteSpace E] [CompleteSpace G]
7070

71-
-- Note: made noncomputable to stop excess compilation
72-
-- https://github.com/leanprover-community/mathlib4/issues/7103
7371
/-- The adjoint, as a continuous conjugate-linear map. This is only meant as an auxiliary
7472
definition for the main definition `adjoint`, where this is bundled as a conjugate-linear isometric
7573
equivalence. -/

0 commit comments

Comments
 (0)