theorem continuous (hf : IsBoundedLinearMap 𝕜 f) : Continuous f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(hf : IsBoundedLinearMap 𝕜 f)


theorem isBigO_const_mul_self (c : R) (f : α → R) (l : Filter α) : (fun x => c * f x) =O[l] f

{α : Type u_1}
{R : Type u_13}
[SeminormedRing R]
(c : R)
(f : α → R)
(l : Filter α)


/-- A braided monoidal category is a monoidal category equipped with a braiding isomorphism
`β_ X Y : X ⊗ Y ≅ Y ⊗ X`
which is natural in both arguments,
and also satisfies the two hexagon identities.
-/
class BraidedCategory (C : Type u) [Category.{v} C] [MonoidalCategory.{v} C] where
  /-- The braiding natural isomorphism. -/
  braiding : ∀ X Y : C, X ⊗ Y ≅ Y ⊗ X
  braiding_naturality_right :
    ∀ (X : C) {Y Z : C} (f : Y ⟶ Z),
      X ◁ f ≫ (braiding X Z).hom = (braiding X Y).hom ≫ f ▷ X := by
    aesop_cat
  braiding_naturality_left :
    ∀ {X Y : C} (f : X ⟶ Y) (Z : C),
      f ▷ Z ≫ (braiding Y Z).hom = (braiding X Z).hom ≫ Z ◁ f := by
    aesop_cat
  /-- The first hexagon identity. -/
  hexagon_forward :
    ∀ X Y Z : C,
      (α_ X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom =
        ((braiding X Y).hom ▷ Z) ≫ (α_ Y X Z).hom ≫ (Y ◁ (braiding X Z).hom) := by
    aesop_cat
  /-- The second hexagon identity. -/
  hexagon_reverse :
    ∀ X Y Z : C,
      (α_ X Y Z).inv ≫ (braiding (X ⊗ Y) Z).hom ≫ (α_ Z X Y).inv =
        (X ◁ (braiding Y Z).hom) ≫ (α_ X Z Y).inv ≫ ((braiding X Z).hom ▷ Y) := by
    aesop_cat

[self : CategoryTheory.BraidedCategory C]

X ◁ f ≫ (β_ X Z).hom = (β_ X Y).hom ≫ f ▷ X


theorem BijOn.surjOn (h : BijOn f s t) : SurjOn f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.BijOn f s t)


theorem zero_lt_orderTop_iff {x : HahnSeries Γ R} (hx : x ≠ 0) :
    0 < x.orderTop ↔ 0 < x.order

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
[Zero Γ]
{x : HahnSeries Γ R}
(hx : x ≠ 0)


/-- The canonical isomorphism relating `Cospan f.op g.op` and `(Span f g).op` -/
@[simps!]
def cospanOp {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) :
    cospan f.op g.op ≅ walkingSpanOpEquiv.inverse ⋙ (span f g).op

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(f : X ⟶ Y)
(g : X ⟶ Z)

∀ (X_1 : CategoryTheory.Limits.WalkingCospan),
  (CategoryTheory.Limits.cospanOp f g).inv.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl (Opposite.op X))
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op Y))
            (CategoryTheory.Iso.refl (Opposite.op Z)) val)
        X_1).inv


@[to_additive add_neg_lt_add_neg_iff]
theorem mul_inv_lt_mul_inv_iff' : a * b⁻¹ < c * d⁻¹ ↔ a * d < c * b

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1]


theorem ContinuousWithinAt.comp' {g : β → γ} {f : α → β} {s : Set α} {t : Set β} {x : α}
    (hg : ContinuousWithinAt g t (f x)) (hf : ContinuousWithinAt f s x) :
    ContinuousWithinAt (g ∘ f) (s ∩ f ⁻¹' t) x

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{g : β → γ}
{f : α → β}
{s : Set α}
{t : Set β}
{x : α}
(hg : ContinuousWithinAt g t (f x))
(hf : ContinuousWithinAt f s x)


theorem arrows_ext : ∀ {R S : Sieve X}, R.arrows = S.arrows → R = S

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
{R S : CategoryTheory.Sieve X}


theorem conj_swap {G : Type*} [Group G] (x y : Conj G) : x ◃ y = y ↔ y ◃ x = x

{G : Type u_2}
[Group G]
(x y : Quandle.Conj G)


theorem integral_comp_comm (L : E ≃L[𝕜] F) (φ : X → E) : ∫ x, L (φ x) ∂μ = L (∫ x, φ x ∂μ)

{X : Type u_1}
{E : Type u_3}
{F : Type u_4}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{𝕜 : Type u_5}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace ℝ F]
[NormedSpace ℝ E]
(L : E ≃L[𝕜] F)
(φ : X → E)

∫ (x : X), L (φ x) ∂μ = L (∫ (x : X), φ x ∂μ)


/-- `TotalBLE le` asserts that `le` has a total order, that is, `le a b ∨ le b a`. -/
class TotalBLE (le : α → α → Bool) : Prop where
  /-- `le` is total: either `le a b` or `le b a`. -/
  total : le a b ∨ le b a

{α : Sort u_1}
{le : α → α → Bool}
[self : Batteries.TotalBLE le]
{a b : α}


@[simp]
lemma image_subtype_val_Iic_Iic {a : α} (b : Iic a) : Subtype.val '' Iic b = Iic b.1

{α : Type u_1}
[Preorder α]
{a : α}
(b : ↑(Set.Iic a))


protected theorem add_lt_add_iff_right {x y z : PartENat} (hz : z ≠ ⊤) : x + z < y + z ↔ x < y


theorem uniformContinuous_coe : UniformContinuous ι

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)


theorem le_arch (a : ℤ√d) : ∃ n : ℕ, a ≤ n


theorem preimage_asSubtype (f : α →. β) (s : Set β) :
    f.asSubtype ⁻¹' s = Subtype.val ⁻¹' f.preimage s

{α : Type u_1}
{β : Type u_2}
(f : α →. β)
(s : Set β)


@[norm_cast]
theorem le_to_nat {m n : PosNum} : (m : ℕ) ≤ n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ n


theorem MeasurableSet.image_inclusion' {s t : Set α} (h : s ⊆ t) {u : Set s}
    (hs : MeasurableSet (Subtype.val ⁻¹' s : Set t)) (hu : MeasurableSet u) :
    MeasurableSet (inclusion h '' u)

(hs : MeasurableSet (Subtype.val ⁻¹' s))


theorem disjoint_cofinite_right : Disjoint l cofinite ↔ ∃ s ∈ l, Set.Finite s

Disjoint l Filter.cofinite ↔ ∃ s ∈ l, s.Finite


/-- `functoriality F _ ⋙ postcompose (whisker_left F _)` simplifies to `functoriality F _`. -/
@[simps!]
def functorialityCompPostcompose {H H' : C ⥤ D} (α : H ≅ H') :
    Cones.functoriality F H ⋙ Cones.postcompose (whiskerLeft F α.hom) ≅ Cones.functoriality F H'

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{F : J ⥤ C}
{H H' : C ⥤ D}
(α : H ≅ H')
(X : CategoryTheory.Limits.Cone F)

((CategoryTheory.Functor.functorialityCompPostcompose α).hom.app X).hom = α.hom.app X.pt


@[to_additive (attr := simp)]
theorem map_comp_inr (f : M →* M') (g : N →* N') : (map f g).comp inr = inr.comp g

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
(f : M →+ M')
(g : N →+ N')

(AddMonoid.Coprod.map f g).comp AddMonoid.Coprod.inr = AddMonoid.Coprod.inr.comp g


theorem LinearIsometry.contDiff (f : E →ₗᵢ[𝕜] F) : ContDiff 𝕜 n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(f : E →ₗᵢ[𝕜] F)


/-- The comonad induced by the Eilenberg-Moore adjunction is the original comonad. -/
@[simps!]
def adjToComonadIso (G : Comonad C) : G.adj.toComonad ≅ G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(G : CategoryTheory.Comonad C)
(X : C)

(CategoryTheory.Adjunction.adjToComonadIso G).hom.app X = CategoryTheory.CategoryStruct.id (G.obj X)


theorem sSup_eq_iSup {s : Set α} : sSup s = ⨆ a ∈ s, a

{α : Type u_1}
[CompleteLattice α]
{s : Set α}


@[simp]
theorem finSumFinEquiv_symm_last : finSumFinEquiv.symm (Fin.last n) = Sum.inr 0


theorem Decidable.not_and_iff_or_not_not' [Decidable b] : ¬(a ∧ b) ↔ ¬a ∨ ¬b

¬(a ∧ b) ↔ ¬a ∨ ¬b


theorem MeasurableSet.of_subtype_image {s : Set α} {t : Set s}
    (h : MeasurableSet (Subtype.val '' t)) : MeasurableSet t

{α : Type u_1}
{m : MeasurableSpace α}
{s : Set α}
{t : Set ↑s}
(h : MeasurableSet (Subtype.val '' t))


/-- `OrderDual` as a functor. -/
@[simps]
def dual : BddDistLat ⥤ BddDistLat

BddDistLat.dual.obj X = BddDistLat.of (↑X.toDistLat)ᵒᵈ


theorem Integrable.withDensityᵥ_eq_iff {f g : α → E} (hf : Integrable f μ) (hg : Integrable g μ) :
    μ.withDensityᵥ f = μ.withDensityᵥ g ↔ f =ᵐ[μ] g

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f g : α → E}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


@[simp]
theorem lintegral_indicator_one₀ {s : Set α} (hs : NullMeasurableSet s μ) :
    ∫⁻ a, s.indicator 1 a ∂μ = μ s

(hs : MeasureTheory.NullMeasurableSet s μ)


@[simp]
theorem dual_pure (a : α) : dual (pure a) = pure (toDual a)

NonemptyInterval.dual (NonemptyInterval.pure a) = NonemptyInterval.pure (OrderDual.toDual a)


/-- The map `(x, y) ↦ (xy, y)` preserves the measure `μ × ν`. -/
@[to_additive measurePreserving_add_prod
" The map `(x, y) ↦ (x + y, y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_mul_prod [IsMulRightInvariant μ] :
    MeasurePreserving (fun z : G × G => (z.1 * z.2, z.2)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[μ.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.1 * z.2, z.2)) (μ.prod ν) (μ.prod ν)


theorem cmp_eq_eq_symm [OrientedCmp cmp] : cmp x y = .eq ↔ cmp y x = .eq

∀ {α : Sort u_1} {cmp : α → α → Ordering} {x y : α} [inst : Batteries.OrientedCmp cmp],
  cmp x y = Ordering.eq ↔ cmp y x = Ordering.eq


theorem Q_is_eventually_constant {q n : ℕ} (hqn : n ≤ q) :
    ((Q (q + 1)).f n : X _[n] ⟶ _) = (Q q).f n

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
{q n : ℕ}
(hqn : n ≤ q)

(AlgebraicTopology.DoldKan.Q (q + 1)).f n = (AlgebraicTopology.DoldKan.Q q).f n


/--
An isomorphism in `Dial C` can be induced by isomorphisms on the source and target,
which respect the respective relations on `X` and `Y`.
-/
@[simps] def isoMk {X Y : Dial C} (e₁ : X.src ≅ Y.src) (e₂ : X.tgt ≅ Y.tgt)
    (eq : X.rel = (Subobject.pullback (prod.map e₁.hom e₂.hom)).obj Y.rel) : X ≅ Y

(eq : X.rel = (CategoryTheory.Subobject.pullback (CategoryTheory.Limits.prod.map e₁.hom e₂.hom)).obj Y.rel)

(CategoryTheory.Dial.isoMk e₁ e₂ eq).inv.F = CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd e₂.hom


/-- Adjoins a `⊥` to the domain and codomain of a `LatticeHom`. -/
@[simps]
protected def withBot (f : LatticeHom α β) : LatticeHom (WithBot α) (WithBot β)

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)
(a : WithBot α)


protected theorem measurableSet_lt_of_countable' [Countable ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[hτ.measurableSpace] {ω | τ ω < i}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[Countable ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)


/-- Forgetting to the underlying type and then building the bundled object returns the original
module. -/
@[simps]
def ofSelfIso (M : ModuleCat R) : ModuleCat.of R M ≅ M


@[simp]
theorem preimage_comp (f : β →. γ) (g : α →. β) (s : Set γ) :
    (f.comp g).preimage s = g.preimage (f.preimage s)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : β →. γ)
(g : α →. β)
(s : Set γ)


@[to_additive (attr := mono)]
theorem smul_finset_subset_smul_finset : s ⊆ t → a • s ⊆ a • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s t : Finset β}
{a : α}


theorem Prime.coprime_pow_of_not_dvd {p m a : ℕ} (pp : Prime p) (h : ¬p ∣ a) : Coprime a (p ^ m)

{p m a : ℕ}
(pp : Nat.Prime p)
(h : ¬p ∣ a)


@[simp] theorem nndist_ofDual (a b : Xᵒᵈ) : nndist (ofDual a) (ofDual b) = nndist a b

{X : Type u_1}
[PseudoMetricSpace X]
(a b : Xᵒᵈ)

nndist (OrderDual.ofDual a) (OrderDual.ofDual b) = nndist a b


/-- "A special case of `Multipliable.map_iff_of_leftInverse` for convenience" -/
@[to_additive "A special case of `Summable.map_iff_of_leftInverse` for convenience"]
protected theorem Multipliable.map_iff_of_equiv [CommMonoid γ] [TopologicalSpace γ] {G}
    [EquivLike G α γ] [MulEquivClass G α γ] (g : G) (hg : Continuous g)
    (hg' : Continuous (EquivLike.inv g : γ → α)) : Multipliable (g ∘ f) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
[AddCommMonoid γ]
[TopologicalSpace γ]
{G : Type u_5}
[EquivLike G α γ]
[AddEquivClass G α γ]
(g : G)
(hg : Continuous ⇑g)
(hg' : Continuous (EquivLike.inv g))


@[to_additive sum_lt_sum_of_subset]
theorem prod_lt_prod_of_subset' (h : s ⊆ t) {i : ι} (ht : i ∈ t) (hs : i ∉ s) (hlt : 1 < f i)
    (hle : ∀ j ∈ t, j ∉ s → 1 ≤ f j) : ∏ j ∈ s, f j < ∏ j ∈ t, f j

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelAddCommMonoid M]
{f : ι → M}
{s t : Finset ι}
(h : s ⊆ t)
{i : ι}
(ht : i ∈ t)
(hs : i ∉ s)
(hlt : 0 < f i)
(hle : ∀ j ∈ t, j ∉ s → 0 ≤ f j)


@[simp]
theorem order_one [MulZeroOneClass R] : order (1 : HahnSeries Γ R) = 0

{Γ : Type u_1}
{R : Type u_3}
[Zero Γ]
[PartialOrder Γ]
[MulZeroOneClass R]


theorem lintegral_indicator_const {s : Set α} (hs : MeasurableSet s) (c : ℝ≥0∞) :
    ∫⁻ a, s.indicator (fun _ => c) a ∂μ = c * μ s

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(c : ℝ≥0∞)

∫⁻ (a : α), s.indicator (fun x => c) a ∂μ = c * μ s


/-- The image of a commutative square by a functor. -/
@[simps]
def map (sq : Square C) (F : C ⥤ D) : Square D

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
(sq : CategoryTheory.Square C)
(F : CategoryTheory.Functor C D)


@[reassoc (attr := simp)]
lemma s_r (s : S.Splitting) : s.s ≫ s.r = 0

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(s : S.Splitting)

CategoryTheory.CategoryStruct.comp s.s s.r = 0


theorem Integrable.integral_norm_condKernel {f : α × Ω → F} (hf_int : Integrable f ρ) :
    Integrable (fun x ↦ ∫ y, ‖f (x, y)‖ ∂ρ.condKernel x) ρ.fst

{α : Type u_1}
{Ω : Type u_2}
{F : Type u_4}
{mα : MeasurableSpace α}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
[NormedAddCommGroup F]
{ρ : MeasureTheory.Measure (α × Ω)}
[MeasureTheory.IsFiniteMeasure ρ]
{f : α × Ω → F}
(hf_int : MeasureTheory.Integrable f ρ)

MeasureTheory.Integrable (fun x => ∫ (y : Ω), ‖f (x, y)‖ ∂ρ.condKernel x) ρ.fst


theorem _root_.Real.toNNReal_sum_of_nonneg {α} {s : Finset α} {f : α → ℝ}
    (hf : ∀ a, a ∈ s → 0 ≤ f a) :
    Real.toNNReal (∑ a ∈ s, f a) = ∑ a ∈ s, Real.toNNReal (f a)

{α : Type u_1}
{s : Finset α}
{f : α → ℝ}
(hf : ∀ a ∈ s, 0 ≤ f a)

(∑ a ∈ s, f a).toNNReal = ∑ a ∈ s, (f a).toNNReal


/-- A functor `F : C ⥤ D` which commutes with shift functors on `C` and `D` and preserves zero
morphisms can be lifted to a functor `DifferentialObject S C ⥤ DifferentialObject S D`. -/
@[simps]
def mapDifferentialObject (F : C ⥤ D)
    (η : (shiftFunctor C (1 : S)).comp F ⟶ F.comp (shiftFunctor D (1 : S)))
    (hF : ∀ c c', F.map (0 : c ⟶ c') = 0) : DifferentialObject S C ⥤ DifferentialObject S D

(η : (CategoryTheory.shiftFunctor C 1).comp F ⟶ F.comp (CategoryTheory.shiftFunctor D 1))

(X : CategoryTheory.DifferentialObject S C)

((CategoryTheory.Functor.mapDifferentialObject D F η hF).obj X).obj = F.obj X.obj


theorem upcrossingsBefore_mono (hab : a < b) : Monotone fun N ω => upcrossingsBefore a b f N ω

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
(hab : a < b)

Monotone fun N ω => MeasureTheory.upcrossingsBefore a b f N ω


/-- The category of sheaves taking values in Type is the same as the category of set-valued sheaves.
-/
@[simps]
def sheafEquivSheafOfTypes : Sheaf J (Type w) ≌ SheafOfTypes J

(J : CategoryTheory.GrothendieckTopology C)

∀ {X Y : CategoryTheory.SheafOfTypes J} (f : X ⟶ Y),
  ((CategoryTheory.sheafEquivSheafOfTypes J).inverse.map f).val = f.val


@[to_additive] lemma mabs_div_comm (a b : α) : |a / b|ₘ = |b / a|ₘ

{α : Type u_1}
[Lattice α]
[Group α]
(a b : α)


@[to_additive]
theorem toMap_injective_iff
    {M N : Type*} [CommMonoid M] {S : Submonoid M} [CommMonoid N] (f : LocalizationMap S N) :
    Injective (LocalizationMap.toMap f) ↔ ∀ ⦃x⦄, x ∈ S → IsLeftRegular x

{M : Type u_1}
{N : Type u_2}
[CommMonoid M]
{S : Submonoid M}
[CommMonoid N]
(f : S.LocalizationMap N)

Function.Injective ⇑f.toMap ↔ ∀ ⦃x : M⦄, x ∈ S → IsLeftRegular x


@[to_additive]
theorem FP.finset_prod {M} [CommMonoid M] (a : Stream' M) (s : Finset ℕ) (hs : s.Nonempty) :
    (s.prod fun i => a.get i) ∈ FP a

{M : Type u_1}
[CommMonoid M]
(a : Stream' M)
(s : Finset ℕ)
(hs : s.Nonempty)


theorem isPWO_iUnion_support_powers [LinearOrderedCancelAddCommMonoid Γ] [Ring R] [IsDomain R]
    {x : HahnSeries Γ R} (hx : 0 < x.orderTop) : (⋃ n : ℕ, (x ^ n).support).IsPWO

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedCancelAddCommMonoid Γ]
[Ring R]
[IsDomain R]
{x : HahnSeries Γ R}
(hx : 0 < x.orderTop)


/-- A space is totally disconnected iff its connected components are subsingletons. -/
theorem totallyDisconnectedSpace_iff_connectedComponent_subsingleton :
    TotallyDisconnectedSpace α ↔ ∀ x : α, (connectedComponent x).Subsingleton

TotallyDisconnectedSpace α ↔ ∀ (x : α), (connectedComponent x).Subsingleton


lemma bot_div_of_pos_ne_top {a : EReal} (h : 0 < a) (h' : a ≠ ⊤) : ⊥ / a = ⊥


@[simp] lemma one_lt_exp_iff {a : EReal} : 1 < exp a ↔ 0 < a


theorem frequently_iff {f : Filter α} {P : α → Prop} :
    (∃ᶠ x in f, P x) ↔ ∀ {U}, U ∈ f → ∃ x ∈ U, P x

{α : Type u}
{f : Filter α}
{P : α → Prop}

(∃ᶠ (x : α) in f, P x) ↔ ∀ {U : Set α}, U ∈ f → ∃ x ∈ U, P x


@[simp]
theorem binary_fan_fst_toCone (c : BinaryBicone P Q) : BinaryFan.fst c.toCone = c.fst

(c : CategoryTheory.Limits.BinaryBicone P Q)

CategoryTheory.Limits.BinaryFan.fst c.toCone = c.fst


theorem sin_int_mul_pi (n : ℤ) : sin (n * π) = 0


theorem tensor_sum {P Q R S : C} {J : Type*} (s : Finset J) (f : P ⟶ Q) (g : J → (R ⟶ S)) :
    (f ⊗ ∑ j ∈ s, g j) = ∑ j ∈ s, f ⊗ g j

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalPreadditive C]
{P Q R S : C}
{J : Type u_2}
(s : Finset J)
(f : P ⟶ Q)
(g : J → (R ⟶ S))

CategoryTheory.MonoidalCategory.tensorHom f (∑ j ∈ s, g j) = ∑ j ∈ s, CategoryTheory.MonoidalCategory.tensorHom f (g j)


@[to_additive]
protected theorem one_mul (x : R[S⁻¹]) : 1 * x = x

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
(x : AddOreLocalization S R)


lemma algebraMap_nonneg (ha : 0 ≤ a) : 0 ≤ algebraMap α β a

{α : Type u_1}
(β : Type u_2)
[OrderedCommSemiring α]
[OrderedSemiring β]
[Algebra α β]
[SMulPosMono α β]
{a : α}
(ha : 0 ≤ a)


/-- In a separable space, a family of nonempty disjoint open sets is countable. -/
theorem _root_.Pairwise.countable_of_isOpen_disjoint [SeparableSpace α] {ι : Type*}
    {s : ι → Set α} (hd : Pairwise (Disjoint on s)) (ho : ∀ i, IsOpen (s i))
    (hne : ∀ i, (s i).Nonempty) : Countable ι

{α : Type u}
[t : TopologicalSpace α]
[TopologicalSpace.SeparableSpace α]
{ι : Type u_2}
{s : ι → Set α}
(hd : Pairwise (Disjoint on s))
(ho : ∀ (i : ι), IsOpen (s i))
(hne : ∀ (i : ι), (s i).Nonempty)


@[simp] theorem sub_imJ : (a - b).imJ = a.imJ - b.imJ

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a b : ℍ[R,c₁,c₂])


lemma addZ_neg {P : Fin 3 → R} : addZ P (W'.neg P) = 0

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}

WeierstrassCurve.Jacobian.addZ P (W'.neg P) = 0


@[simp]
theorem castSucc_lt_succ_iff {a b : Fin n} : castSucc a < succ b ↔ a ≤ b


@[simp]
theorem top_toLowerSet : (⊤ : Ideal P).toLowerSet = ⊤

{P : Type u_1}
[LE P]
[IsDirected P fun x x_1 => x ≤ x_1]
[Nonempty P]


@[simp]
theorem deriv_cosh : deriv cosh = sinh


theorem mul_smul (b b' : B) (x : X') : (b * b') • x = b • b' • x

(x : Grp.SurjectiveOfEpiAuxs.XWithInfinity f)


/-- When `sInf s < b`, there is an element `a` in `s` with `a < b`, if `s` is nonempty and the order
is a linear order. -/
theorem exists_lt_of_csInf_lt (hs : s.Nonempty) (hb : sInf s < b) : ∃ a ∈ s, a < b

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
{b : α}
(hs : s.Nonempty)
(hb : sInf s < b)


/-- The **Chevalley–Warning theorem**, unary version.
Let `f` be a multivariate polynomial in finitely many variables (`X s`, `s : σ`)
over a finite field of characteristic `p`.
Assume that the total degree of `f` is less than the cardinality of `σ`.
Then the number of solutions of `f` is divisible by `p`.
See `char_dvd_card_solutions_of_sum_lt` for a version that takes a family of polynomials `f i`. -/
theorem char_dvd_card_solutions {f : MvPolynomial σ K} (h : f.totalDegree < Fintype.card σ) :
    p ∣ Fintype.card { x : σ → K // eval x f = 0 }

{K : Type u_1}
{σ : Type u_2}
[Fintype K]
[Field K]
[Fintype σ]
[DecidableEq σ]
[DecidableEq K]
(p : ℕ)
[CharP K p]
{f : MvPolynomial σ K}
(h : f.totalDegree < Fintype.card σ)

p ∣ Fintype.card { x // (MvPolynomial.eval x) f = 0 }


theorem nonneg_iff {z : ℂ} : 0 ≤ z ↔ 0 ≤ z.re ∧ 0 = z.im


@[simp]
theorem mapIso_refl (f : X ⟶ Y) (h) : mapIso f f h = Iso.refl (map _)

TopologicalSpace.Opens.mapIso f f h = CategoryTheory.Iso.refl (TopologicalSpace.Opens.map f)


@[simp] theorem and_cons : (a::l).and = (a && l.and)


theorem map_not_measurable {f : α → β} (hf : ¬Measurable f) : v.map f = 0

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
(v : MeasureTheory.VectorMeasure α M)
{f : α → β}
(hf : ¬Measurable f)


@[simp]
theorem degree_eq_bot : degree p = ⊥ ↔ p = 0


theorem aecover_Ioi_of_Ioi : AECover (μ.restrict (Ioi A)) l fun i ↦ Ioi (a i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a : ι → α}
{A : α}
(ha : Filter.Tendsto a l (𝓝 A))

MeasureTheory.AECover (μ.restrict (Set.Ioi A)) l fun i => Set.Ioi (a i)


/-- The exponential characteristic is positive. -/
theorem expChar_pos (q : ℕ) [ExpChar R q] : 0 < q

(R : Type u)
[Semiring R]
(q : ℕ)
[ExpChar R q]


/-- See also `Finset.prod_apply`, with the same conclusion but with the weaker hypothesis
`f : α → β → γ` -/
@[to_additive (attr := simp)
  "See also `Finset.sum_apply`, with the same conclusion but with the weaker hypothesis
  `f : α → β → γ`"]
theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α)
    (b : β) : (∏ x ∈ s, f x) b = ∏ x ∈ s, f x b

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[MulOneClass β]
[CommMonoid γ]
(f : α → β →* γ)
(s : Finset α)
(b : β)


theorem reverse_surjective {u v : V} : Function.Surjective (reverse : G.Walk u v → _)

{V : Type u}
{G : SimpleGraph V}
{u v : V}


/-- A natural isomorphism between functors induces a natural isomorphism
between those functors applied to homological complexes.
-/
@[simps!]
def NatIso.mapHomologicalComplex {F G : W₁ ⥤ W₂} [F.PreservesZeroMorphisms]
    [G.PreservesZeroMorphisms] (α : F ≅ G) (c : ComplexShape ι) :
    F.mapHomologicalComplex c ≅ G.mapHomologicalComplex c

((CategoryTheory.NatIso.mapHomologicalComplex α c).hom.app C).f i = α.hom.app (C.X i)


theorem IsDiag.map [Zero α] [Zero β] {A : Matrix n n α} (ha : A.IsDiag) {f : α → β} (hf : f 0 = 0) :
    (A.map f).IsDiag

{α : Type u_1}
{β : Type u_2}
{n : Type u_4}
[Zero α]
[Zero β]
{A : Matrix n n α}
(ha : A.IsDiag)
{f : α → β}
(hf : f 0 = 0)


private nonrec theorem one_mul (x : ⨁ i, A i) : 1 * x = x

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
(x : DirectSum ι fun i => A i)


/-- A version of `Iff.mp Sigma.ext_iff` for functions from a nonempty type to a sigma type. -/
theorem _root_.Function.eq_of_sigmaMk_comp {γ : Type*} [Nonempty γ]
    {a b : α} {f : γ → β a} {g : γ → β b} (h : Sigma.mk a ∘ f = Sigma.mk b ∘ g) :
    a = b ∧ HEq f g

{α : Type u_1}
{β : α → Type u_4}
{γ : Type u_7}
[Nonempty γ]
{a b : α}
{f : γ → β a}
{g : γ → β b}
(h : Sigma.mk a ∘ f = Sigma.mk b ∘ g)


theorem castpred_succ_le_iff {a b : Fin (n + 1)} (ha : succ a ≠ last (n + 1)) :
    (succ a).castPred ha ≤ b ↔ a < b

{n : ℕ}
{a b : Fin (n + 1)}
(ha : a.succ ≠ Fin.last (n + 1))


/-- The closure of the interval `(a, b]` is the closed interval `[a, b]`. -/
@[simp]
theorem closure_Ioc {a b : α} (hab : a ≠ b) : closure (Ioc a b) = Icc a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(hab : a ≠ b)


theorem IsStrictOrder.swap (r) [IsStrictOrder α r] : IsStrictOrder α (swap r)

{α : Type u}
(r : α → α → Prop)
[IsStrictOrder α r]


/-- If `s` is a measurable set in a standard Borel space, there is a compatible Polish topology
making `s` clopen. -/
theorem _root_.MeasurableSet.isClopenable' {s : Set α} (hs : MeasurableSet s) :
    ∃ _ : TopologicalSpace α, BorelSpace α ∧ PolishSpace α ∧ IsClosed s ∧ IsOpen s

{α : Type u_1}
[MeasurableSpace α]
[StandardBorelSpace α]
{s : Set α}
(hs : MeasurableSet s)

∃ x, BorelSpace α ∧ PolishSpace α ∧ IsClosed s ∧ IsOpen s


theorem IsMaxOn.max (hf : IsMaxOn f s a) (hg : IsMaxOn g s a) :
    IsMaxOn (fun x => max (f x) (g x)) s a

{α : Type u}
{β : Type v}
[LinearOrder β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsMaxOn f s a)
(hg : IsMaxOn g s a)


theorem IsPrime.inf_le' {s : Finset ι} {f : ι → Ideal R} {P : Ideal R} (hp : IsPrime P) :
    s.inf f ≤ P ↔ ∃ i ∈ s, f i ≤ P

{R : Type u}
{ι : Type u_1}
[CommSemiring R]
{s : Finset ι}
{f : ι → Ideal R}
{P : Ideal R}
(hp : P.IsPrime)


lemma cutExpand_double {a a₁ a₂} (h₁ : r a₁ a) (h₂ : r a₂ a) : CutExpand r {a₁, a₂} {a}

{α : Type u_1}
{r : α → α → Prop}
{a a₁ a₂ : α}
(h₁ : r a₁ a)
(h₂ : r a₂ a)


theorem ne_of_true_of_false {a b : Prop} (ha : a) (hb : ¬b) : a ≠ b


theorem edist_naturalParameterization_eq_zero {f : α → E} {s : Set α}
    (hf : LocallyBoundedVariationOn f s) {a : α} (as : a ∈ s) {b : α} (bs : b ∈ s) :
    edist (naturalParameterization f s a (variationOnFromTo f s a b)) (f b) = 0

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{f : α → E}
{s : Set α}
(hf : LocallyBoundedVariationOn f s)
{a : α}
(as : a ∈ s)
{b : α}
(bs : b ∈ s)


@[simp]
theorem mem_singleton (x y : α) (b : β y) : x ∈ singleton y b ↔ x = y

{α : Type u}
{β : α → Type v}
(x y : α)
(b : β y)


@[simp]
theorem type_cardinal : @type Cardinal (· < ·) _ = Ordinal.univ.{u, u + 1}

(Ordinal.type fun x x_1 => x < x_1) = Ordinal.univ.{u, u + 1}


@[to_additive]
theorem mulAntidiagonal_mono_right (h : t₁ ⊆ t₂) :
    mulAntidiagonal s t₁ a ⊆ mulAntidiagonal s t₂ a

{α : Type u_1}
[Mul α]
{s t₁ t₂ : Set α}
{a : α}
(h : t₁ ⊆ t₂)

s.mulAntidiagonal t₁ a ⊆ s.mulAntidiagonal t₂ a


theorem support_deriv_subset : support (deriv f) ⊆ tsupport f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}


@[simp]
theorem map_valEmbedding_Iic : (Iic b).map Fin.valEmbedding = Iic ↑b

Finset.map Fin.valEmbedding (Finset.Iic b) = Finset.Iic ↑b


@[simp]
theorem id_apply (a : α) : ContinuousOpenMap.id α a = a

{α : Type u_2}
[TopologicalSpace α]
(a : α)


@[simp, norm_cast]
theorem coe_singleton (a : α) : (({a} : Finset α) : Set α) = {a}


lemma EquicontinuousOn.mono {F : ι → X → α} {S T : Set X}
    (H : EquicontinuousOn F T) (hST : S ⊆ T) : EquicontinuousOn F S

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{S T : Set X}
(H : EquicontinuousOn F T)
(hST : S ⊆ T)


theorem _root_.CategoryTheory.MorphismProperty.Q_inverts : W.IsInvertedBy W.Q

{C : Type uC}
[CategoryTheory.Category.{uC', uC} C]
(W : CategoryTheory.MorphismProperty C)


theorem measurable_find {p : α → ℕ → Prop} [∀ x, DecidablePred (p x)] (hp : ∀ x, ∃ N, p x N)
    (hm : ∀ k, MeasurableSet { x | p x k }) : Measurable fun x => Nat.find (hp x)

(hm : ∀ (k : ℕ), MeasurableSet {x | p x k})


lemma ringChar_of_prime_eq_zero [Nontrivial R] {p : ℕ} (hprime : Nat.Prime p)
    (hp0 : (p : R) = 0) : ringChar R = p

{R : Type u_1}
[NonAssocSemiring R]
[Nontrivial R]
{p : ℕ}
(hprime : Nat.Prime p)
(hp0 : ↑p = 0)


/-- Predicate for an ordered topological space to be equipped with its Scott topology.

The Scott topology is defined as the join of the topology of upper sets and the Scott Hausdorff
topology. -/
class IsScott : Prop where
  topology_eq_scott : ‹TopologicalSpace α› = scott α

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[self : Topology.IsScott α]


theorem isTorsionBy_quotient_iff (N : Submodule R M) (r : R) :
    IsTorsionBy R (M⧸N) r ↔ ∀ x, r • x ∈ N

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(N : Submodule R M)
(r : R)

Module.IsTorsionBy R (M ⧸ N) r ↔ ∀ (x : M), r • x ∈ N


theorem degree_smul_le (a : R) (p : R[X]) : degree (a • p) ≤ degree p

{R : Type u}
[Semiring R]
(a : R)
(p : R[X])


theorem IsSupFiniteCompact.isSupClosedCompact (h : IsSupFiniteCompact α) :
    IsSupClosedCompact α

(h : CompleteLattice.IsSupFiniteCompact α)


/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem distribMulActionHom_ext' {f g : (α →₀ M) →+[R] N}
    (h : ∀ a : α, f.comp (DistribMulActionHom.single a) = g.comp (DistribMulActionHom.single a)) :
    f = g

(h : ∀ (a : α), f.comp (Finsupp.DistribMulActionHom.single a) = g.comp (Finsupp.DistribMulActionHom.single a))


theorem Integrable.simpleFunc_mul' (hm : m ≤ m0) (g : @SimpleFunc X m ℝ) (hf : Integrable f μ) :
    Integrable (⇑g * f) μ

{X : Type u_1}
{f : X → ℝ}
{m m0 : MeasurableSpace X}
{μ : MeasureTheory.Measure X}
(hm : m ≤ m0)
(g : MeasureTheory.SimpleFunc X ℝ)
(hf : MeasureTheory.Integrable f μ)


lemma pred_add_self (n : ℕ) : pred n + n = (2 * n).pred


@[reassoc]
lemma restriction_d_eq {i j : ι} {i' j' : ι'} (hi : e.f i = i') (hj : e.f j = j') :
    (K.restriction e).d i j = (K.restrictionXIso e hi).hom ≫ K.d i' j' ≫
      (K.restrictionXIso e hj).inv


theorem IsBigOWith.sub (h₁ : IsBigOWith c₁ l f₁ g) (h₂ : IsBigOWith c₂ l f₂ g) :
    IsBigOWith (c₁ + c₂) l (fun x => f₁ x - f₂ x) g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{c₁ c₂ : ℝ}
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h₁ : Asymptotics.IsBigOWith c₁ l f₁ g)
(h₂ : Asymptotics.IsBigOWith c₂ l f₂ g)

Asymptotics.IsBigOWith (c₁ + c₂) l (fun x => f₁ x - f₂ x) g


@[simp]
theorem quot_right_distrib_sub (x y z : PGame) : (⟦(y - z) * x⟧ : Game) = ⟦y * x⟧ - ⟦z * x⟧


theorem epi_of_epi_of_epi_of_mono (hR₁ : R₁.Exact) (hR₂ : R₂.Exact)
    (h₀ : Epi (app' φ 0)) (h₂ : Epi (app' φ 2)) (h₃ : Mono (app' φ 3)) :
    Epi (app' φ 1)

{R₁ R₂ : CategoryTheory.ComposableArrows C 3}

(h₀ : CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 0 ⋯))

(h₂ : CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 2 ⋯))

(h₃ : CategoryTheory.Mono (CategoryTheory.ComposableArrows.app' φ 3 ⋯))

CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 1 ⋯)


theorem convexHull_multiset_sum (s : Multiset (Set E)) :
    convexHull R s.sum = (s.map <| convexHull R).sum

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(s : Multiset (Set E))

(convexHull R) s.sum = (Multiset.map (⇑(convexHull R)) s).sum


theorem Iso.symm_apply_reachable {G : SimpleGraph V} {G' : SimpleGraph V'} {φ : G ≃g G'} {u : V}
    {v : V'} : G.Reachable (φ.symm v) u ↔ G'.Reachable v (φ u)

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{φ : G ≃g G'}
{u : V}
{v : V'}


theorem cons_merge_cons (s : α → α → Bool) (a b l r) :
  merge s (a::l) (b::r) = if s a b then a :: merge s l (b::r) else b :: merge s (a::l) r

{α : Type u_1}
(s : α → α → Bool)
(a b : α)
(l r : List α)

List.merge s (a :: l) (b :: r) = if s a b = true then a :: List.merge s l (b :: r) else b :: List.merge s (a :: l) r


@[deprecated getElem_set_ne (since := "2024-06-12")]
theorem get_set_ne {l : List α} {i j : Nat} (h : i ≠ j) {a : α}
    (hj : j < (l.set i a).length) :
    (l.set i a).get ⟨j, hj⟩ = l.get ⟨j, by simp at hj; exact hj⟩

{α : Type u_1}
{l : List α}
{i j : Nat}
(h : i ≠ j)
{a : α}
(hj : j < (l.set i a).length)


theorem extremePoints_convexHull_subset : (convexHull 𝕜 A).extremePoints 𝕜 ⊆ A

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[DenselyOrdered 𝕜]
[NoZeroSMulDivisors 𝕜 E]
{A : Set E}

Set.extremePoints 𝕜 ((convexHull 𝕜) A) ⊆ A


theorem not_tendsto_const_atBot [Preorder α] [NoMinOrder α] (x : α) (l : Filter β) [l.NeBot] :
    ¬Tendsto (fun _ => x) l atBot

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[NoMinOrder α]
(x : α)
(l : Filter β)
[l.NeBot]

¬Filter.Tendsto (fun x_1 => x) l Filter.atBot


@[simp]
theorem span_pair_add_mul_left {R : Type u} [CommRing R] {x y : R} (z : R) :
    (span {x + y * z, y} : Ideal R) = span {x, y}

Ideal.span {x + y * z, y} = Ideal.span {x, y}


theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
    HasStrictDerivAt (fun y => x ^ y) (x ^ y * log x) y

HasStrictDerivAt (fun y => x ^ y) (x ^ y * Complex.log x) y


theorem mem_sInter {x y : Class.{u}} (h : x.Nonempty) : y ∈ ⋂₀ x ↔ ∀ z, z ∈ x → y ∈ z

y ∈ ⋂₀ x ↔ ∀ z ∈ x, y ∈ z


/--
The categories of coherent sheaves and extensive sheaves on `C` are equivalent if `C` is
preregular, finitary extensive, and every object is projective.
-/
@[simps]
def coherentExtensiveEquivalence [Preregular C] [FinitaryExtensive C] [∀ (X : C), Projective X] :
    Sheaf (coherentTopology C) A ≌ Sheaf (extensiveTopology C) A

[∀ (X : C), CategoryTheory.Projective X]

(F : CategoryTheory.Sheaf (CategoryTheory.extensiveTopology C) A)

(CategoryTheory.Presheaf.coherentExtensiveEquivalence.inverse.obj F).val = F.val


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)

∀ {X Y : CategoryTheory.Comma L R₂} (f : X ⟶ Y), ((CategoryTheory.Comma.mapRightIso L i).inverse.map f).right = f.right


lemma isZero_single_obj_homology (A : C) (i : ι) (hi : i ≠ j) :
    IsZero (((single C c j).obj A).homology i)

CategoryTheory.Limits.IsZero (((HomologicalComplex.single C c j).obj A).homology i)


theorem image_neg_Ici : Neg.neg '' Ici a = Iic (-a)

{α : Type u_1}
[OrderedAddCommGroup α]
(a : α)


/-- A set of points is cospherical if and only if they lie in some sphere. -/
theorem cospherical_iff_exists_sphere {ps : Set P} :
    Cospherical ps ↔ ∃ s : Sphere P, ps ⊆ (s : Set P)

{P : Type u_2}
[MetricSpace P]
{ps : Set P}

EuclideanGeometry.Cospherical ps ↔ ∃ s, ps ⊆ Metric.sphere s.center s.radius


@[simp, norm_cast]
lemma rpow_intCast (x : ℝ≥0∞) (n : ℤ) : x ^ (n : ℝ) = x ^ n


@[to_additive]
theorem inl_injective : Injective (inl : M →* M ∗ N)

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]


lemma partialSups_apply {ι : Type*} {π : ι → Type*} [(i : ι) → SemilatticeSup (π i)]
    (f : ℕ → (i : ι) → π i) (n : ℕ) (i : ι) : partialSups f n i = partialSups (f · i) n

{ι : Type u_2}
{π : ι → Type u_3}
[(i : ι) → SemilatticeSup (π i)]
(f : ℕ → (i : ι) → π i)
(n : ℕ)
(i : ι)

(partialSups f) n i = (partialSups fun x => f x i) n


theorem sup'_id_eq_csSup (s : Finset α) (hs) : s.sup' hs id = sSup s

{α : Type u_2}
[ConditionallyCompleteLattice α]
(s : Finset α)
(hs : s.Nonempty)


theorem F_union_I : (IF.F : Set P) ∪ IF.I = Set.univ

{P : Type u_1}
[Preorder P]
(IF : Order.Ideal.PrimePair P)


theorem infinite_iff_not_exists_st {x : ℝ*} : Infinite x ↔ ¬∃ r : ℝ, IsSt x r


theorem HasSubset.Subset.eventuallyLE {α} {l : Filter α} {s t : Set α} (h : s ⊆ t) : s ≤ᶠ[l] t

{α : Type u_1}
{l : Filter α}
{s t : Set α}
(h : s ⊆ t)


@[simp]
theorem Ioo_insert_left (h : a < b) : insert a (Ioo a b) = Ico a b

{α : Type u_1}
[PartialOrder α]
{a b : α}
(h : a < b)


@[simp]
theorem strictMono_toDual_comp_iff : StrictMono (toDual ∘ f : α → βᵒᵈ) ↔ StrictAnti f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}

StrictMono (⇑OrderDual.toDual ∘ f) ↔ StrictAnti f


theorem compl_mem_generateMeasurableRec {s : Set (Set α)} {i j : ω₁} (h : j < i) {t : Set α}
    (ht : t ∈ generateMeasurableRec s j) : tᶜ ∈ generateMeasurableRec s i

{i j : (Quotient.out (Cardinal.aleph 1).ord).α}

(ht : t ∈ MeasurableSpace.generateMeasurableRec s j)

tᶜ ∈ MeasurableSpace.generateMeasurableRec s i


theorem opow_omega {a : Ordinal} (a1 : 1 < a) (h : a < omega) : (a^omega) = omega

{a : Ordinal.{u_1}}
(a1 : 1 < a)
(h : a < Ordinal.omega)


theorem one_mem_inv_coe_ideal [IsDomain A] {I : Ideal A} (hI : I ≠ ⊥) :
    (1 : K) ∈ (I : FractionalIdeal A⁰ K)⁻¹

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
[IsDomain A]
{I : Ideal A}
(hI : I ≠ ⊥)


theorem uniq_cocone_morphism {s t : Cocone F} (h : IsColimit t) {f f' : t ⟶ s} : f = f'

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s t : CategoryTheory.Limits.Cocone F}
(h : CategoryTheory.Limits.IsColimit t)
{f f' : t ⟶ s}


@[simp]
theorem ofBoolAlg_symm_eq : (@ofBoolAlg α).symm = toBoolAlg


/-- Every simple lattice is isomorphic to `Bool`, regardless of order. -/
@[simps]
def equivBool {α} [DecidableEq α] [LE α] [BoundedOrder α] [IsSimpleOrder α] : α ≃ Bool

{α : Type u_4}
[DecidableEq α]
[LE α]
[BoundedOrder α]
[IsSimpleOrder α]
(x : Bool)

IsSimpleOrder.equivBool.symm x = Bool.casesOn x ⊥ ⊤


theorem lebesgue_number_lemma_of_metric_sUnion {s : Set α} {c : Set (Set α)} (hs : IsCompact s)
    (hc₁ : ∀ t ∈ c, IsOpen t) (hc₂ : s ⊆ ⋃₀ c) : ∃ δ > 0, ∀ x ∈ s, ∃ t ∈ c, ball x δ ⊆ t

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{c : Set (Set α)}
(hs : IsCompact s)
(hc₁ : ∀ t ∈ c, IsOpen t)
(hc₂ : s ⊆ ⋃₀ c)

∃ δ > 0, ∀ x ∈ s, ∃ t ∈ c, Metric.ball x δ ⊆ t


@[deprecated map_pow (since := "2024-06-26")]
protected theorem map_pow (x : A) (n : ℕ) : φ (x ^ n) = φ x ^ n

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
(x : A)
(n : ℕ)


theorem le_minFac' {m n : ℕ} : n = 1 ∨ m ≤ minFac n ↔ ∀ p, 2 ≤ p → p ∣ n → m ≤ p

n = 1 ∨ m ≤ n.minFac ↔ ∀ (p : ℕ), 2 ≤ p → p ∣ n → m ≤ p


theorem sInf_lt_iff : sInf s < b ↔ ∃ a ∈ s, a < b

{α : Type u_1}
[CompleteLinearOrder α]
{s : Set α}
{b : α}


@[simp]
theorem pointwise_smul_toSubsemiring (m : M) (S : Subring R) :
    (m • S).toSubsemiring = m • S.toSubsemiring

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Ring R]
[MulSemiringAction M R]
(m : M)
(S : Subring R)


theorem hasDerivAtFilter_iff_tendsto :
    HasDerivAtFilter f f' x L ↔
      Tendsto (fun x' : 𝕜 => ‖x' - x‖⁻¹ * ‖f x' - f x - (x' - x) • f'‖) L (𝓝 0)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}

HasDerivAtFilter f f' x L ↔ Filter.Tendsto (fun x' => ‖x' - x‖⁻¹ * ‖f x' - f x - (x' - x) • f'‖) L (𝓝 0)


@[reassoc (attr := simp)]
theorem Subpresheaf.homOfLe_ι {G G' : Subpresheaf F} (h : G ≤ G') :
    Subpresheaf.homOfLe h ≫ G'.ι = G.ι

{G G' : CategoryTheory.GrothendieckTopology.Subpresheaf F}

CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe h ≫ G'.ι = G.ι


lemma ShortExact.moduleCat_exact_iff_function_exact :
    S.Exact ↔ Function.Exact S.f S.g

(S : CategoryTheory.ShortComplex (ModuleCat R))


@[simp]
theorem argmin_nil (f : α → β) : argmin f [] = none

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
(f : α → β)


/-- If `s` is a convex set, then `a • interior s + b • s ⊆ interior s` for all `0 < a`, `0 ≤ b`,
`a + b = 1`. See also `Convex.combo_interior_closure_subset_interior` for a stronger version. -/
theorem Convex.combo_interior_self_subset_interior {s : Set E} (hs : Convex 𝕜 s) {a b : 𝕜}
    (ha : 0 < a) (hb : 0 ≤ b) (hab : a + b = 1) : a • interior s + b • s ⊆ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{a b : 𝕜}
(ha : 0 < a)
(hb : 0 ≤ b)
(hab : a + b = 1)


@[to_additive]
theorem mul_one_eq_id : (· * (1 : M)) = id


/-- If 0 → M' → M → M'' → 0 is exact and M' and M'' are
finitely generated then so is M. -/
theorem fg_of_fg_map_of_fg_inf_ker {R M P : Type*} [Ring R] [AddCommGroup M] [Module R M]
    [AddCommGroup P] [Module R P] (f : M →ₗ[R] P) {s : Submodule R M}
    (hs1 : (s.map f).FG)
    (hs2 : (s ⊓ LinearMap.ker f).FG) : s.FG

{R : Type u_4}
{M : Type u_5}
{P : Type u_6}
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup P]
[Module R P]
(f : M →ₗ[R] P)
{s : Submodule R M}
(hs1 : (Submodule.map f s).FG)
(hs2 : (s ⊓ LinearMap.ker f).FG)


theorem eraseIdx_insertNth {v : Vector α n} {i : Fin (n + 1)} :
    eraseIdx i (insertNth a i v) = v

{n : ℕ}
{α : Type u_1}
{a : α}
{v : Mathlib.Vector α n}
{i : Fin (n + 1)}

Mathlib.Vector.eraseIdx i (Mathlib.Vector.insertNth a i v) = v


/-- Any connected object admits a hom from a Galois object. -/
lemma exists_hom_from_galois_of_connected (X : C) [IsConnected X] :
    ∃ (A : C) (_ : A ⟶ X), IsGalois A

(F : CategoryTheory.Functor C FintypeCat)

∃ A x, CategoryTheory.PreGaloisCategory.IsGalois A


@[simp] lemma ceilRoot_pow_self (hn : n ≠ 0) (a : ℕ) : ceilRoot n (a ^ n) = a


protected theorem map_traverse {α β γ} (g : α → G β) (f : β → γ) (x : σ ⊕ α) :
    (f <$> ·) <$> Sum.traverse g x = Sum.traverse (f <$> g ·) x

{σ : Type u}
{G : Type u → Type u}
[Applicative G]
[LawfulApplicative G]
{α : Type u_1}
{β γ : Type u}
(g : α → G β)
(f : β → γ)
(x : σ ⊕ α)

(fun x => f <$> x) <$> Sum.traverse g x = Sum.traverse (fun x => f <$> g x) x


@[simp, norm_cast]
theorem coe_inter (x y : ZFSet.{u}) : ↑(x ∩ y) = (x : Class.{u}) ∩ y


@[simp]
theorem withTop_comp (f : SupHom β γ) (g : SupHom α β) :
    (f.comp g).withTop = f.withTop.comp g.withTop

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[SemilatticeSup α]
[SemilatticeSup β]
[SemilatticeSup γ]
(f : SupHom β γ)
(g : SupHom α β)


private theorem asiegel_ne_0 : asiegel K a ≠ 0

(a : Matrix α β (NumberField.RingOfIntegers K))


/-- See also `Finset.prod_dite_eq`. -/
@[to_additive "See also `Finset.sum_dite_eq`."] lemma prod_dite_eq (i : ι) (f : ∀ j, i = j → α) :
    ∏ j, (if h : i = j then f j h else 1) = f i rfl

{ι : Type u_6}
{α : Type u_8}
[Fintype ι]
[AddCommMonoid α]
[DecidableEq ι]
(i : ι)
(f : (j : ι) → i = j → α)

(∑ j : ι, if h : i = j then f j h else 0) = f i ⋯


/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed

(partialFunEquivPointed.functor.obj X).point = none


lemma condexpKernel_apply_eq_condDistrib {ω : Ω} :
    condexpKernel μ m ω = @condDistrib Ω Ω Ω mΩ _ _ mΩ (m ⊓ mΩ) id id μ _ (id ω)

{Ω : Type u_1}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{ω : Ω}

(ProbabilityTheory.condexpKernel μ m) ω = (ProbabilityTheory.condDistrib id id μ) (id ω)


theorem continuousAt_iff (hg : Inducing g) {x : X} :
    ContinuousAt f x ↔ ContinuousAt (g ∘ f) x

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hg : Inducing g)
{x : X}


theorem fromTypes_cons {n} (α : Type u) (p : Fin n → Type u) (τ : Type u) :
    FromTypes (vecCons α p) τ = (α → FromTypes p τ)

{n : ℕ}
(α : Type u)
(p : Fin n → Type u)
(τ : Type u)

Function.FromTypes (Matrix.vecCons α p) τ = (α → Function.FromTypes p τ)


@[fun_prop]
theorem DifferentiableAt.add_const (hf : DifferentiableAt 𝕜 f x) (c : F) :
    DifferentiableAt 𝕜 (fun y => f y + c) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(hf : DifferentiableAt 𝕜 f x)
(c : F)


@[simp, norm_cast]
theorem coe_comp (g f : CentroidHom α) : ⇑(g.comp f) = g ∘ f

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(g f : CentroidHom α)


theorem exists_prime_factors (a : α) :
    a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
(a : α)

a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a


theorem zero_smul_subset (t : Set β) : (0 : Set α) • t ⊆ 0

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
(t : Set β)


/-- The power series expansion of `Complex.sinh`. -/
lemma hasSum_sinh (z : ℂ) : HasSum (fun n ↦ z ^ (2 * n + 1) / ↑(2 * n + 1)!) (sinh z)

HasSum (fun n => z ^ (2 * n + 1) / ↑(2 * n + 1)!) (Complex.sinh z)


@[simp]
theorem inv_hom_id_assoc (f : X ⟶ Y) [I : IsIso f] {Z} (g : Y ⟶ Z) : inv f ≫ f ≫ g = g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(f : X ⟶ Y)
[I : CategoryTheory.IsIso f]
{Z : C}
(g : Y ⟶ Z)

CategoryTheory.CategoryStruct.comp (CategoryTheory.inv f) (CategoryTheory.CategoryStruct.comp f g) = g


lemma equiv_shift {a : M} [HasSmallLocalizedShiftedHom.{w} W M X Y]
    [HasSmallLocalizedShiftedHom.{w} W M Y Y]
    (f : SmallShiftedHom.{w} W X Y a) (n a' : M) (h : a + n = a') :
    equiv W L (f.shift n a' h) = (L.commShiftIso n).hom.app X ≫ (equiv W L f)⟦n⟧' ≫
      (shiftFunctorAdd' D a n a' h).inv.app (L.obj Y)

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Y]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Y Y]

(f : CategoryTheory.Localization.SmallShiftedHom W X Y a)

(CategoryTheory.Localization.SmallShiftedHom.equiv W L) (f.shift n a' h) =
  CategoryTheory.CategoryStruct.comp ((L.commShiftIso n).hom.app X)
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.shiftFunctor D n).map ((CategoryTheory.Localization.SmallShiftedHom.equiv W L) f))
      ((CategoryTheory.shiftFunctorAdd' D a n a' h).inv.app (L.obj Y)))


/--
This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.
-/
class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K,
    NormedAlgebra ℝ K, CompleteSpace K where
  re : K →+ ℝ
  im : K →+ ℝ
  /-- Imaginary unit in `K`. Meant to be set to `0` for `K = ℝ`. -/
  I : K
  I_re_ax : re I = 0
  I_mul_I_ax : I = 0 ∨ I * I = -1
  re_add_im_ax : ∀ z : K, 𝓚 (re z) + 𝓚 (im z) * I = z
  ofReal_re_ax : ∀ r : ℝ, re (𝓚 r) = r
  ofReal_im_ax : ∀ r : ℝ, im (𝓚 r) = 0
  mul_re_ax : ∀ z w : K, re (z * w) = re z * re w - im z * im w
  mul_im_ax : ∀ z w : K, im (z * w) = re z * im w + im z * re w
  conj_re_ax : ∀ z : K, re (conj z) = re z
  conj_im_ax : ∀ z : K, im (conj z) = -im z
  conj_I_ax : conj I = -I
  norm_sq_eq_def_ax : ∀ z : K, ‖z‖ ^ 2 = re z * re z + im z * im z
  mul_im_I_ax : ∀ z : K, im z * im I = im z
  /-- only an instance in the `ComplexOrder` locale -/
  [toPartialOrder : PartialOrder K]
  le_iff_re_im {z w : K} : z ≤ w ↔ re z ≤ re w ∧ im z = im w
  -- note we cannot put this in the `extends` clause
  [toDecidableEq : DecidableEq K]

{K : semiOutParam (Type u_1)}
[self : RCLike K]
(z : K)

(algebraMap ℝ K) (RCLike.re z) + (algebraMap ℝ K) (RCLike.im z) * RCLike.I = z


lemma mk_eq_mk (x y : K) (hx hy) : (⟨x, hx⟩ : 𝓞 K) = ⟨y, hy⟩ ↔ x = y

{K : Type u_1}
[Field K]
(x y : K)
(hx : x ∈ integralClosure ℤ K)
(hy : y ∈ integralClosure ℤ K)


theorem lift_def (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r) (x : tsze R M) :
    lift f g hg hfg hgf x = f x.fst + g x.snd

(hfg : ∀ (r : R) (x : M), g (r •> x) = f r * g x)

(hgf : ∀ (r : R) (x : M), g (x <• r) = g x * f r)

(TrivSqZeroExt.lift f g hg hfg hgf) x = f x.fst + g x.snd


theorem coeff_eq_zero (hφ : IsHomogeneous φ n) {d : σ →₀ ℕ} (hd : d.degree ≠ n) :
    coeff d φ = 0

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
{φ : MvPolynomial σ R}
{n : ℕ}
(hφ : φ.IsHomogeneous n)
{d : σ →₀ ℕ}
(hd : d.degree ≠ n)


theorem swap_apply_of_ne_of_ne {a b x : α} : x ≠ a → x ≠ b → swap a b x = x

{α : Sort u_1}
[DecidableEq α]
{a b x : α}


theorem radical_top : (radical ⊤ : Ideal R) = ⊤


/-- Distance between the images of any two points is at most twice the norm of the function. -/
theorem dist_le_two_norm (x y : α) : dist (f x) (f y) ≤ 2 * ‖f‖

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)
(x y : α)


@[to_additive (attr := simp)]
lemma smul_set_disjoint_iff : Disjoint (a • s) (a • t) ↔ Disjoint s t

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s t : Set β}
{a : α}


lemma mono₂ (h : T.mor₁ = 0) : Mono T.mor₂

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


protected theorem GE.ge.le [LE α] {x y : α} (h : x ≥ y) : y ≤ x

{α : Type u_2}
[LE α]
{x y : α}
(h : x ≥ y)


theorem quadraticChar_zero : quadraticChar F 0 = 0

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]


theorem nilpotencyClass_zero_iff_subsingleton [IsNilpotent G] :
    Group.nilpotencyClass G = 0 ↔ Subsingleton G

{G : Type u_1}
[Group G]
[Group.IsNilpotent G]


@[to_additive]
theorem FP.singleton {M} [Semigroup M] (a : Stream' M) (i : ℕ) : a.get i ∈ FP a

{M : Type u_1}
[Semigroup M]
(a : Stream' M)
(i : ℕ)


theorem aeval_id_rename (f : σ → MvPolynomial τ R) (p : MvPolynomial σ R) :
    aeval id (rename f p) = aeval f p

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
(f : σ → MvPolynomial τ R)
(p : MvPolynomial σ R)

(MvPolynomial.aeval id) ((MvPolynomial.rename f) p) = (MvPolynomial.aeval f) p


theorem IsMin.not_supPrime (ha : IsMin a) : ¬SupPrime a

{α : Type u_2}
[SemilatticeSup α]
{a : α}
(ha : IsMin a)


theorem map_mul : map f (I * J) = map f I * map f J

{R : Type u}
{S : Type v}
{F : Type u_1}
[CommRing R]
[CommRing S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(I J : Ideal R)

Ideal.map f (I * J) = Ideal.map f I * Ideal.map f J


/-- If a Cauchy sequence of continuous linear map converges to a continuous linear map pointwise,
then it converges to the same map in norm. This lemma is used to prove that the space of continuous
linear maps is complete provided that the codomain is a complete space. -/
theorem tendsto_of_tendsto_pointwise_of_cauchySeq {f : ℕ → E' →SL[σ₁₂] F} {g : E' →SL[σ₁₂] F}
    (hg : Tendsto (fun n x => f n x) atTop (𝓝 g)) (hf : CauchySeq f) : Tendsto f atTop (𝓝 g)

{σ₁₂ : 𝕜 →+* 𝕜₂}

(hg : Filter.Tendsto (fun n x => (f n) x) Filter.atTop (𝓝 ⇑g))


@[to_additive (attr := simp, norm_cast) coe_pos]
theorem one_lt_coe [LT α] {a : α} : 1 < (a : WithTop α) ↔ 1 < a


theorem not_isSuccLimit [NoMinOrder α] : ¬IsSuccLimit a

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
[IsSuccArchimedean α]
[NoMinOrder α]


@[simp]
theorem restrict_smul {_m0 : MeasurableSpace α} (c : ℝ≥0∞) (μ : Measure α) (s : Set α) :
    (c • μ).restrict s = c • μ.restrict s

{α : Type u_2}
{_m0 : MeasurableSpace α}
(c : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
(s : Set α)


/--
If `X` is homotopy equivalent to `Y`, and `Y` is homotopy equivalent to `Z`, then `X` is homotopy
equivalent to `Z`.
-/
@[simps!]
def trans (h₁ : X ≃ₕ Y) (h₂ : Y ≃ₕ Z) : X ≃ₕ Z

{X : Type u}
{Y : Type v}
{Z : Type w}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(h₁ : X ≃ₕ Y)
(h₂ : Y ≃ₕ Z)

∀ (a : X), ↑(h₁.trans h₂) a = ↑h₂ (↑h₁ a)


/-- General fencing theorem for continuous functions with an estimate on the norm of the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that

* `‖f a‖ ≤ B a`;
* `f` and `B` have right derivatives `f'` and `B'` respectively at every point of `[a, b)`;
* the norm of `f'` is strictly less than `B'` whenever `‖f x‖ = B x`.

Then `‖f x‖ ≤ B x` everywhere on `[a, b]`. We use one-sided derivatives in the assumptions
to make this theorem work for piecewise differentiable functions.
-/
theorem image_norm_le_of_norm_deriv_right_lt_deriv_boundary' {f' : ℝ → E}
    (hf : ContinuousOn f (Icc a b)) (hf' : ∀ x ∈ Ico a b, HasDerivWithinAt f (f' x) (Ici x) x)
    {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

(hf' : ∀ x ∈ Set.Ico a b, HasDerivWithinAt f (f' x) (Set.Ici x) x)

(hB' : ∀ x ∈ Set.Ico a b, HasDerivWithinAt B (B' x) (Set.Ici x) x)

(bound : ∀ x ∈ Set.Ico a b, ‖f x‖ = B x → ‖f' x‖ < B' x)


theorem factors_prime_pow [Nontrivial α] {p : Associates α} (hp : Irreducible p) (k : ℕ) :
    factors (p ^ k) = WithTop.some (Multiset.replicate k ⟨p, hp⟩)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[Nontrivial α]
{p : Associates α}
(hp : Irreducible p)
(k : ℕ)

(p ^ k).factors = ↑(Multiset.replicate k ⟨p, hp⟩)


/-- Being integrally closed is preserved under injective algebra homomorphisms. -/
theorem AlgHom.isIntegrallyClosedIn (f : A →ₐ[R] B) (hf : Function.Injective f) :
    IsIntegrallyClosedIn R B → IsIntegrallyClosedIn R A

{R : Type u_1}
[CommRing R]
{A : Type u_2}
{B : Type u_3}
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : Function.Injective ⇑f)


theorem l_u_le_trans {x y z : β} (hxy : l (u x) ≤ y) (hyz : l (u y) ≤ z) : l (u x) ≤ z

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{x y z : β}
(hxy : l (u x) ≤ y)
(hyz : l (u y) ≤ z)


{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


theorem iCondIndepFun_iff_condexp_inter_preimage_eq_mul {β : ι → Type*}
    (m : ∀ x, MeasurableSpace (β x)) (f : ∀ i, Ω → β i) (hf : ∀ i, Measurable (f i)) :
    iCondIndepFun m' hm' m f μ ↔
      ∀ (S : Finset ι) {sets : ∀ i : ι, Set (β i)} (_H : ∀ i, i ∈ S → MeasurableSet[m i] (sets i)),
        (μ⟦⋂ i ∈ S, f i ⁻¹' sets i| m'⟧) =ᵐ[μ] ∏ i ∈ S, (μ⟦f i ⁻¹' sets i | m'⟧)

{Ω : Type u_1}
{ι : Type u_2}
{m' mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
{hm' : m' ≤ mΩ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{β : ι → Type u_5}
(m : (x : ι) → MeasurableSpace (β x))
(f : (i : ι) → Ω → β i)
(hf : ∀ (i : ι), Measurable (f i))

ProbabilityTheory.iCondIndepFun m' hm' m f μ ↔
  ∀ (S : Finset ι) {sets : (i : ι) → Set (β i)},
    (∀ i ∈ S, MeasurableSet (sets i)) →
      μ[(⋂ i ∈ S, f i ⁻¹' sets i).indicator fun ω => 1|m'] =ᵐ[μ] ∏ i ∈ S, μ[(f i ⁻¹' sets i).indicator fun ω => 1|m']


theorem bddDistLat_dual_comp_forget_to_distLat :
    BddDistLat.dual ⋙ forget₂ BddDistLat DistLat =
      forget₂ BddDistLat DistLat ⋙ DistLat.dual

BddDistLat.dual ⋙ CategoryTheory.forget₂ BddDistLat DistLat = CategoryTheory.forget₂ BddDistLat DistLat ⋙ DistLat.dual


/-- A constructor for chain maps between `α`-indexed chain complexes built using `ChainComplex.of`,
from a dependently typed collection of morphisms.
-/
@[simps]
def ofHom (f : ∀ i : α, X i ⟶ Y i) (comm : ∀ i : α, f (i + 1) ≫ d_Y i = d_X i ≫ f i) :
    of X d_X sq_X ⟶ of Y d_Y sq_Y

(comm : ∀ (i : α), f (i + 1) ≫ d_Y i = d_X i ≫ f i)

(ChainComplex.ofHom X d_X sq_X Y d_Y sq_Y f comm).f i = f i


@[simp]
theorem lookup_erase_ne {a a'} {s : AList β} (h : a ≠ a') : lookup a (erase a' s) = lookup a s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{s : AList β}
(h : a ≠ a')

AList.lookup a (AList.erase a' s) = AList.lookup a s


@[to_additive] lemma exists_mem_ne_one_of_prod_ne_one (h : l.prod ≠ 1) :
    ∃ x ∈ l, x ≠ (1 : M)

{M : Type u_4}
[Monoid M]
{l : List M}
(h : l.prod ≠ 1)


theorem mdifferentiableWithinAt_univ :
    MDifferentiableWithinAt I I' f univ x ↔ MDifferentiableAt I I' f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{x : M}

MDifferentiableWithinAt I I' f Set.univ x ↔ MDifferentiableAt I I' f x


@[simp] theorem smul_get (xs : IntList) (a : Int) (i : Nat) : (a * xs).get i = a * xs.get i

(xs : Lean.Omega.IntList)
(a : Int)
(i : Nat)


@[simp]
theorem length_sortedUniv (α) [Fintype α] [Encodable α] : (sortedUniv α).length = Fintype.card α

(α : Type u_2)
[Fintype α]
[Encodable α]

(Encodable.sortedUniv α).length = Fintype.card α


/-- The property satisfied by the circumsphere. -/
theorem circumsphere_unique_dist_eq {n : ℕ} (s : Simplex ℝ P n) :
    (s.circumsphere.center ∈ affineSpan ℝ (Set.range s.points) ∧
        Set.range s.points ⊆ s.circumsphere) ∧
      ∀ cs : Sphere P,
        cs.center ∈ affineSpan ℝ (Set.range s.points) ∧ Set.range s.points ⊆ cs →
          cs = s.circumsphere

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)

(s.circumsphere.center ∈ affineSpan ℝ (Set.range s.points) ∧
    Set.range s.points ⊆ Metric.sphere s.circumsphere.center s.circumsphere.radius) ∧
  ∀ (cs : EuclideanGeometry.Sphere P),
    cs.center ∈ affineSpan ℝ (Set.range s.points) ∧ Set.range s.points ⊆ Metric.sphere cs.center cs.radius →
      cs = s.circumsphere


theorem SemiconjBy.zpow_right {A X Y : M} (hx : IsUnit X.det) (hy : IsUnit Y.det)
    (h : SemiconjBy A X Y) : ∀ m : ℤ, SemiconjBy A (X ^ m) (Y ^ m)

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
{A X Y : Matrix n' n' R}
(hx : IsUnit X.det)
(hy : IsUnit Y.det)
(h : SemiconjBy A X Y)
(m : ℤ)


@[to_additive]
theorem le_normalizer_of_normal [hK : (H.subgroupOf K).Normal] (HK : H ≤ K) : K ≤ H.normalizer

{G : Type u_1}
[Group G]
{H K : Subgroup G}
[hK : (H.subgroupOf K).Normal]
(HK : H ≤ K)


theorem _root_.Set.Subsingleton.measure_zero (hs : s.Subsingleton) (μ : Measure α) [NoAtoms μ] :
    μ s = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{s : Set α}
(hs : s.Subsingleton)
(μ : MeasureTheory.Measure α)
[MeasureTheory.NoAtoms μ]


@[to_additive (attr := simp)]
theorem inv_inv_iff : Commute a⁻¹ b⁻¹ ↔ Commute a b

{G : Type u_1}
[SubtractionMonoid G]
{a b : G}


@[simp]
theorem testBit_land (m n k) : testBit (land m n) k = (testBit m k && testBit n k)

(m.land n).testBit k = (m.testBit k && n.testBit k)


theorem fpowerSeriesBilinear_apply_zero (f : E →L[𝕜] F →L[𝕜] G) (x : E × F) :
    fpowerSeriesBilinear f x 0 = ContinuousMultilinearMap.curry0 𝕜 _ (f x.1 x.2)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(f : E →L[𝕜] F →L[𝕜] G)
(x : E × F)

f.fpowerSeriesBilinear x 0 = ContinuousMultilinearMap.curry0 𝕜 (E × F) ((f x.1) x.2)


theorem EqOn.union (h₁ : EqOn f₁ f₂ s₁) (h₂ : EqOn f₁ f₂ s₂) : EqOn f₁ f₂ (s₁ ∪ s₂)

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{f₁ f₂ : α → β}
(h₁ : Set.EqOn f₁ f₂ s₁)
(h₂ : Set.EqOn f₁ f₂ s₂)


theorem invOfMemRange_surjective : Function.Surjective f.invOfMemRange

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(f : α ↪ β)


theorem diam_eq_sSup (s : Set α) : diam s = sSup (image2 edist s s)

{α : Type u}
[PseudoEMetricSpace α]
(s : Set α)

EMetric.diam s = sSup (Set.image2 edist s s)


/-- There are exactly `⌊N/n⌋` positive multiples of `n` that are `≤ N`.
See `Nat.card_multiples` for a "shifted-by-one" version. -/
lemma card_multiples' (N n : ℕ) :
    ((Finset.range N.succ).filter (fun k ↦ k ≠ 0 ∧ n ∣ k)).card = N / n

(Finset.filter (fun k => k ≠ 0 ∧ n ∣ k) (Finset.range N.succ)).card = N / n


theorem Decidable.or_not_not_of_not_and [Decidable p] [Decidable q]
    (h : ¬ (p ∧ q)) : ¬ p ∨ ¬ q

{p q : Prop}
[Decidable p]
[Decidable q]
(h : ¬(p ∧ q))


protected theorem Antitone.comp (hg : Antitone g) (hf : Antitone f) : Monotone (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
(hg : Antitone g)
(hf : Antitone f)


@[simp]
theorem K'.elim_update_stack {a b c d d'} :
    update (K'.elim a b c d) stack d' = K'.elim a b c d'

{a b c d d' : List Turing.PartrecToTM2.Γ'}

Function.update (Turing.PartrecToTM2.K'.elim a b c d) Turing.PartrecToTM2.K'.stack d' =
  Turing.PartrecToTM2.K'.elim a b c d'


theorem martingalePart_process_ae_eq (ℱ : Filtration ℕ m0) (μ : Measure Ω) (s : ℕ → Set Ω) (n : ℕ) :
    martingalePart (process s) ℱ μ n =
      ∑ k ∈ Finset.range n, ((s (k + 1)).indicator 1 - μ[(s (k + 1)).indicator 1|ℱ k])

{Ω : Type u_1}
{m0 : MeasurableSpace Ω}
(ℱ : MeasureTheory.Filtration ℕ m0)
(μ : MeasureTheory.Measure Ω)
(s : ℕ → Set Ω)
(n : ℕ)

MeasureTheory.martingalePart (MeasureTheory.BorelCantelli.process s) ℱ μ n =
  ∑ k ∈ Finset.range n, ((s (k + 1)).indicator 1 - μ[(s (k + 1)).indicator 1|↑ℱ k])


@[simp]
theorem quotientEquivAlgOfEq_mk {I J : Ideal A} (h : I = J) (x : A) :
    quotientEquivAlgOfEq R₁ h (Ideal.Quotient.mk I x) = Ideal.Quotient.mk J x

(R₁ : Type u_1)
{A : Type u_3}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
{I J : Ideal A}
(h : I = J)
(x : A)

(Ideal.quotientEquivAlgOfEq R₁ h) ((Ideal.Quotient.mk I) x) = (Ideal.Quotient.mk J) x


theorem setToL1SCLM_smul_left' (c : ℝ) (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ T' C')
    (h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) (f : α →₁ₛ[μ] E) :
    setToL1SCLM α E μ hT' f = c • setToL1SCLM α E μ hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(h_smul : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T' s = c • T s)

(f : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

(MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT') f = c • (MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT) f


theorem SpecΓIdentity_hom_app_fromSpec :
    (Scheme.ΓSpecIso Γ(X, U)).hom ≫ hU.fromSpec.app U =
      (Spec Γ(X, U)).presheaf.map (eqToHom hU.fromSpec_preimage_self).op

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)

(AlgebraicGeometry.Scheme.ΓSpecIso (X.presheaf.obj (Opposite.op U))).hom ≫
    AlgebraicGeometry.Scheme.Hom.app hU.fromSpec U =
  (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).presheaf.map (CategoryTheory.eqToHom ⋯).op


/-- Generalization of `Finsupp.mul_prod_erase`: if `g` maps a second argument of 0 to 1,
then its product over `f : α →₀ M` is the same as multiplying the value on any element
`y : α` by the product over `erase y f`. -/
@[to_additive
      " Generalization of `Finsupp.add_sum_erase`: if `g` maps a second argument of 0
      to 0, then its sum over `f : α →₀ M` is the same as adding the value on any element
      `y : α` to the sum over `erase y f`. "]
theorem mul_prod_erase' (f : α →₀ M) (y : α) (g : α → M → N) (hg : ∀ i : α, g i 0 = 1) :
    g y (f y) * (erase y f).prod g = f.prod g

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
(f : α →₀ M)
(y : α)
(g : α → M → N)
(hg : ∀ (i : α), g i 0 = 0)

g y (f y) + (Finsupp.erase y f).sum g = f.sum g


theorem HasFTaylorSeriesUpToOn.differentiableOn (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≤ n) :
    DifferentiableOn 𝕜 f s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpToOn n f p s)
(hn : 1 ≤ n)


@[simp]
theorem injective_codRestrict {f : ι → α} {s : Set α} (h : ∀ x, f x ∈ s) :
    Injective (codRestrict f s h) ↔ Injective f

{α : Type u_1}
{ι : Sort u_4}
{f : ι → α}
{s : Set α}
(h : ∀ (x : ι), f x ∈ s)

Function.Injective (Set.codRestrict f s h) ↔ Function.Injective f


theorem CondIndepSets.inter {s₁ s' : Set (Set Ω)} (s₂ : Set (Set Ω))
    (h₁ : CondIndepSets m' hm' s₁ s' μ) :
    CondIndepSets m' hm' (s₁ ∩ s₂) s' μ

(h₁ : ProbabilityTheory.CondIndepSets m' hm' s₁ s' μ)

ProbabilityTheory.CondIndepSets m' hm' (s₁ ∩ s₂) s' μ


theorem core_res (f : α → β) (s : Set α) (t : Set β) : (res f s).core t = sᶜ ∪ f ⁻¹' t

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(s : Set α)
(t : Set β)


@[to_additive]
theorem topologicalGroup_iInf {ts' : ι → TopologicalSpace G}
    (h' : ∀ i, @TopologicalGroup G (ts' i) _) : @TopologicalGroup G (⨅ i, ts' i) _

{G : Type w}
{ι : Sort u_1}
[Group G]
{ts' : ι → TopologicalSpace G}
(h' : ∀ (i : ι), TopologicalGroup G)


@[reassoc (attr := simp)]
lemma homologyπ_naturality (φ : S₁ ⟶ S₂) [S₁.HasHomology] [S₂.HasHomology] :
    S₁.homologyπ ≫ homologyMap φ = cyclesMap φ ≫ S₂.homologyπ

CategoryTheory.CategoryStruct.comp S₁.homologyπ (CategoryTheory.ShortComplex.homologyMap φ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.cyclesMap φ) S₂.homologyπ


@[simp]
theorem foldr_join (f : α → β → β) :
    ∀ (b : β) (L : List (List α)), foldr f b (join L) = foldr (fun l b => foldr f b l) b L

{α : Type u}
{β : Type v}
(f : α → β → β)
(b : β)
(L : List (List α))

List.foldr f b L.join = List.foldr (fun l b => List.foldr f b l) b L


theorem single_mul_single_of_ne [Fintype n] [DecidableEq n] [DecidableEq k] [DecidableEq m]
    [Semiring α] {b₁ b₂ : n} (hb : b₁ ≠ b₂) (a : m) (c : k) :
    (single a b₁).toMatrix * (single b₂ c).toMatrix = (0 : Matrix _ _ α)

{k : Type u_1}
{m : Type u_3}
{n : Type u_4}
{α : Type v}
[Fintype n]
[DecidableEq n]
[DecidableEq k]
[DecidableEq m]
[Semiring α]
{b₁ b₂ : n}
(hb : b₁ ≠ b₂)
(a : m)
(c : k)

(PEquiv.single a b₁).toMatrix * (PEquiv.single b₂ c).toMatrix = 0


@[norm_cast]
theorem coe_pnat_inj (p q : Nat.Primes) : (p : ℕ+) = (q : ℕ+) ↔ p = q


theorem nontrivial_of_three_le_card (h3 : 3 ≤ card α) : Nontrivial (alternatingGroup α)

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(h3 : 3 ≤ Fintype.card α)


@[simp, rclike_simps]
theorem norm_ofNat (n : ℕ) [n.AtLeastTwo] : ‖(no_index (OfNat.ofNat n) : K)‖ = OfNat.ofNat n

{K : Type u_1}
[RCLike K]
(n : ℕ)
[n.AtLeastTwo]


@[simp, mfld_simps] theorem symm_symm : e.symm.symm = e

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)


@[to_additive]
theorem mul_eq_one_iff_inv_eq {a : α} : ↑u * a = 1 ↔ ↑u⁻¹ = a

{α : Type u}
[AddMonoid α]
{u : AddUnits α}
{a : α}


/-- A flow on a topological space `α` by an additive topological
    monoid `τ` is a continuous monoid action of `τ` on `α`. -/
structure Flow (τ : Type*) [TopologicalSpace τ] [AddMonoid τ] [ContinuousAdd τ] (α : Type*)
  [TopologicalSpace α] where
  /-- The map `τ → α → α` underlying a flow of `τ` on `α`. -/
  toFun : τ → α → α
  cont' : Continuous (uncurry toFun)
  map_add' : ∀ t₁ t₂ x, toFun (t₁ + t₂) x = toFun t₁ (toFun t₂ x)
  map_zero' : ∀ x, toFun 0 x = x

{τ : Type u_1}
[TopologicalSpace τ]
[AddMonoid τ]
[ContinuousAdd τ]
{α : Type u_2}
[TopologicalSpace α]
(self : Flow τ α)
(x : α)


theorem contDiff_euclidean {n : ℕ∞} : ContDiff 𝕜 n f ↔ ∀ i, ContDiff 𝕜 n fun x => f x i

{𝕜 : Type u_1}
{ι : Type u_2}
{H : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
[Fintype ι]
{f : H → EuclideanSpace 𝕜 ι}
{n : ℕ∞}

ContDiff 𝕜 n f ↔ ∀ (i : ι), ContDiff 𝕜 n fun x => f x i


/-- A continuous monotone function between (conditionally) complete linear ordered spaces sends a
`Filter.limsup` to the `Filter.limsup` of the images (if the filter is bounded from above and
frequently bounded from below). -/
theorem Monotone.map_limsup_of_continuousAt {f : R → S} (f_incr : Monotone f) (a : ι → R)
    (f_cont : ContinuousAt f (F.limsup a))
    (bdd_above : F.IsBoundedUnder (· ≤ ·) a := by isBoundedDefault)
    (cobdd : F.IsCoboundedUnder (· ≤ ·) a := by isBoundedDefault) :
    f (F.limsup a) = F.limsup (f ∘ a)

(f_cont : ContinuousAt f (Filter.limsup a F))

(bdd_above : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) F a := by isBoundedDefault)

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) F a := by isBoundedDefault)

f (Filter.limsup a F) = Filter.limsup (f ∘ a) F


theorem pi_Icc_mem_nhds' (ha : ∀ i, a' i < x' i) (hb : ∀ i, x' i < b' i) : Icc a' b' ∈ 𝓝 x'

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{ι : Type u_1}
[Finite ι]
{a' b' x' : ι → α}
(ha : ∀ (i : ι), a' i < x' i)
(hb : ∀ (i : ι), x' i < b' i)


@[gcongr]
theorem product_subset_product (hs : s ⊆ s') (ht : t ⊆ t') : s ×ˢ t ⊆ s' ×ˢ t'

{α : Type u_1}
{β : Type u_2}
{s s' : Finset α}
{t t' : Finset β}
(hs : s ⊆ s')
(ht : t ⊆ t')


theorem Nonempty.eq_univ [Subsingleton α] : s.Nonempty → s = univ

{α : Type u_1}
[Fintype α]
{s : Finset α}
[Subsingleton α]


theorem mk_equiv_eq_arrow_of_eq (eq : #α = #β) : #(α ≃ β) = #(α → β)

{α β : Type u}
[Infinite α]
(eq : #α = #β)


theorem mem_list_primes_of_dvd_prod {p : M} (hp : Prime p) {L : List M} (hL : ∀ q ∈ L, Prime q)
    (hpL : p ∣ L.prod) : p ∈ L

{M : Type u_1}
[CancelCommMonoidWithZero M]
[Unique Mˣ]
{p : M}
(hp : Prime p)
{L : List M}
(hL : ∀ q ∈ L, Prime q)
(hpL : p ∣ L.prod)


@[simp]
theorem coe_of (α : Type*) [Lattice α] : ↥(of α) = α


protected theorem pow_lt_pow_iff_right {a n m : Nat} (h : 1 < a) :
    a ^ n < a ^ m ↔ n < m


theorem left_mem_segment (x y : E) : x ∈ [x -[𝕜] y]

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[MulActionWithZero 𝕜 E]
(x y : E)


/-- The `Pi.prod` of two morphisms is a morphism. -/
@[simps!]
def prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : A →⋆ₙₐ[R] B × C

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R C]
[Star C]
(f : A →⋆ₙₐ[R] B)
(g : A →⋆ₙₐ[R] C)
(i : A)


/-- If the germ of `f` w.r.t. each `𝓝 x` is constant, `f` is locally constant. -/
lemma IsLocallyConstant.of_germ_isConstant (h : ∀ x : X, (f : Germ (𝓝 x) Y).IsConstant) :
    IsLocallyConstant f

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
{f : X → Y}
(h : ∀ (x : X), (↑f).IsConstant)


theorem sin_eq_zero_iff_of_lt_of_lt {x : ℝ} (hx₁ : -π < x) (hx₂ : x < π) : sin x = 0 ↔ x = 0

{x : ℝ}
(hx₁ : -Real.pi < x)
(hx₂ : x < Real.pi)


theorem Monotone.strictMono_iff_injective (hf : Monotone f) : StrictMono f ↔ Injective f

{α : Type u}
{β : Type v}
[LinearOrder α]
[PartialOrder β]
{f : α → β}
(hf : Monotone f)


protected theorem ext_iff {x₀ x₁ : Sigma β} : x₀ = x₁ ↔ x₀.1 = x₁.1 ∧ HEq x₀.2 x₁.2

{α : Type u_1}
{β : α → Type u_4}
{x₀ x₁ : Sigma β}

x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ HEq x₀.snd x₁.snd


/-- Assuming `G` is strongly regular, `2*(k + 1) - m` in `G` is the number of vertices that are
adjacent to either `v` or `w` when `¬G.Adj v w`. So it's the cardinality of
`G.neighborSet v ∪ G.neighborSet w`. -/
theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k ℓ μ)
    (hne : v ≠ w) (ha : ¬G.Adj v w) :
    (G.neighborFinset v ∪ G.neighborFinset w).card = 2 * k - μ

{V : Type u}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{n k ℓ μ : ℕ}
{v w : V}
(h : G.IsSRGWith n k ℓ μ)
(hne : v ≠ w)
(ha : ¬G.Adj v w)


/-- `Equiv.funUnique` as an `IsometryEquiv`. -/
@[simps!]
def funUnique [Unique ι] [Fintype ι] : (ι → α) ≃ᵢ α

(ι : Type u_1)
(α : Type u)
[PseudoEMetricSpace α]
[Unique ι]
[Fintype ι]
(f : (i : ι) → (fun a => α) i)

(IsometryEquiv.funUnique ι α) f = f default


theorem small_quot_of_hasColimit (F : J ⥤ Type u) [HasColimit F] : Small.{u} (Quot F)

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.Limits.HasColimit F]

Small.{u, max u v} (CategoryTheory.Limits.Types.Quot F)


@[to_additive (attr := simp)]
theorem prod_erase [DecidableEq α] (h : a ∈ s) : a * (s.erase a).prod = s.prod

{α : Type u_3}
[AddCommMonoid α]
{s : Multiset α}
{a : α}
[DecidableEq α]
(h : a ∈ s)


theorem chain_ne_nil (r : α → α → Prop) {l : List α} :
    ∀ hl : l ≠ [], Chain r l ↔ List.Chain r (getLast l hl) l

{α : Type u_1}
(r : α → α → Prop)
{l : List α}
(hl : l ≠ [])

Cycle.Chain r ↑l ↔ List.Chain r (l.getLast hl) l


protected theorem symmDiff_def (s t : Set α) : s ∆ t = s \ t ∪ t \ s


@[simp]
theorem Units.zero_lt (u : αˣ) : (0 : α) < u

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
(u : αˣ)


@[simp]
theorem comp_assoc (f : BoundedOrderHom γ δ) (g : BoundedOrderHom β γ) (h : BoundedOrderHom α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
[BoundedOrder δ]
(f : BoundedOrderHom γ δ)
(g : BoundedOrderHom β γ)
(h : BoundedOrderHom α β)


@[reassoc (attr := simp)]
theorem preservesLimitsIso_hom_π (j) :
    (preservesLimitIso G F).hom ≫ limit.π _ j = G.map (limit.π F j)

CategoryTheory.CategoryStruct.comp (CategoryTheory.preservesLimitIso G F).hom
    (CategoryTheory.Limits.limit.π (F.comp G) j) =
  G.map (CategoryTheory.Limits.limit.π F j)


theorem DifferentiableOn.log (hf : DifferentiableOn ℝ f s) (hx : ∀ x ∈ s, f x ≠ 0) :
    DifferentiableOn ℝ (fun x => log (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
(hf : DifferentiableOn ℝ f s)
(hx : ∀ x ∈ s, f x ≠ 0)

DifferentiableOn ℝ (fun x => Real.log (f x)) s


@[simp]
theorem coe_toNNReal' (r : ℝ) : (Real.toNNReal r : ℝ) = max r 0


/-- Left scalar multiplication as an order isomorphism. -/
@[simps!]
def OrderIso.smulRightDual (ha : a < 0) : β ≃o βᵒᵈ

{α : Type u_1}
(β : Type u_2)
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
{a : α}
[PosSMulMono α β]
(ha : a < 0)

∀ (a_1 : βᵒᵈ), (RelIso.symm (OrderIso.smulRightDual β ha)) a_1 = a⁻¹ • OrderDual.ofDual a_1


@[simp]
theorem fract_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
    fract (a + (no_index (OfNat.ofNat n))) = fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(n : ℕ)
[n.AtLeastTwo]

Int.fract (a + OfNat.ofNat n) = Int.fract a


/-- Oriented angle version of "angles in same segment are equal" and "opposite angles of a
cyclic quadrilateral add to π", for oriented angles mod π (for which those are the same result),
represented here as equality of twice the angles. -/
theorem two_zsmul_oangle_eq {s : Sphere P} {p₁ p₂ p₃ p₄ : P} (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s)
    (hp₃ : p₃ ∈ s) (hp₄ : p₄ ∈ s) (hp₂p₁ : p₂ ≠ p₁) (hp₂p₄ : p₂ ≠ p₄) (hp₃p₁ : p₃ ≠ p₁)
    (hp₃p₄ : p₃ ≠ p₄) : (2 : ℤ) • ∡ p₁ p₂ p₄ = (2 : ℤ) • ∡ p₁ p₃ p₄

[hd2 : Fact (FiniteDimensional.finrank ℝ V = 2)]

2 • ∡ p₁ p₂ p₄ = 2 • ∡ p₁ p₃ p₄


/--
The forgetful functor from sheaves of modules over sheaf of ring `R` to sheaves of `R(X)`-module
when `X` is initial.
-/
@[simps]
noncomputable def forgetToSheafModuleCat
      (X : Cᵒᵖ) (hX : Limits.IsInitial X)  :
    SheafOfModules.{w} R ⥤ Sheaf J (ModuleCat.{w} (R.1.obj X))

{J : CategoryTheory.GrothendieckTopology C}

(hX : CategoryTheory.Limits.IsInitial X)

∀ {X_1 Y : SheafOfModules R} (f : X_1 ⟶ Y),
  ((SheafOfModules.forgetToSheafModuleCat R X hX).map f).val =
    (PresheafOfModules.forgetToPresheafModuleCat X hX).map f.val


theorem mul_kstar_le_kstar : a * a∗ ≤ a∗

{α : Type u_1}
[KleeneAlgebra α]
{a : α}


theorem toDual_apply (i j : ι) : b.toDual (b i) (b j) = if i = j then 1 else 0

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)
(i j : ι)

(b.toDual (b i)) (b j) = if i = j then 1 else 0


@[simp] theorem mul_get (xs ys : IntList) (i : Nat) : (xs * ys).get i = xs.get i * ys.get i


@[simp] lemma toFun_eq_coe (f : sSupHom α β) : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[SupSet α]
[SupSet β]
(f : sSupHom α β)


lemma Union_closure_singleton_eq_iff {s : Set X} :
    (⋃ x ∈ s, closure {x}) = s ↔ StableUnderSpecialization s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}

⋃ x ∈ s, closure {x} = s ↔ StableUnderSpecialization s


theorem diagonal_ofNat [Zero α] [NatCast α] (m : ℕ) [m.AtLeastTwo] :
    diagonal (fun _ : n => no_index (OfNat.ofNat m : α)) = OfNat.ofNat m

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[NatCast α]
(m : ℕ)
[m.AtLeastTwo]

(Matrix.diagonal fun x => OfNat.ofNat m) = OfNat.ofNat m


@[to_additive]
theorem map_div_right_ae (μ : Measure G) [IsMulRightInvariant μ] (x : G) :
    Filter.map (fun t => t / x) (ae μ) = ae μ

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulRightInvariant]
(x : G)

Filter.map (fun t => t / x) (MeasureTheory.ae μ) = MeasureTheory.ae μ


theorem OuterMeasure.toMeasure_zero [MeasurableSpace α] :
    (0 : OuterMeasure α).toMeasure (le_top.trans OuterMeasure.zero_caratheodory.symm.le) = 0

MeasureTheory.OuterMeasure.toMeasure 0 ⋯ = 0


@[simp]
theorem preimage_cast_Icc (p q : ℚ≥0) : (↑) ⁻¹' Icc (p : K) q = Icc p q

{K : Type u_5}
[LinearOrderedSemifield K]
(p q : ℚ≥0)

NNRat.cast ⁻¹' Set.Icc ↑p ↑q = Set.Icc p q


theorem xgcdAux_P (a b : R) {r r' : R} {s t s' t'} (p : P a b (r, s, t))
    (p' : P a b (r', s', t')) : P a b (xgcdAux r s t r' s' t')

(p' : EuclideanDomain.P a b (r', s', t'))

EuclideanDomain.P a b (EuclideanDomain.xgcdAux r s t r' s' t')


theorem IsRegularOfDegree.compl [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj]
    {k : ℕ} (h : G.IsRegularOfDegree k) : Gᶜ.IsRegularOfDegree (Fintype.card V - 1 - k)

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{k : ℕ}
(h : G.IsRegularOfDegree k)


theorem rdropWhile_prefix : l.rdropWhile p <+: l

{α : Type u_1}
(p : α → Bool)
(l : List α)


theorem SurjectiveOnWith.mono {f : NormedAddGroupHom V₁ V₂} {K : AddSubgroup V₂} {C C' : ℝ}
    (h : f.SurjectiveOnWith K C) (H : C ≤ C') : f.SurjectiveOnWith K C'

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{f : NormedAddGroupHom V₁ V₂}
{K : AddSubgroup V₂}
{C C' : ℝ}
(h : f.SurjectiveOnWith K C)
(H : C ≤ C')


/-- A local diffeomorphism is an open map. -/
lemma IsLocalDiffeomorph.isOpenMap (hf : IsLocalDiffeomorph I J n f) : IsOpenMap f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{f : M → N}
(hf : IsLocalDiffeomorph I J n f)


theorem cosh_dist (z w : ℍ) : cosh (dist z w) = 1 + dist (z : ℂ) w ^ 2 / (2 * z.im * w.im)

Real.cosh (dist z w) = 1 + dist ↑z ↑w ^ 2 / (2 * z.im * w.im)


theorem AlgHom.restrictNormal_comp [Normal F E] :
    (ψ.restrictNormal E).comp (ϕ.restrictNormal E) = (ψ.comp ϕ).restrictNormal E

{F : Type u_1}
{K₁ : Type u_3}
{K₂ : Type u_4}
{K₃ : Type u_5}
[Field F]
[Field K₁]
[Field K₂]
[Field K₃]
[Algebra F K₁]
[Algebra F K₂]
[Algebra F K₃]
(ϕ : K₁ →ₐ[F] K₂)
(ψ : K₂ →ₐ[F] K₃)
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra E K₁]
[Algebra E K₂]
[Algebra E K₃]
[IsScalarTower F E K₁]
[IsScalarTower F E K₂]
[IsScalarTower F E K₃]
[Normal F E]


@[reassoc]
theorem coequalizer.condition : f ≫ coequalizer.π f g = g ≫ coequalizer.π f g

CategoryTheory.CategoryStruct.comp f (CategoryTheory.Limits.coequalizer.π f g) =
  CategoryTheory.CategoryStruct.comp g (CategoryTheory.Limits.coequalizer.π f g)


theorem pullback_snd_eq :
    CompHaus.pullback.snd f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.snd f g

{X Y B : CompHaus}
(f : X ⟶ B)
(g : Y ⟶ B)

CompHaus.pullback.snd f g =
  CategoryTheory.CategoryStruct.comp (CompHaus.pullbackIsoPullback f g).hom (CategoryTheory.Limits.pullback.snd f g)


theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) :
    Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I

(hS : Function.Injective ⇑(algebraMap R S))

(IsLocalization.coeSubmodule S I).FG ↔ Submodule.FG I


@[to_additive]
protected theorem map_noncommProd_aux [MonoidHomClass F α β] (s : Multiset α)
    (comm : { x | x ∈ s }.Pairwise Commute) (f : F) : { x | x ∈ s.map f }.Pairwise Commute

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Monoid α]
[Monoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(s : Multiset α)
(comm : {x | x ∈ s}.Pairwise Commute)
(f : F)

{x | x ∈ Multiset.map (⇑f) s}.Pairwise Commute


theorem Ici_eq_finset_subtype : Ici a = (Icc (a : ℕ) n).fin n

Finset.Ici a = Finset.fin n (Finset.Icc (↑a) n)


theorem eventually_nhdsWithin_iff {a : α} {s : Set α} {p : α → Prop} :
    (∀ᶠ x in 𝓝[s] a, p x) ↔ ∀ᶠ x in 𝓝 a, x ∈ s → p x

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}
{p : α → Prop}

(∀ᶠ (x : α) in 𝓝[s] a, p x) ↔ ∀ᶠ (x : α) in 𝓝 a, x ∈ s → p x


@[simp]
theorem coe_rangeRestrict (f : R →+* S) (x : R) : (f.rangeRestrict x : S) = f x

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)
(x : R)


@[simp]
theorem get_ofNat' (x : ℕ) [x.AtLeastTwo] (h : (no_index (OfNat.ofNat x : PartENat)).Dom) :
    Part.get (no_index (OfNat.ofNat x : PartENat)) h = (no_index (OfNat.ofNat x))

(x : ℕ)
[x.AtLeastTwo]
(h : (OfNat.ofNat x).Dom)


/-- Typeclass for an extension being an algebraic closure. -/
class IsAlgClosure (R : Type u) (K : Type v) [CommRing R] [Field K] [Algebra R K]
    [NoZeroSMulDivisors R K] : Prop where
  alg_closed : IsAlgClosed K
  algebraic : Algebra.IsAlgebraic R K

(R : Type u)
{K : Type v}
[CommRing R]
[Field K]
[Algebra R K]
[NoZeroSMulDivisors R K]
[self : IsAlgClosure R K]


theorem le_mul_left {a b : Cardinal} (h : b ≠ 0) : a ≤ b * a


@[mono]
theorem succPNat_strictMono : StrictMono succPNat


@[simp] theorem cast_apply {α β} (h : α = β) (x : α) : Equiv.cast h x = cast h x


@[simp]
theorem iterateFrobeniusEquiv_one : iterateFrobeniusEquiv R p 1 = frobeniusEquiv R p

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]


@[simp] theorem size_toUTF8 (s : String) : s.toUTF8.size = s.utf8ByteSize


/-- The cone for `StructuredArrow.proj Y L ⋙ F` attached to `E : RightExtension L F`.
The point of this cone is `E.left.obj Y` -/
@[simps]
def coneAt (Y : D) : Cone (StructuredArrow.proj Y L ⋙ F)

(g : CategoryTheory.StructuredArrow Y L)

(E.coneAt Y).π.app g = CategoryTheory.CategoryStruct.comp (E.left.map g.hom) (E.hom.app g.right)


/-- While the coercion `↑ : WeakDual 𝕜 E → (E → 𝕜)` is not a closed map, it sends *bounded*
closed sets to closed sets. -/
theorem isClosed_image_coe_of_bounded_of_closed {s : Set (WeakDual 𝕜 E)}
    (hb : IsBounded (Dual.toWeakDual ⁻¹' s)) (hc : IsClosed s) :
    IsClosed (((↑) : WeakDual 𝕜 E → E → 𝕜) '' s)

(hb : Bornology.IsBounded (⇑NormedSpace.Dual.toWeakDual ⁻¹' s))


@[to_additive (attr := simp)]
theorem _root_.Subgroup.ker_inclusion {H K : Subgroup G} (h : H ≤ K) : (inclusion h).ker = ⊥

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h : H ≤ K)


/-- A measure on a product space equals the product measure if they are equal on rectangles
  with as sides sets that generate the corresponding σ-algebras. -/
theorem prod_eq_generateFrom {μ : Measure α} {ν : Measure β} {C : Set (Set α)} {D : Set (Set β)}
    (hC : generateFrom C = ‹_›) (hD : generateFrom D = ‹_›) (h2C : IsPiSystem C)
    (h2D : IsPiSystem D) (h3C : μ.FiniteSpanningSetsIn C) (h3D : ν.FiniteSpanningSetsIn D)
    {μν : Measure (α × β)} (h₁ : ∀ s ∈ C, ∀ t ∈ D, μν (s ×ˢ t) = μ s * ν t) : μ.prod ν = μν

(hC : MeasurableSpace.generateFrom C = inst✝)

(hD : MeasurableSpace.generateFrom D = inst✝¹)


@[simp] theorem map_nil {f : α → β} : map f [] = []


protected lemma div_ne_zero : a / b ≠ 0 ↔ a ≠ 0 ∧ b ≠ ⊤


theorem iff_is_const [PreconnectedSpace X] {f : X → Y} : IsLocallyConstant f ↔ ∀ x y, f x = f y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[PreconnectedSpace X]
{f : X → Y}

IsLocallyConstant f ↔ ∀ (x y : X), f x = f y


/-- A family `𝓕 : ι → β → α` is uniformly equicontinuous on `S` iff the function
`swap 𝓕 : β → ι → α` is uniformly continuous on `S`
*when `ι → α` is equipped with the uniform structure of uniform convergence*. This is very useful
for developping the equicontinuity API, but it should not be used directly for other purposes. -/
theorem uniformEquicontinuousOn_iff_uniformContinuousOn {F : ι → β → α} {S : Set β} :
    UniformEquicontinuousOn F S ↔ UniformContinuousOn (ofFun ∘ Function.swap F : β → ι →ᵤ α) S

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{F : ι → β → α}
{S : Set β}

UniformEquicontinuousOn F S ↔ UniformContinuousOn (⇑UniformFun.ofFun ∘ Function.swap F) S


@[simp]
theorem coe_copy (f : A →ₗc[R] B) (f' : A → B) (h : f' = ⇑f) : ⇑(f.copy f' h) = f'

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₗc[R] B)
(f' : A → B)
(h : f' = ⇑f)


@[simp]
theorem natDegree_zero : natDegree (0 : R[X]) = 0


/-- Formula for `IsLocalizedModule.map` when each localized module is a `LocalizedModule`.-/
lemma map_LocalizedModules (g : M₀ →ₗ[R] M₁) (m : M₀) (s : S) :
    ((map S (mkLinearMap S M₀) (mkLinearMap S M₁)) g)
    (LocalizedModule.mk m s) = LocalizedModule.mk (g m) s

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M₀ : Type u_6}
[AddCommGroup M₀]
[Module R M₀]
{M₁ : Type u_7}
[AddCommGroup M₁]
[Module R M₁]
(g : M₀ →ₗ[R] M₁)
(m : M₀)
(s : ↥S)

((IsLocalizedModule.map S (LocalizedModule.mkLinearMap S M₀) (LocalizedModule.mkLinearMap S M₁)) g)
    (LocalizedModule.mk m s) =
  LocalizedModule.mk (g m) s


/-- Infimum of `s i`, `i : ι`, is equal to the infimum over `t : Finset ι` of infima
`⨅ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iInf_eq_iInf_finset'` for a version
that works for `ι : Sort*`. -/
theorem iInf_eq_iInf_finset (s : ι → α) : ⨅ i, s i = ⨅ (t : Finset ι) (i ∈ t), s i

{α : Type u_2}
{ι : Type u_5}
[CompleteLattice α]
(s : ι → α)


theorem set_next_add (s : String) (i : Pos) (c : Char) (b₁ b₂)
    (h : (s.next i).1 + b₁ = s.endPos.1 + b₂) :
    ((s.set i c).next i).1 + b₁ = (s.set i c).endPos.1 + b₂

(i : String.Pos)
(c : Char)
(cs : List Char)
(a : String.Pos)
(b₁ b₂ : Nat)

(String.utf8GetAux cs a i).utf8Size + b₁ = String.utf8ByteSize.go cs + b₂ →
  (String.utf8GetAux (String.utf8SetAux c cs a i) a i).utf8Size + b₁ =
    String.utf8ByteSize.go (String.utf8SetAux c cs a i) + b₂


theorem eq_iff_eq_of_cmp_eq_cmp (h : cmp x y = cmp x' y') : x = y ↔ x' = y'

{α : Type u_1}
[LinearOrder α]
{x y : α}
{β : Type u_3}
[LinearOrder β]
{x' y' : β}
(h : cmp x y = cmp x' y')


theorem tsub_add_eq_tsub_tsub (a b c : α) : a - (b + c) = a - b - c

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
(a b c : α)


protected theorem div_eq_inv_mul : a / b = b⁻¹ * a


/-- The neighbourhood filter of a nonzero element consists of all sets containing that
element. -/
@[simp]
theorem nhds_of_ne_zero {γ : Γ₀} (h₀ : γ ≠ 0) : 𝓝 γ = pure γ

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{γ : Γ₀}
(h₀ : γ ≠ 0)


@[csimp] theorem intercalate_eq_intercalateTR : @intercalate = @intercalateTR

(α : Type u_1)
(sep : List α)
{acc : Array α}
{x : List α}
(xs : List (List α))

List.intercalateTR.go (List.toArray sep) x xs acc = acc.data ++ (List.intersperse sep (x :: xs)).join


theorem Integrable.aestronglyMeasurable {f : α → β} (hf : Integrable f μ) :
    AEStronglyMeasurable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : α → β}
(hf : MeasureTheory.Integrable f μ)


protected theorem IsLowerSet.lowerClosure (hs : IsLowerSet s) : ↑(lowerClosure s) = s

{α : Type u_1}
[Preorder α]
{s : Set α}
(hs : IsLowerSet s)


theorem IsCoprime.isRelPrime {a b : R} (h : IsCoprime a b) : IsRelPrime a b

{R : Type u}
[CommSemiring R]
{a b : R}
(h : IsCoprime a b)


theorem ball_subset_thickening {x : X} {E : Set X} (hx : x ∈ E) (δ : ℝ) :
    ball x δ ⊆ thickening δ E

{X : Type u}
[PseudoMetricSpace X]
{x : X}
{E : Set X}
(hx : x ∈ E)
(δ : ℝ)


/-- Note that this lemma exists more generally as the global `smul_inv` -/
@[to_additive (attr := simp)]
lemma smul_inv [Group G] [Monoid M] [MulAction G M] [SMulCommClass G M M] [IsScalarTower G M M]
    (g : G) (m : Mˣ) : (g • m)⁻¹ = g⁻¹ • m⁻¹

{G : Type u_1}
{M : Type u_3}
[Group G]
[Monoid M]
[MulAction G M]
[SMulCommClass G M M]
[IsScalarTower G M M]
(g : G)
(m : Mˣ)

(g • m)⁻¹ = g⁻¹ • m⁻¹


@[simp] theorem getLsb_allOnes : (allOnes v).getLsb i = decide (i < v)

(BitVec.allOnes v).getLsb i = decide (i < v)


theorem mul_self_lt_mul_self [PosMulStrictMono α] [MulPosMono α]
    (h1 : 0 ≤ a) (h2 : a < b) : a * a < b * b

{α : Type u}
[Semiring α]
[PartialOrder α]
{a b : α}
[PosMulStrictMono α]
[MulPosMono α]
(h1 : 0 ≤ a)
(h2 : a < b)


@[simp]
lemma chainLength_zero [Nontrivial L] : chainLength 0 β = 0

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(β : LieModule.Weight K (↥H) L)
[Nontrivial L]

LieAlgebra.IsKilling.chainLength 0 β = 0


/-- An element `y` is in the ω-limit set of `s` w.r.t. `f` if the
    forward images of `s` frequently (w.r.t. `f`) intersect arbitrary
    neighbourhoods of `y`. -/
theorem mem_omegaLimit_iff_frequently₂ (y : β) :
    y ∈ ω f ϕ s ↔ ∀ n ∈ 𝓝 y, ∃ᶠ t in f, (ϕ t '' s ∩ n).Nonempty

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(f : Filter τ)
(ϕ : τ → α → β)
(s : Set α)
(y : β)

y ∈ omegaLimit f ϕ s ↔ ∀ n ∈ 𝓝 y, ∃ᶠ (t : τ) in f, (ϕ t '' s ∩ n).Nonempty


/-- The submonoid generated by a set is contained in any submonoid that contains the set. -/
@[to_additive
      "The `AddSubmonoid` generated by a set is contained in any `AddSubmonoid` that
      contains the set."]
theorem closure_subset {s t : Set M} (ht : IsSubmonoid t) (h : s ⊆ t) : Closure s ⊆ t

{M : Type u_1}
[Monoid M]
{s t : Set M}
(ht : IsSubmonoid t)
(h : s ⊆ t)


@[simp]
theorem equiv_neg : WithLp.equiv p V (-x) = -WithLp.equiv p V x

(p : ℝ≥0∞)
{V : Type uV}
[AddCommGroup V]
(x : WithLp p V)

(WithLp.equiv p V) (-x) = -(WithLp.equiv p V) x


/-- `ContinuousOrderHomClass F α β` states that `F` is a type of continuous monotone maps.

You should extend this class when you extend `ContinuousOrderHom`. -/
class ContinuousOrderHomClass (F : Type*) (α β : outParam Type*) [Preorder α] [Preorder β]
    [TopologicalSpace α] [TopologicalSpace β] [FunLike F α β] extends
    ContinuousMapClass F α β : Prop where
  map_monotone (f : F) : Monotone f

{F : Type u_6}
{α : outParam (Type u_7)}
{β : outParam (Type u_8)}
[Preorder α]
[Preorder β]
[TopologicalSpace α]
[TopologicalSpace β]
[FunLike F α β]
[self : ContinuousOrderHomClass F α β]
(f : F)


@[reassoc]
theorem toPushforwardStalk_comp :
    f ≫ StructureSheaf.toPushforwardStalk f p =
      StructureSheaf.toStalk R p ≫
        (TopCat.Presheaf.stalkFunctor _ _).map (Spec.sheafedSpaceMap f).c

{R S : CommRingCat}
(f : R ⟶ S)
(p : PrimeSpectrum ↑R)

CategoryTheory.CategoryStruct.comp f (AlgebraicGeometry.StructureSheaf.toPushforwardStalk f p) =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.StructureSheaf.toStalk (↑R) p)
    ((TopCat.Presheaf.stalkFunctor CommRingCat p).map (AlgebraicGeometry.Spec.sheafedSpaceMap f).c)


theorem ConvexOn.le_right_of_left_le'' (hf : ConvexOn 𝕜 s f) (hx : x ∈ s) (hz : z ∈ s) (hxy : x < y)
    (hyz : y ≤ z) (h : f x ≤ f y) : f y ≤ f z

{𝕜 : Type u_1}
{β : Type u_5}
[LinearOrderedField 𝕜]
[LinearOrderedCancelAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{x y z : 𝕜}
{s : Set 𝕜}
{f : 𝕜 → β}
(hf : ConvexOn 𝕜 s f)
(hx : x ∈ s)
(hz : z ∈ s)
(hxy : x < y)
(hyz : y ≤ z)
(h : f x ≤ f y)


lemma measurable_down : Measurable (ULift.down : ULift α → α)


lemma meas_le_of_le_of_forall_le_meas_thickening_add {ε₁ ε₂ : ℝ≥0∞} (μ ν : Measure Ω)
    (h_le : ε₁ ≤ ε₂) {B : Set Ω} (hε₁ : μ B ≤ ν (thickening ε₁.toReal B) + ε₁) :
    μ B ≤ ν (thickening ε₂.toReal B) + ε₂

{ε₁ ε₂ : ℝ≥0∞}

(hε₁ : μ B ≤ ν (Metric.thickening ε₁.toReal B) + ε₁)

μ B ≤ ν (Metric.thickening ε₂.toReal B) + ε₂


@[fun_prop]
protected theorem differentiableAt : DifferentiableAt 𝕜 iso x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
(iso : E ≃L[𝕜] F)


@[simp] lemma map_dblU : dblU (W'.map f) (f ∘ P) = f (W'.dblU P)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(P : Fin 3 → R)

WeierstrassCurve.Jacobian.dblU (WeierstrassCurve.map W' f) (⇑f ∘ P) = f (W'.dblU P)


theorem fourierIntegral_continuousMultilinearMap_apply'
    {f : V → ContinuousMultilinearMap ℝ M E} {m : (i : ι) → M i} {w : W} (hf : Integrable f μ) :
    VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f w m =
      VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ (fun x ↦ f x m) w

(VectorFourier.fourierIntegral Real.fourierChar μ L.toLinearMap₂ f w) m =
  VectorFourier.fourierIntegral Real.fourierChar μ L.toLinearMap₂ (fun x => (f x) m) w


lemma mk_divInt (n d : ℕ) :
    ⟨.divInt n d, Rat.divInt_nonneg n.cast_nonneg d.cast_nonneg⟩ = divNat n d

⟨Rat.divInt ↑n ↑d, ⋯⟩ = NNRat.divNat n d


@[simp]
theorem argmin_eq_none : l.argmin f = none ↔ l = []

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
{f : α → β}
{l : List α}


@[to_additive]
theorem rel_prod {R : M → N → Prop} (h : R 1 1) (hf : (R ⇒ R ⇒ R) (· * ·) (· * ·)) :
    (Forall₂ R ⇒ R) prod prod

(hf : (R ⇒ R ⇒ R) (fun x x_1 => x * x_1) fun x x_1 => x * x_1)

(List.Forall₂ R ⇒ R) List.prod List.prod


theorem gramSchmidt_of_orthogonal {f : ι → E} (hf : Pairwise fun i j => ⟪f i, f j⟫ = 0) :
    gramSchmidt 𝕜 f = f

(hf : Pairwise fun i j => ⟪f i, f j⟫_𝕜 = 0)


theorem ConcaveOn.right_le_of_le_left'' (hf : ConcaveOn 𝕜 s f) (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y ≤ z) (h : f y ≤ f x) : f z ≤ f y

{𝕜 : Type u_1}
{β : Type u_5}
[LinearOrderedField 𝕜]
[LinearOrderedCancelAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{x y z : 𝕜}
{s : Set 𝕜}
{f : 𝕜 → β}
(hf : ConcaveOn 𝕜 s f)
(hx : x ∈ s)
(hz : z ∈ s)
(hxy : x < y)
(hyz : y ≤ z)
(h : f y ≤ f x)


/-- The `n`-th power map (for an integer `n`) on a commutative group, considered as a group
homomorphism. -/
@[to_additive (attr := simps) "Multiplication by an integer `n` on a commutative additive group,
considered as an additive group homomorphism."]
def zpowGroupHom (n : ℤ) : α →* α

{α : Type u_1}
[DivisionCommMonoid α]
(n : ℤ)


lemma epi_iff_locallySurjective_on_compHaus : Epi f ↔
    ∀ (S : CompHaus) (y : Y.val.obj ⟨S⟩),
      (∃ (S' : CompHaus) (φ : S' ⟶ S) (_ : Function.Surjective φ) (x : X.val.obj ⟨S'⟩),
        f.val.app ⟨S'⟩ x = Y.val.map ⟨φ⟩ y)

CategoryTheory.Epi f ↔
  ∀ (S : CompHaus) (y : Y.val.obj (Opposite.op S)),
    ∃ S' φ, ∃ (_ : Function.Surjective ⇑φ), ∃ x, f.val.app (Opposite.op S') x = Y.val.map (Opposite.op φ) y


@[simp]
protected theorem smul_def (f : M ≃ₗ[R] M) (a : M) : f • a = f a

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : M ≃ₗ[R] M)
(a : M)


theorem valuation_le_iff (x y : K) : A.valuation x ≤ A.valuation y ↔ ∃ a : A, (a : K) * y = x

{K : Type u}
[Field K]
(A : ValuationSubring K)
(x y : K)

A.valuation x ≤ A.valuation y ↔ ∃ a, ↑a * y = x


@[simp]
theorem counitBialgHom_apply (x : A) :
    counitBialgHom R A x = Coalgebra.counit x

(R : Type u)
(A : Type v)
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(x : A)

(Bialgebra.counitBialgHom R A) x = Coalgebra.counit x


theorem map_map (g : β → γ) (f : α → β) (o : Part α) : map g (map f o) = map (g ∘ f) o

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(g : β → γ)
(f : α → β)
(o : Part α)

Part.map g (Part.map f o) = Part.map (g ∘ f) o


/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s)

Filter.Tendsto s.GammaSeq Filter.atTop (𝓝 (Real.Gamma s))


@[simp]
theorem map_apply {α α' ι} (f : α → α') (l : Line α ι) (x : α) : l.map f (f x) = f ∘ l x

{α : Type u_5}
{α' : Type u_6}
{ι : Type u_7}
(f : α → α')
(l : Combinatorics.Line α ι)
(x : α)

(fun x i => ((Combinatorics.Line.map f l).idxFun i).getD x) (f x) = f ∘ (fun x i => (l.idxFun i).getD x) x


/-- Constructs an isomorphism of Heyting algebras from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : HeytAlg.{u}} (e : α ≃o β) : α ≅ β


/-- The unique morphism out of `Factorisation.initial f`. -/
@[simps]
protected def initialHom (d : Factorisation f) :
    Factorisation.Hom (Factorisation.initial : Factorisation f) d

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : X ⟶ Y}
(d : CategoryTheory.Factorisation f)


theorem Tendsto.nsmul_atBot (hf : Tendsto f l atBot) {n : ℕ} (hn : 0 < n) :
    Tendsto (fun x => n • f x) l atBot

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f : α → β}
(hf : Filter.Tendsto f l Filter.atBot)
{n : ℕ}
(hn : 0 < n)

Filter.Tendsto (fun x => n • f x) l Filter.atBot


private lemma Z_u₃_spec : S.Z ^ 3 * S.u₃ = S.z

(S : FermatLastTheoremForThreeGen.Solution hζ)

FermatLastTheoremForThreeGen.Solution.Z S ^ 3 * ↑(FermatLastTheoremForThreeGen.Solution.u₃ S) =
  FermatLastTheoremForThreeGen.Solution.z S


@[simp]
theorem dual_id : InfTopHom.dual (InfTopHom.id α) = SupBotHom.id _

InfTopHom.dual (InfTopHom.id α) = SupBotHom.id αᵒᵈ


/-- A version of the layer cake formula for bounded continuous functions which have finite integral:
∫ f dμ = ∫ t in (0, ‖f‖], μ {x | f(x) ≥ t} dt. -/
lemma BoundedContinuousFunction.integral_eq_integral_meas_le_of_hasFiniteIntegral
    {α : Type*} [MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α]
    (f : α →ᵇ ℝ) (μ : Measure α) (f_nn : 0 ≤ᵐ[μ] f) (hf : HasFiniteIntegral f μ) :
    ∫ ω, f ω ∂μ = ∫ t in Ioc 0 ‖f‖, ENNReal.toReal (μ {a : α | t ≤ f a})

(hf : MeasureTheory.HasFiniteIntegral (⇑f) μ)

∫ (ω : α), f ω ∂μ = ∫ (t : ℝ) in Set.Ioc 0 ‖f‖, (μ {a | t ≤ f a}).toReal


theorem isCoseparating_iff_mono (𝒢 : Set C)
    [∀ A : C, HasProduct fun f : ΣG : 𝒢, A ⟶ (G : C) => (f.1 : C)] :
    IsCoseparating 𝒢 ↔ ∀ A : C, Mono (Pi.lift (@Sigma.snd 𝒢 fun G => A ⟶ (G : C)))

[∀ (A : C), CategoryTheory.Limits.HasProduct fun f => ↑f.fst]

CategoryTheory.IsCoseparating 𝒢 ↔ ∀ (A : C), CategoryTheory.Mono (CategoryTheory.Limits.Pi.lift Sigma.snd)


@[to_additive]
theorem Antitone.mulIndicator_eventuallyEq_iInter {ι} [Preorder ι] [One β] (s : ι → Set α)
    (hs : Antitone s) (f : α → β) (a : α) :
    (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun _ ↦ mulIndicator (⋂ i, s i) f a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_5}
[Preorder ι]
[One β]
(s : ι → Set α)
(hs : Antitone s)
(f : α → β)
(a : α)

(fun i => (s i).mulIndicator f a) =ᶠ[Filter.atTop] fun x => (⋂ i, s i).mulIndicator f a


/-- If `MonoidAlgebra R M` is of finite type, then there is a `G : Finset M` such that its image
generates, as algebra, `MonoidAlgebra R M`. -/
theorem exists_finset_adjoin_eq_top [h : FiniteType R (MonoidAlgebra R M)] :
    ∃ G : Finset M, Algebra.adjoin R (of R M '' G) = ⊤

[h : Algebra.FiniteType R (MonoidAlgebra R M)]

∃ G, Algebra.adjoin R (⇑(MonoidAlgebra.of R M) '' ↑G) = ⊤


@[simp]
theorem le_Prop_eq : ((· ≤ ·) : Prop → Prop → Prop) = (· → ·)

(fun x x_1 => x ≤ x_1) = fun x x_1 => x → x_1


/-- The natural isomorphism from restriction along the identity homomorphism to
the identity functor on `Action V G`.
-/
@[simps!]
def resId {G : MonCat} : res V (𝟙 G) ≅ 𝟭 (Action V G)

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
{G : MonCat}
(X : Action V G)

((Action.resId V).inv.app X).hom = 𝟙 X.V


@[simp]
theorem length_eq_zero_iff {u : V} {p : G.Walk u u} : p.length = 0 ↔ p = nil

{V : Type u}
{G : SimpleGraph V}
{u : V}
{p : G.Walk u u}


theorem isCoprime_iff_exists : IsCoprime I J ↔ ∃ i ∈ I, ∃ j ∈ J, i + j = 1

{R : Type u}
[CommSemiring R]
{I J : Ideal R}


theorem adj_incidenceSet_inter {v : V} {e : Sym2 V} (he : e ∈ G.edgeSet) (h : v ∈ e) :
    G.incidenceSet v ∩ G.incidenceSet (Sym2.Mem.other h) = {e}

{V : Type u}
(G : SimpleGraph V)
{v : V}
{e : Sym2 V}
(he : e ∈ G.edgeSet)
(h : v ∈ e)