Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1a1a7c1
fix(Tactic/NormDet): make norm_det proofs compatible with modules (#4…
paulcadman Jul 27, 2026
f424bc8
feat(Combinatorics/Quiver/Path): add `Quiver.Reachable` (#41849)
ZRTMRH Jul 27, 2026
d1ddae4
feat(Analysis/InnerProductSpace): inner products on exterior powers (…
justus-springer Jul 27, 2026
6561533
chore(Counterexamples): remove stale porting note (#42121)
felixpernegger Jul 27, 2026
dfdaed4
feat(GroupTheory/FreeGroup/IsFreeGroup): to_additive'ize file (#42109)
vlad902 Jul 27, 2026
b4cc8c6
feat: the inversion of a point tends to infinity as it approaches the…
SproutSeeds Jul 27, 2026
d868ca6
feat (Order/Interval/Finset/Floor): Relating membership of an Int or …
teorth Jul 27, 2026
2ec0166
feat(Combinatorics/SimpleGraph): neighborSet and neighborFinset of la…
b-mehta Jul 27, 2026
a76bb81
feat(Algebra/Algebra): reinterpret a RingEquiv as a ℕ/ℤ/ℚ-algebra iso…
xroblot Jul 27, 2026
4d80d5d
feat(Algebra/Group/Subgroup): add sup/iSup/biSup/sSup_characteristic …
rosborn Jul 27, 2026
3156cad
feat(Topology): sheafRestrict is a right adjoint (#41088)
Brian-Nugent Jul 27, 2026
346c31d
feat(CategoryTheory): limits in Comma categories (#41181)
joelriou Jul 27, 2026
54554e9
refactor(RepresentationTheory): move instance Abelian (Rep k G) to Re…
JX-Mo Jul 27, 2026
fbced36
fix(LinearAlgebra/Matrix/Notation): fix defeq abuse in lemma (#42089)
mathlib-splicebot[bot] Jul 27, 2026
6f1c645
chore(Analysis/InnerProductSpace): remove misleading comment (#42123)
felixpernegger Jul 27, 2026
02705be
feat: data processing inequality for the Kullback-Leibler divergence …
RemyDegenne Jul 27, 2026
1faf046
chore(Data/FunLike): tag `IsApply` lemmas as simp (#42027)
loefflerd Jul 27, 2026
d732046
refactor: generalize `Module.Finite.of_surjective` to arbitrary ring …
yuanyi-350 Jul 27, 2026
024a9ab
chore(Geometry/Manifold): fix defs with underscores (#42115)
felixpernegger Jul 27, 2026
9eb53bd
chore: remove uses of `Subrelation` (#41450)
chenson2018 Jul 27, 2026
c997a23
feat: finrank is preserved by `IsFractionRing` (#41694)
tb65536 Jul 27, 2026
c0f1540
feat(Combinatorics/SimpleGraph): edges of an induced subgraph as a fi…
mitchell-horner Jul 27, 2026
671e552
feat(RingTheory/RootsOfUnity/Complex): `I` is a primitive root (#42124)
seewoo5 Jul 27, 2026
5b3f719
fix(LinearAlgebra/Matrix/Notation): fix defeq abuse in lemmas (#42090)
themathqueen Jul 27, 2026
996c094
feat(Geometry/Convex): bundled type of affine maps between convex spa…
joelriou Jul 28, 2026
e62f15e
Merge upstream/master@996c094298 (2026-07-28)
github-actions[bot] Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Counterexamples/Pseudoelement.lean
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ theorem snd_x_pseudo_eq_snd_y : PseudoEqual _ (app biprod.snd x) (app biprod.snd
simp_rw [biprod.lift_snd]; rfl

set_option backward.isDefEq.respectTransparency false in
-- Porting note: locally disable instance to avoid inferred/synthesized clash
attribute [-instance] AddCommGroup.toIntModule in
/-- `x` is not pseudoequal to `y`. -/
theorem x_not_pseudo_eq : ¬PseudoEqual _ x y := by
intro h
Expand Down
4 changes: 4 additions & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,7 @@ public import Mathlib.Analysis.InnerProductSpace.Convex
public import Mathlib.Analysis.InnerProductSpace.Defs
public import Mathlib.Analysis.InnerProductSpace.Dual
public import Mathlib.Analysis.InnerProductSpace.EuclideanDist
public import Mathlib.Analysis.InnerProductSpace.ExteriorPower
public import Mathlib.Analysis.InnerProductSpace.GramMatrix
public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho
public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic
Expand Down Expand Up @@ -4597,6 +4598,7 @@ public import Mathlib.Geometry.Convex.Cone.Face.Basic
public import Mathlib.Geometry.Convex.Cone.Pointed
public import Mathlib.Geometry.Convex.Cone.Simplicial
public import Mathlib.Geometry.Convex.Cone.TensorProduct
public import Mathlib.Geometry.Convex.ConvexSpace.AffineMap
public import Mathlib.Geometry.Convex.ConvexSpace.AffineSpace
public import Mathlib.Geometry.Convex.ConvexSpace.Defs
public import Mathlib.Geometry.Convex.ConvexSpace.Module
Expand Down Expand Up @@ -4903,6 +4905,7 @@ public import Mathlib.InformationTheory.Coding.UniquelyDecodable
public import Mathlib.InformationTheory.Hamming
public import Mathlib.InformationTheory.KullbackLeibler.Basic
public import Mathlib.InformationTheory.KullbackLeibler.ChainRule
public import Mathlib.InformationTheory.KullbackLeibler.DataProcessing
public import Mathlib.InformationTheory.KullbackLeibler.KLFun
public import Mathlib.Init
public import Mathlib.Lean.ContextInfo
Expand Down Expand Up @@ -6133,6 +6136,7 @@ public import Mathlib.Order.Interval.Finset.Box
public import Mathlib.Order.Interval.Finset.Defs
public import Mathlib.Order.Interval.Finset.DenselyOrdered
public import Mathlib.Order.Interval.Finset.Fin
public import Mathlib.Order.Interval.Finset.Floor
public import Mathlib.Order.Interval.Finset.Gaps
public import Mathlib.Order.Interval.Finset.Nat
public import Mathlib.Order.Interval.Finset.SuccPred
Expand Down
62 changes: 62 additions & 0 deletions Mathlib/Algebra/Algebra/Equiv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,68 @@ end Semiring

end AlgEquiv

namespace RingEquiv

variable {R S : Type*}

/-- Reinterpret a `RingEquiv` as an `ℕ`-algebra isomorphism. -/
@[simps! -isSimp apply]
def toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) : R ≃ₐ[ℕ] S where
toEquiv := f
__ := f.toRingHom.toNatAlgHom

@[simp]
lemma coe_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
⇑f.toNatAlgEquiv = ⇑f := rfl

lemma toAlgHom_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
f.toNatAlgEquiv.toAlgHom = (f : R →+* S).toNatAlgHom := rfl

@[simp]
lemma symm_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
f.toNatAlgEquiv.symm = f.symm.toNatAlgEquiv := rfl

variable (R) (S) in
/-- The equivalence between `RingEquiv` and `ℕ`-algebra isomorphisms. -/
@[simps apply symm_apply]
def equivNatAlgEquiv [Semiring R] [Semiring S] : (R ≃+* S) ≃ (R ≃ₐ[ℕ] S) where
toFun := toNatAlgEquiv
invFun := AlgEquiv.toRingEquiv

lemma toNatAlgEquiv_injective [Semiring R] [Semiring S] :
Function.Injective (RingEquiv.toNatAlgEquiv : (R ≃+* S) → _) :=
(equivNatAlgEquiv R S).injective

/-- Reinterpret a `RingEquiv` as a `ℤ`-algebra isomorphism. -/
@[simps! -isSimp apply]
def toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) : R ≃ₐ[ℤ] S where
toEquiv := f
__ := f.toRingHom.toIntAlgHom

@[simp]
lemma coe_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
⇑f.toIntAlgEquiv = ⇑f := rfl

lemma toAlgHom_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
f.toIntAlgEquiv.toAlgHom = (f : R →+* S).toIntAlgHom := rfl

@[simp]
lemma symm_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
f.toIntAlgEquiv.symm = f.symm.toIntAlgEquiv := rfl

variable (R) (S) in
/-- The equivalence between `RingEquiv` and `ℤ`-algebra isomorphisms. -/
@[simps apply symm_apply]
def equivIntAlgEquiv [Ring R] [Ring S] : (R ≃+* S) ≃ (R ≃ₐ[ℤ] S) where
toFun := toIntAlgEquiv
invFun := AlgEquiv.toRingEquiv

lemma toIntAlgEquiv_injective [Ring R] [Ring S] :
Function.Injective (RingEquiv.toIntAlgEquiv : (R ≃+* S) → _) :=
(equivIntAlgEquiv R S).injective

end RingEquiv

namespace MulSemiringAction

variable {M G : Type*} (R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A]
Expand Down
63 changes: 49 additions & 14 deletions Mathlib/Algebra/Algebra/Hom/Rat.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Authors: Kenny Lau, Yury Kudryashov
-/
module

public import Mathlib.Algebra.Algebra.Equiv
public import Mathlib.Algebra.Algebra.Hom
public import Mathlib.Algebra.Algebra.Rat

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

@[expose] public section

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

namespace RingHom

variable {R S : Type*}

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

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

@[simp]
theorem toRatAlgHom_apply [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] (f : R →+* S) (x : R) :
theorem toRatAlgHom_apply (f : R →+* S) (x : R) :
f.toRatAlgHom x = f x :=
rfl

end RingHom

section

variable {R S : Type*}

@[simp]
theorem AlgHom.toRingHom_toRatAlgHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S]
(f : R →ₐ[ℚ] S) : (f : R →+* S).toRatAlgHom = f :=
theorem AlgHom.toRingHom_toRatAlgHom (f : R →ₐ[ℚ] S) : (f : R →+* S).toRatAlgHom = f :=
AlgHom.ext fun _x => rfl

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

end
namespace RingEquiv

/-- Reinterpret a `RingEquiv` as a `ℚ`-algebra isomorphism. This actually yields an
equivalence, see `RingEquiv.equivRatAlgEquiv`. -/
@[simps! -isSimp apply]
def toRatAlgEquiv (f : R ≃+* S) : R ≃ₐ[ℚ] S where
toEquiv := f
__ := f.toRingHom.toRatAlgHom

@[simp]
theorem coe_toRatAlgEquiv (f : R ≃+* S) : ⇑f.toRatAlgEquiv = ⇑f := rfl

@[simp]
theorem toRingEquiv_toRatAlgEquiv (f : R ≃+* S) :
f.toRatAlgEquiv = f :=
rfl

theorem toAlgHom_toRatAlgEquiv (f : R ≃+* S) :
f.toRatAlgEquiv.toAlgHom = (f : R →+* S).toRatAlgHom :=
rfl

@[simp]
theorem symm_toRatAlgEquiv (f : R ≃+* S) :
f.toRatAlgEquiv.symm = f.symm.toRatAlgEquiv :=
rfl

end RingEquiv

@[simp]
theorem AlgEquiv.toRatAlgEquiv_toRingEquiv (f : R ≃ₐ[ℚ] S) : (f : R ≃+* S).toRatAlgEquiv = f :=
rfl

variable (R) (S) in
/-- The equivalence between `RingEquiv` and `ℚ`-algebra isomorphisms. -/
@[simps apply symm_apply]
def RingEquiv.equivRatAlgEquiv : (R ≃+* S) ≃ (R ≃ₐ[ℚ] S) where
toFun := RingEquiv.toRatAlgEquiv
invFun := AlgEquiv.toRingEquiv

lemma RingEquiv.toRatAlgEquiv_injective :
Function.Injective (RingEquiv.toRatAlgEquiv : (R ≃+* S) → _) :=
(RingEquiv.equivRatAlgEquiv R S).injective
40 changes: 40 additions & 0 deletions Mathlib/Algebra/Group/Subgroup/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,46 @@ instance botCharacteristic : Characteristic (⊥ : Subgroup G) :=
instance topCharacteristic : Characteristic (⊤ : Subgroup G) :=
characteristic_iff_map_le.mpr fun _ϕ => le_top

@[to_additive]
instance characteristic_sup [H.Characteristic] [K.Characteristic] :
(H ⊔ K).Characteristic := by
simp_all [characteristic_iff_map_eq, map_sup]

@[to_additive]
instance characteristic_iSup {ι : Sort*} {H : ι → Subgroup G} [∀ i, (H i).Characteristic] :
(⨆ i, H i).Characteristic := by
simp_all [characteristic_iff_map_eq, map_iSup]

@[to_additive]
theorem characteristic_biSup {ι : Type*} {s : Set ι} {H : ι → Subgroup G}
(h : ∀ i ∈ s, (H i).Characteristic) : (⨆ i ∈ s, H i).Characteristic := by
simp [← iSup_subtype'', characteristic_iSup, h]

@[to_additive]
theorem characteristic_sSup {Hs : Set (Subgroup G)} (h : ∀ H ∈ Hs, H.Characteristic) :
(sSup Hs).Characteristic := by
simp [sSup_eq_iSup', characteristic_iSup, h]

@[to_additive]
instance characteristic_inf [H.Characteristic] [K.Characteristic] :
(H ⊓ K).Characteristic := by
simp_all [characteristic_iff_comap_eq, comap_inf]

@[to_additive]
instance characteristic_iInf {ι : Sort*} {H : ι → Subgroup G} [∀ i, (H i).Characteristic] :
(⨅ i, H i).Characteristic := by
simp_all [characteristic_iff_comap_eq, comap_iInf]

@[to_additive]
theorem characteristic_biInf {ι : Type*} {s : Set ι} {H : ι → Subgroup G}
(h : ∀ i ∈ s, (H i).Characteristic) : (⨅ i ∈ s, H i).Characteristic := by
simp [← iInf_subtype'', characteristic_iInf, h]

@[to_additive]
theorem characteristic_sInf {Hs : Set (Subgroup G)} (h : ∀ H ∈ Hs, H.Characteristic) :
(sInf Hs).Characteristic := by
simp [sInf_eq_iInf', characteristic_iInf, h]

/-- If `H` is a characteristic subgroup of `G`, then every automorphism of `G` induces an
automorphism of `H`. -/
@[to_additive (attr := simps!)
Expand Down
93 changes: 93 additions & 0 deletions Mathlib/Analysis/Convex/Continuous.lean
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,96 @@ protected lemma ConcaveOn.locallyLipschitz (hf : ConcaveOn ℝ univ f) : Locally

-- proof_wanted ConcaveOn.continuousOn_intrinsicInterior (hf : ConcaveOn ℝ C f) :
-- ContinuousOn f (intrinsicInterior ℝ C)

section Intervals

lemma ConvexOn.continuousOn_Ici {f : ℝ → ℝ} {y : ℝ} (hf_cvx : ConvexOn ℝ (Ici y) f)
(hf_cont : ContinuousWithinAt f (Ici y) y) :
ContinuousOn f (Ici y) := by
intro x hx
rcases eq_or_lt_of_le (α := ℝ) hx with rfl | hxy
· exact hf_cont
· have h := hf_cvx.continuousOn_interior x
simp only [nonempty_Iio, interior_Ici', mem_Ioi] at h
rw [continuousWithinAt_iff_continuousAt (Ioi_mem_nhds hxy)] at h
exact (h hxy).continuousWithinAt

lemma ConcaveOn.continuousOn_Ici {f : ℝ → ℝ} {y : ℝ} (hf_cnv : ConcaveOn ℝ (Ici y) f)
(hf_cont : ContinuousWithinAt f (Ici y) y) :
ContinuousOn f (Ici y) := by
simpa using hf_cnv.neg.continuousOn_Ici hf_cont.neg

lemma ConvexOn.continuousOn_Iic {f : ℝ → ℝ} {y : ℝ} (hf_cvx : ConvexOn ℝ (Iic y) f)
(hf_cont : ContinuousWithinAt f (Iic y) y) :
ContinuousOn f (Iic y) := by
intro x hx
rcases eq_or_lt_of_le (α := ℝ) hx with rfl | hxy
· exact hf_cont
· have h := hf_cvx.continuousOn_interior x
simp only [nonempty_Ioi, interior_Iic', mem_Iio] at h
rw [continuousWithinAt_iff_continuousAt (Iio_mem_nhds hxy)] at h
exact (h hxy).continuousWithinAt

lemma ConcaveOn.continuousOn_Iic {f : ℝ → ℝ} {y : ℝ} (hf_cnv : ConcaveOn ℝ (Iic y) f)
(hf_cont : ContinuousWithinAt f (Iic y) y) :
ContinuousOn f (Iic y) := by
simpa using hf_cnv.neg.continuousOn_Iic hf_cont.neg

lemma ConvexOn.continuousOn_Ioc {f : ℝ → ℝ} {y z : ℝ} (hf_cvx : ConvexOn ℝ (Ioc y z) f)
(hf_cont : ContinuousWithinAt f (Iic z) z) :
ContinuousOn f (Ioc y z) := by
intro x hx
rcases eq_or_lt_of_le (α := ℝ) hx.2 with rfl | hxz
· rw [continuousWithinAt_Ioc_iff_Iic hx.1]
exact hf_cont
· have h := hf_cvx.continuousOn_interior x
simp only [interior_Ioc, mem_Ioo, hx.1, hxz, and_self, forall_const] at h
rw [continuousWithinAt_iff_continuousAt (Ioo_mem_nhds hx.1 hxz)] at h
exact h.continuousWithinAt

lemma ConcaveOn.continuousOn_Ioc {f : ℝ → ℝ} {y z : ℝ} (hf_cnv : ConcaveOn ℝ (Ioc y z) f)
(hf_cont : ContinuousWithinAt f (Iic z) z) :
ContinuousOn f (Ioc y z) := by
simpa using hf_cnv.neg.continuousOn_Ioc hf_cont.neg

lemma ConvexOn.continuousOn_Ico {f : ℝ → ℝ} {y z : ℝ} (hf_cvx : ConvexOn ℝ (Ico y z) f)
(hf_cont : ContinuousWithinAt f (Ici y) y) :
ContinuousOn f (Ico y z) := by
intro x hx
rcases eq_or_lt_of_le (α := ℝ) hx.1 with rfl | hyx
· rw [continuousWithinAt_Ico_iff_Ici hx.2]
exact hf_cont
· have h := hf_cvx.continuousOn_interior x
simp only [interior_Ico, mem_Ioo, hyx, hx.2, and_self, forall_const] at h
rw [continuousWithinAt_iff_continuousAt (Ioo_mem_nhds hyx hx.2)] at h
exact h.continuousWithinAt

lemma ConcaveOn.continuousOn_Ico {f : ℝ → ℝ} {y z : ℝ} (hf_cnv : ConcaveOn ℝ (Ico y z) f)
(hf_cont : ContinuousWithinAt f (Ici y) y) :
ContinuousOn f (Ico y z) := by
simpa using hf_cnv.neg.continuousOn_Ico hf_cont.neg

lemma ConvexOn.continuousOn_Icc {f : ℝ → ℝ} {y z : ℝ} (hf_cvx : ConvexOn ℝ (Icc y z) f)
(hyz : y < z)
(hfy : ContinuousWithinAt f (Ici y) y) (hfz : ContinuousWithinAt f (Iic z) z) :
ContinuousOn f (Icc y z) := by
suffices ContinuousOn f (Ico y z) ∧ ContinuousOn f (Ioc y z) by
intro x hx
rcases eq_or_lt_of_le (α := ℝ) hx.1 with rfl | hyx
· exact hfy.mono (by grind)
rcases eq_or_lt_of_le (α := ℝ) hx.2 with rfl | hxz
· exact hfz.mono (by grind)
have hx := this.1 x (by grind)
rw [continuousWithinAt_iff_continuousAt (Ico_mem_nhds hyx hxz)] at hx
exact hx.continuousWithinAt
refine ⟨ConvexOn.continuousOn_Ico ?_ hfy, ConvexOn.continuousOn_Ioc ?_ hfz⟩
· exact hf_cvx.subset Ico_subset_Icc_self (convex_Ico y z)
· exact hf_cvx.subset Ioc_subset_Icc_self (convex_Ioc y z)

lemma ConcaveOn.continuousOn_Icc {f : ℝ → ℝ} {y z : ℝ} (hf_cnv : ConcaveOn ℝ (Icc y z) f)
(hyz : y < z)
(hfy : ContinuousWithinAt f (Ici y) y) (hfz : ContinuousWithinAt f (Iic z) z) :
ContinuousOn f (Icc y z) := by
simpa using hf_cnv.neg.continuousOn_Icc hyz hfy.neg hfz.neg

end Intervals
2 changes: 0 additions & 2 deletions Mathlib/Analysis/InnerProductSpace/Adjoint.lean
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ namespace ContinuousLinearMap

variable [CompleteSpace E] [CompleteSpace G]

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