/-- Left `Mul` by a `k : α` over `[Ring α]` is injective, if `k` is not a zero divisor.
The typeclass that restricts all terms of `α` to have this property is `NoZeroDivisors`. -/
theorem isLeftRegular_of_non_zero_divisor [NonUnitalNonAssocRing α] (k : α)
    (h : ∀ x : α, k * x = 0 → x = 0) : IsLeftRegular k

{α : Type u_1}
[NonUnitalNonAssocRing α]
(k : α)
(h : ∀ (x : α), k * x = 0 → x = 0)


theorem equiv_image_eq_iff_subset (e : α ≃ α) (hs : s.Finite) : e '' s = s ↔ e '' s ⊆ s

{α : Type u_1}
{s : Set α}
(e : α ≃ α)
(hs : s.Finite)


@[simp]
theorem one_le_scalingConstantOf (K : ℝ) : 1 ≤ scalingConstantOf μ K

{α : Type u_1}
[MetricSpace α]
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
[IsUnifLocDoublingMeasure μ]
(K : ℝ)

1 ≤ IsUnifLocDoublingMeasure.scalingConstantOf μ K


@[to_additive (attr := simp)] lemma oneLePart_one : (1 : α)⁺ᵐ = 1


theorem nhdsSet_iUnion {ι : Sort*} (s : ι → Set X) : 𝓝ˢ (⋃ i, s i) = ⨆ i, 𝓝ˢ (s i)

{X : Type u_1}
[TopologicalSpace X]
{ι : Sort u_3}
(s : ι → Set X)


theorem Continuous.mapsTo_connectedComponent [TopologicalSpace β] {f : α → β} (h : Continuous f)
    (a : α) : MapsTo f (connectedComponent a) (connectedComponent (f a))

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(h : Continuous f)
(a : α)

Set.MapsTo f (connectedComponent a) (connectedComponent (f a))


/-- The `vectorSpan` of the image of a function is the span of the pairwise subtractions with a
given point on the right, excluding the subtraction of that point from itself. -/
theorem vectorSpan_image_eq_span_vsub_set_right_ne (p : ι → P) {s : Set ι} {i : ι} (hi : i ∈ s) :
    vectorSpan k (p '' s) = Submodule.span k ((· -ᵥ p i) '' (p '' (s \ {i})))

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)
{s : Set ι}
{i : ι}
(hi : i ∈ s)

vectorSpan k (p '' s) = Submodule.span k ((fun x => x -ᵥ p i) '' (p '' (s \ {i})))


theorem convexJoin_subset_convexHull (s t : Set E) : convexJoin 𝕜 s t ⊆ convexHull 𝕜 (s ∪ t)

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s t : Set E)

convexJoin 𝕜 s t ⊆ (convexHull 𝕜) (s ∪ t)


protected theorem subtype (p : α → Prop) : DenseEmbedding (subtypeEmb p e)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{e : α → β}
(de : DenseEmbedding e)
(p : α → Prop)

DenseEmbedding (DenseEmbedding.subtypeEmb p e)


@[simp]
theorem tanh_ofReal_im (x : ℝ) : (tanh x).im = 0


/-- The homology map data associated to the identity morphism of a short complex. -/
@[simps]
def id (h : S.HomologyData) : HomologyMapData (𝟙 S) h h

(CategoryTheory.ShortComplex.HomologyMapData.id h).left = CategoryTheory.ShortComplex.LeftHomologyMapData.id h.left


@[simp]
lemma sumLexLift_inr_inr (a : α₂) (b : β₂) :
    sumLexLift f₁ f₂ g₁ g₂ (inr a) (inr b) = (f₂ a b).map ⟨_, inr_injective⟩

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
(f₁ : α₁ → β₁ → Finset γ₁)
(f₂ : α₂ → β₂ → Finset γ₂)
(g₁ : α₁ → β₂ → Finset γ₁)
(g₂ : α₁ → β₂ → Finset γ₂)
(a : α₂)
(b : β₂)

Finset.sumLexLift f₁ f₂ g₁ g₂ (Sum.inr a) (Sum.inr b) = Finset.map { toFun := Sum.inr, inj' := ⋯ } (f₂ a b)


theorem natAbs_valMinAbs_le {n : ℕ} [NeZero n] (x : ZMod n) : x.valMinAbs.natAbs ≤ n / 2


@[to_additive (attr := simp)] lemma top_ne_one : (⊤ : WithTop α) ≠ 1


@[to_additive]
theorem unop_sInf (S : Set (Submonoid Mᵐᵒᵖ)) : (sInf S).unop = sInf (.op ⁻¹' S)

{M : Type u_2}
[MulOneClass M]
(S : Set (Submonoid Mᵐᵒᵖ))

(sInf S).unop = sInf (Submonoid.op ⁻¹' S)


theorem append_assoc {u v w x : V} (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk w x) :
    p.append (q.append r) = (p.append q).append r

{V : Type u}
{G : SimpleGraph V}
{u v w x : V}
(p : G.Walk u v)
(q : G.Walk v w)
(r : G.Walk w x)


@[simp] lemma one_emod_two : (1 : Int) % 2 = 1


/-- ε-δ characterization of uniform continuity on a set for pseudoemetric spaces -/
theorem uniformContinuousOn_iff [PseudoEMetricSpace β] {f : α → β} {s : Set α} :
    UniformContinuousOn f s ↔
      ∀ ε > 0, ∃ δ > 0, ∀ {a}, a ∈ s → ∀ {b}, b ∈ s → edist a b < δ → edist (f a) (f b) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
{s : Set α}

UniformContinuousOn f s ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a : α}, a ∈ s → ∀ {b : α}, b ∈ s → edist a b < δ → edist (f a) (f b) < ε


@[simp]
theorem inl_sub [Sub R] [SubNegZeroMonoid M] (r₁ r₂ : R) :
    (inl (r₁ - r₂) : tsze R M) = inl r₁ - inl r₂

{R : Type u}
(M : Type v)
[Sub R]
[SubNegZeroMonoid M]
(r₁ r₂ : R)

TrivSqZeroExt.inl (r₁ - r₂) = TrivSqZeroExt.inl r₁ - TrivSqZeroExt.inl r₂


theorem span_singleton_eq_range (y : M) : ↑(R ∙ y) = range ((· • y) : R → M)

(R : Type u_1)
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(y : M)

↑(Submodule.span R {y}) = Set.range fun x => x • y


@[simp] theorem lastCases_castSucc {n : Nat} {motive : Fin (n + 1) → Sort _} {last cast}
    (i : Fin n) : (Fin.lastCases last cast (Fin.castSucc i) : motive (Fin.castSucc i)) = cast i

{cast : (i : Fin n) → motive i.castSucc}

Fin.lastCases last cast i.castSucc = cast i


/-- The image of the restriction of an open set to the source is open. -/
theorem isOpen_image_source_inter {s : Set X} (hs : IsOpen s) :
    IsOpen (e '' (e.source ∩ s))

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : Set X}
(hs : IsOpen s)


theorem approx_of_nmem_U (c : CU P) (n : ℕ) {x : X} (hx : x ∉ c.U) : c.approx n x = 1

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(n : ℕ)
{x : X}
(hx : x ∉ c.U)


theorem MonovaryOn.dual : MonovaryOn f g s → MonovaryOn (toDual ∘ f) (toDual ∘ g) s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

MonovaryOn f g s → MonovaryOn (⇑OrderDual.toDual ∘ f) (⇑OrderDual.toDual ∘ g) s


@[simp] lemma sq_le_one_iff_abs_le_one (a : α) : a ^ 2 ≤ 1 ↔ |a| ≤ 1

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


@[simp]
theorem toLeftMovesNim_one_symm (i) :
    (@toLeftMovesNim 1).symm i = ⟨0, Set.mem_Iio.mpr zero_lt_one⟩

SetTheory.PGame.toLeftMovesNim.symm i = ⟨0, ⋯⟩


@[higher_order]
theorem tsnd_eq_snd_id {α β β'} (f : β → β') (x : t α β) :
    tsnd (F := Id) (pure ∘ f) x = pure (snd f x)

{t : Type u → Type u → Type u}
[Bitraversable t]
[LawfulBitraversable t]
{α β β' : Type u}
(f : β → β')

Bitraversable.tsnd (pure ∘ f) = pure ∘ Bifunctor.snd f


@[deprecated zero_divInt (since := "2024-03-18")]
lemma divInt_zero_one : 0 /. 1 = 0


theorem trans_target'' : (e.trans e').target = e' '' (e'.source ∩ e.target)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)

(e.trans e').target = ↑e' '' (e'.source ∩ e.target)


@[simp]
theorem natPred_eq_pred {n : ℕ} (h : 0 < n) : natPred (⟨n, h⟩ : ℕ+) = n.pred


theorem exists_eq_cons_of_ne {u v : V} (hne : u ≠ v) :
    ∀ (p : G.Walk u v), ∃ (w : V) (h : G.Adj u w) (p' : G.Walk w v), p = cons h p'

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(hne : u ≠ v)
(p : G.Walk u v)

∃ w, ∃ (h : G.Adj u w), ∃ p', p = SimpleGraph.Walk.cons h p'


@[simp]
lemma normEDS_zero : normEDS b c d 0 = 0


theorem Ideal.mem_iInf_smul_pow_eq_bot_iff [IsNoetherianRing R] [Module.Finite R M] (x : M) :
    x ∈ (⨅ i : ℕ, I ^ i • ⊤ : Submodule R M) ↔ ∃ r : I, (r : R) • x = x

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
(I : Ideal R)
[IsNoetherianRing R]
[Module.Finite R M]
(x : M)


lemma locallyRingedSpaceAdjunction_homEquiv_apply
    {X : LocallyRingedSpace} {R : CommRingCatᵒᵖ}
    (f : Γ.rightOp.obj X ⟶ R) :
    locallyRingedSpaceAdjunction.homEquiv X R f =
      identityToΓSpec.app X ≫ Spec.locallyRingedSpaceMap f.unop

(f : AlgebraicGeometry.LocallyRingedSpace.Γ.rightOp.obj X ⟶ R)

(AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X R) f =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.identityToΓSpec.app X)
    (AlgebraicGeometry.Spec.locallyRingedSpaceMap f.unop)


/-- See `inv_add_inv` for the more convenient version when `K` is commutative. -/
theorem inv_add_inv' (ha : a ≠ 0) (hb : b ≠ 0) :
    a⁻¹ + b⁻¹ = a⁻¹ * (a + b) * b⁻¹

{α : Type u_1}
[DivisionSemiring α]
{a b : α}
(ha : a ≠ 0)
(hb : b ≠ 0)


lemma IsStrictlySupportedOutside.isSupportedOutside (h : K.IsStrictlySupportedOutside e) :
    K.IsSupportedOutside e


theorem Subalgebra.inv_mem_of_root_of_coeff_zero_ne_zero {x : A} {p : K[X]}
    (aeval_eq : aeval x p = 0) (coeff_zero_ne : p.coeff 0 ≠ 0) : (x⁻¹ : L) ∈ A

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
(A : Subalgebra K L)
{x : ↥A}
{p : K[X]}
(aeval_eq : (Polynomial.aeval x) p = 0)
(coeff_zero_ne : p.coeff 0 ≠ 0)


theorem map₂_flip (f : M →ₗ[R] N →ₗ[R] P) (p : Submodule R M) (q : Submodule R N) :
    map₂ f.flip q p = map₂ f p q

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : M →ₗ[R] N →ₗ[R] P)
(p : Submodule R M)
(q : Submodule R N)

Submodule.map₂ f.flip q p = Submodule.map₂ f p q


@[simp]
theorem infIrred_toDual {a : α} : InfIrred (toDual a) ↔ SupIrred a

{α : Type u_2}
[SemilatticeSup α]
{a : α}

InfIrred (OrderDual.toDual a) ↔ SupIrred a


theorem cauchy₃ (hf : IsCauSeq abv f) {ε : α} (ε0 : 0 < ε) :
    ∃ i, ∀ j ≥ i, ∀ k ≥ j, abv (f k - f j) < ε

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : ℕ → β}
(hf : IsCauSeq abv f)
{ε : α}
(ε0 : 0 < ε)


@[to_additive]
lemma prod_mul_prod_comm (f g h i : α → β) :
    (∏ a ∈ s, f a * g a) * ∏ a ∈ s, h a * i a = (∏ a ∈ s, f a * h a) * ∏ a ∈ s, g a * i a

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[AddCommMonoid β]
(f g h i : α → β)

∑ a ∈ s, (f a + g a) + ∑ a ∈ s, (h a + i a) = ∑ a ∈ s, (f a + h a) + ∑ a ∈ s, (g a + i a)


@[gcongr]
theorem closedBall_subset_closedBall (h : ε₁ ≤ ε₂) : closedBall x ε₁ ⊆ closedBall x ε₂

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{ε₁ ε₂ : ℝ≥0∞}
(h : ε₁ ≤ ε₂)

EMetric.closedBall x ε₁ ⊆ EMetric.closedBall x ε₂


@[simp]
protected theorem IsGδ.univ : IsGδ (univ : Set X)


/-- A product of categories indexed by `Option J` identifies to a binary product. -/
@[simps]
def Pi.optionEquivalence (C' : Option J → Type u₁) [∀ i, Category.{v₁} (C' i)] :
    (∀ i, C' i) ≌ C' none × (∀ (j : J), C' (some j))

[(i : Option J) → CategoryTheory.Category.{v₁, u₁} (C' i)]

(CategoryTheory.Pi.optionEquivalence C').unitIso =
  CategoryTheory.NatIso.pi' fun i =>
    match i with
    | none =>
      CategoryTheory.Iso.refl
        ((CategoryTheory.Functor.id ((i : Option J) → C' i)).comp (CategoryTheory.Pi.eval C' none))
    | some i =>
      CategoryTheory.Iso.refl
        ((CategoryTheory.Functor.id ((i : Option J) → C' i)).comp (CategoryTheory.Pi.eval C' (some i)))


@[simp] lemma dens_eq_one : dens s = 1 ↔ s = univ

{α : Type u_2}
[Fintype α]
{s : Finset α}
[Nonempty α]


@[to_additive]
theorem tprod_subtype_eq_of_mulSupport_subset {f : β → α} {s : Set β} (hs : mulSupport f ⊆ s) :
    ∏' x : s, f x = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{s : Set β}
(hs : Function.mulSupport f ⊆ s)


lemma ranges_join (l : List ℕ) : l.ranges.join = range l.sum


@[simp]
theorem preimage_const_sub_uIcc : (fun x => a - x) ⁻¹' [[b, c]] = [[a - b, a - c]]

{α : Type u_1}
[LinearOrderedAddCommGroup α]
(a b c : α)


@[ext]
theorem ext {φ ψ : characterSpace 𝕜 A} (h : ∀ x, φ x = ψ x) : φ = ψ

{𝕜 : Type u_1}
{A : Type u_2}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[NonUnitalNonAssocSemiring A]
[TopologicalSpace A]
[Module 𝕜 A]
{φ ψ : ↑(WeakDual.characterSpace 𝕜 A)}
(h : ∀ (x : A), φ x = ψ x)


theorem norm_iteratedFDeriv_le (n : ℕ) (x : (i : ι) → E i) :
    ‖iteratedFDeriv 𝕜 n f x‖
      ≤ Nat.descFactorial (Fintype.card ι) n * ‖f‖ * ‖x‖ ^ (Fintype.card ι - n)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{ι : Type u_2}
{E : ι → Type u_3}
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
[Fintype ι]
(f : ContinuousMultilinearMap 𝕜 E F)
(n : ℕ)
(x : (i : ι) → E i)

‖iteratedFDeriv 𝕜 n (⇑f) x‖ ≤ ↑((Fintype.card ι).descFactorial n) * ‖f‖ * ‖x‖ ^ (Fintype.card ι - n)


@[simp]
theorem isBoundedUnder_le_exp_comp {f : α → ℝ} :
    (IsBoundedUnder (· ≤ ·) l fun x => exp (f x)) ↔ IsBoundedUnder (· ≤ ·) l f

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}

(Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => Real.exp (f x)) ↔
  Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l f


@[to_additive (attr := simp)]
theorem mulIndicator_empty (f : α → M) : mulIndicator (∅ : Set α) f = fun _ => 1

{α : Type u_1}
{M : Type u_4}
[One M]
(f : α → M)


@[simp] theorem coe_sSup : (↑(sSup S) : α) = sSup ((↑) '' S)

{α : Type u_2}
[CompleteLattice α]
{a : α}
(S : Set ↑(Set.Iic a))


@[reassoc (attr := simp)]
theorem w {A B : Over X} (f : A ⟶ B) : f.left ≫ B.hom = A.hom

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{A B : CategoryTheory.Over X}
(f : A ⟶ B)

CategoryTheory.CategoryStruct.comp f.left B.hom = A.hom


theorem Ici_mem_nhdsSet_Ioc (h : a ≤ b) : Ici a ∈ 𝓝ˢ (Ioc b c)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : a ≤ b)


/-- Converse to the mean value inequality: if `f` is differentiable at `x₀` and `C`-lipschitz
then its derivative at `x₀` has norm bounded by `C`. -/
theorem HasFDerivAt.le_of_lipschitz {f : E → F} {f' : E →L[𝕜] F} {x₀ : E} (hf : HasFDerivAt f f' x₀)
    {C : ℝ≥0} (hlip : LipschitzWith C f) : ‖f'‖ ≤ C

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x₀ : E}
(hf : HasFDerivAt f f' x₀)
{C : ℝ≥0}
(hlip : LipschitzWith C f)


/-- The additive submonoid of all elements `x` of `M` such that `a • x = 0`
for some `a` in `S`. -/
@[simps!]
def torsion'AddSubMonoid (S : Type*) [CommMonoid S] [DistribMulAction S M] :
    AddSubmonoid M

(M : Type u_2)
[AddCommMonoid M]
(S : Type u_3)
[CommMonoid S]
[DistribMulAction S M]

↑(Submodule.torsion'AddSubMonoid M S) = {x | ∃ a, a • x = 0}


theorem continuous_le_rng {t₁ : TopologicalSpace α} {t₂ t₃ : TopologicalSpace β} (h₁ : t₂ ≤ t₃)
    (h₂ : Continuous[t₁, t₂] f) : Continuous[t₁, t₃] f

{α : Type u}
{β : Type v}
{f : α → β}
{t₁ : TopologicalSpace α}
{t₂ t₃ : TopologicalSpace β}
(h₁ : t₂ ≤ t₃)
(h₂ : Continuous f)


protected theorem prod_mk_left (a : α) : LocallyLipschitz (Prod.mk a : β → α × β)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(a : α)


@[simp, norm_cast]
theorem coe_toNonUnitalRingHom (f : R ≃+* S) : ⇑(f : R →ₙ+* S) = f

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(f : R ≃+* S)


theorem lmapDomain_comp (f : α → α') (g : α' → α'') :
    lmapDomain M R (g ∘ f) = (lmapDomain M R g).comp (lmapDomain M R f)

{α : Type u_1}
(M : Type u_2)
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α' : Type u_7}
{α'' : Type u_8}
(f : α → α')
(g : α' → α'')

Finsupp.lmapDomain M R (g ∘ f) = Finsupp.lmapDomain M R g ∘ₗ Finsupp.lmapDomain M R f


@[simp]
theorem toList_empty : (∅ : Finset α).toList = []


@[simp, norm_cast] lemma re_nnratCast (q : ℚ≥0) : (q : ℂ).re = q


@[simp]
theorem prod_Ico_id_eq_factorial : ∀ n : ℕ, (∏ x ∈ Ico 1 (n + 1), x) = n !


theorem isPiSystem_squareCylinders {C : ∀ i, Set (Set (α i))} (hC : ∀ i, IsPiSystem (C i))
    (hC_univ : ∀ i, univ ∈ C i) :
    IsPiSystem (squareCylinders C)

{ι : Type u_2}
{α : ι → Type u_1}
{C : (i : ι) → Set (Set (α i))}
(hC : ∀ (i : ι), IsPiSystem (C i))
(hC_univ : ∀ (i : ι), Set.univ ∈ C i)


/-- If `E` is an algebraic closure of `F`, then `F` is perfect if and only if `E / F` is
separable. -/
theorem perfectField_iff_isSeparable_algebraicClosure [IsAlgClosure F E] :
    PerfectField F ↔ Algebra.IsSeparable F E

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[IsAlgClosure F E]


@[to_additive]
theorem mk'_spec' (x) (y : S) : f.toMap y * f.mk' x y = f.toMap x

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(y : ↥S)


theorem ratio_le_opNorm : (‖f m‖ / ∏ i, ‖m i‖) ≤ ‖f‖

[(i : ι) → SeminormedAddCommGroup (E i)]

‖f m‖ / ∏ i : ι, ‖m i‖ ≤ ‖f‖


/-- If `K : HomologicalComplex C c'`, then `K.IsStrictlySupportedOutside e` holds for
an embedding `e : c.Embedding c'` of complex shapes if `K.X (e.f i)` is zero for all `i`. -/
structure IsStrictlySupportedOutside : Prop where
  isZero (i : ι) : IsZero (K.X (e.f i))

CategoryTheory.Limits.IsZero (K.X (e.f i))


theorem Ico_ae_eq_Icc' (hb : μ {b} = 0) : Ico a b =ᵐ[μ] Icc a b

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[PartialOrder α]
{a b : α}
(hb : μ {b} = 0)


theorem ceil_lt_add_one (ha : 0 ≤ a) : (⌈a⌉₊ : α) < a + 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
(ha : 0 ≤ a)


theorem mem_succ_iff (v : Vector α (n + 1)) : a ∈ v.toList ↔ a = v.head ∨ a ∈ v.tail.toList

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


theorem IsCoprime.dvd_of_dvd_mul_left (H1 : IsCoprime x y) (H2 : x ∣ y * z) : x ∣ z

{R : Type u}
[CommSemiring R]
{x y z : R}
(H1 : IsCoprime x y)
(H2 : x ∣ y * z)


theorem mem_pretrivializationAt_source (b : B) (x : E b) :
    ⟨b, x⟩ ∈ (a.pretrivializationAt b).source

{B : Type u_2}
{F : Type u_3}
{E : B → Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[(x : B) → TopologicalSpace (E x)]
(a : FiberPrebundle F E)
(b : B)
(x : E b)

{ proj := b, snd := x } ∈ (a.pretrivializationAt b).source


theorem EventuallyEq.countable_bInter {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi =ᶠ[l] t i hi) :
    ⋂ i ∈ S, s i ‹_› =ᶠ[l] ⋂ i ∈ S, t i ‹_›

(h : ∀ (i : ι) (hi : i ∈ S), s i hi =ᶠ[l] t i hi)

⋂ i, ⋂ (h : i ∈ S), s i h =ᶠ[l] ⋂ i, ⋂ (h : i ∈ S), t i h


/-- The `vectorSpan` of an indexed family is the span of the pairwise subtractions with a given
point on the right, excluding the subtraction of that point from itself. -/
theorem vectorSpan_range_eq_span_range_vsub_right_ne (p : ι → P) (i₀ : ι) :
    vectorSpan k (Set.range p) =
      Submodule.span k (Set.range fun i : { x // x ≠ i₀ } => p i -ᵥ p i₀)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)
(i₀ : ι)

vectorSpan k (Set.range p) = Submodule.span k (Set.range fun i => p ↑i -ᵥ p i₀)


@[to_additive (attr := simp)]
theorem refl_apply (m : M) : refl M m = m


@[to_additive (attr := simp)]
lemma mk_zpow [DivInvMonoid M] (a : M) (n : ℤ) : mk (a ^ n) = mk a ^ n

{M : Type u_1}
[DivInvMonoid M]
(a : M)
(n : ℤ)

DomMulAct.mk (a ^ n) = DomMulAct.mk a ^ n


/-- The symmetric difference of two Hahn decompositions has measure zero. -/
theorem of_symmDiff_compl_positive_negative {s : SignedMeasure α} {i j : Set α}
    (hi : MeasurableSet i) (hj : MeasurableSet j) (hi' : 0 ≤[i] s ∧ s ≤[iᶜ] 0)
    (hj' : 0 ≤[j] s ∧ s ≤[jᶜ] 0) : s (i ∆ j) = 0 ∧ s (iᶜ ∆ jᶜ) = 0

(hi' :
  MeasureTheory.VectorMeasure.restrict 0 i ≤ MeasureTheory.VectorMeasure.restrict s i ∧
    MeasureTheory.VectorMeasure.restrict s iᶜ ≤ MeasureTheory.VectorMeasure.restrict 0 iᶜ)

(hj' :
  MeasureTheory.VectorMeasure.restrict 0 j ≤ MeasureTheory.VectorMeasure.restrict s j ∧
    MeasureTheory.VectorMeasure.restrict s jᶜ ≤ MeasureTheory.VectorMeasure.restrict 0 jᶜ)

↑s (symmDiff i j) = 0 ∧ ↑s (symmDiff iᶜ jᶜ) = 0


@[simp]
theorem aequiv_ofEquiv {U : Type*} [CommRing U] [Algebra R U] (h : IsAdjoinRoot S f)
    (h' : IsAdjoinRoot T f) (e : T ≃ₐ[R] U) : h.aequiv (h'.ofEquiv e) = (h.aequiv h').trans e

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{f : R[X]}
{T : Type u_1}
[CommRing T]
[Algebra R T]
{U : Type u_2}
[CommRing U]
[Algebra R U]
(h : IsAdjoinRoot S f)
(h' : IsAdjoinRoot T f)
(e : T ≃ₐ[R] U)


theorem condexpL1_add (hf : Integrable f μ) (hg : Integrable g μ) :
    condexpL1 hm μ (f + g) = condexpL1 hm μ f + condexpL1 hm μ g

{α : Type u_1}
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{f g : α → F'}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

MeasureTheory.condexpL1 hm μ (f + g) = MeasureTheory.condexpL1 hm μ f + MeasureTheory.condexpL1 hm μ g


lemma LieModule.toEnd_lie (x y : L) (z : M) :
    (φ x) ⁅y, z⁆ = ⁅ad R L x y, z⁆ + ⁅y, φ x z⁆

(R : Type u)
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x y : L)
(z : M)

((LieModule.toEnd R L M) x) ⁅y, z⁆ = ⁅((LieAlgebra.ad R L) x) y, z⁆ + ⁅y, ((LieModule.toEnd R L M) x) z⁆


@[to_additive]
lemma prod_fiberwise_eq_prod_filter' (s : Finset ι) (t : Finset κ) (g : ι → κ) (f : κ → α) :
    ∏ j ∈ t, ∏ _i ∈ s.filter fun i ↦ g i = j, f j = ∏ i ∈ s.filter fun i ↦ g i ∈ t, f (g i)

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[CommMonoid α]
[DecidableEq κ]
(s : Finset ι)
(t : Finset κ)
(g : ι → κ)
(f : κ → α)

∏ j ∈ t, ∏ _i ∈ Finset.filter (fun i => g i = j) s, f j = ∏ i ∈ Finset.filter (fun i => g i ∈ t) s, f (g i)


@[simp] theorem toReal_ofNat (n : ℕ) [n.AtLeastTwo] :
    ENNReal.toReal (no_index (OfNat.ofNat n)) = OfNat.ofNat n


@[simp]
theorem formPerm_apply_getElem_length (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs)[xs.length]) = x

{α : Type u_1}
[DecidableEq α]
(x : α)
(xs : List α)

(x :: xs).formPerm (x :: xs)[xs.length] = x


@[simp]
theorem Fintype.card_option {α : Type*} [Fintype α] :
    Fintype.card (Option α) = Fintype.card α + 1


@[to_additive]
theorem mem_mker (f : F) {x : M} : x ∈ mker f ↔ f x = 1

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_5}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(f : F)
{x : M}


protected theorem _root_.Real.toNNReal_mono : Monotone Real.toNNReal


lemma isZero_extend_X' (i' : ι') (hi' : e.r i' = none) :
    IsZero ((K.extend e).X i')

CategoryTheory.Limits.IsZero ((K.extend e).X i')


theorem eq_of_bisim (bisim : IsBisimulation R) {s₁ s₂} (r : s₁ ~ s₂) : s₁ = s₂

(R : Computation α → Computation α → Prop)


/-- Two elements are related by a congruence relation `c` iff they are represented by the same
element of the quotient by `c`. -/
@[simp]
protected theorem eq {a b : R} : (a : c.Quotient) = (b : c.Quotient) ↔ c a b

{R : Type u_2}
[Add R]
[Mul R]
(c : RingCon R)
{a b : R}


/-- A limit (over a general filter) of a.e.-measurable `ℝ≥0∞` valued functions is
a.e.-measurable. -/
lemma aemeasurable_of_tendsto' {ι : Type*} {f : ι → α → ℝ≥0∞} {g : α → ℝ≥0∞}
    {μ : Measure α} (u : Filter ι) [NeBot u] [IsCountablyGenerated u]
    (hf : ∀ i, AEMeasurable (f i) μ) (hlim : ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) u (𝓝 (g a))) :
    AEMeasurable g μ

{f : ι → α → ℝ≥0∞}

{g : α → ℝ≥0∞}

(hlim : ∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun i => f i a) u (𝓝 (g a)))


@[simp]
theorem fac : W.Q ⋙ lift G hG = G

{C : Type uC}
[CategoryTheory.Category.{uC', uC} C]
{W : CategoryTheory.MorphismProperty C}
{D : Type uD}
[CategoryTheory.Category.{uD', uD} D]
(G : CategoryTheory.Functor C D)
(hG : W.IsInvertedBy G)

W.Q.comp (CategoryTheory.Localization.Construction.lift G hG) = G


/-- $\lim_{x\to+\infty}|x|=+\infty$ -/
theorem tendsto_abs_atTop_atTop : Tendsto (abs : α → α) atTop atTop

{α : Type u_3}
[LinearOrderedAddCommGroup α]

Filter.Tendsto abs Filter.atTop Filter.atTop


theorem natCast_def (n : ℕ) : (n : MonoidAlgebra k G) = single (1 : G) (n : k)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[MulOneClass G]
(n : ℕ)


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

{C : Type u}
[CategoryTheory.Category.{v, u} C]

∀ {X Y : CategoryTheory.Arrow (CategoryTheory.Arrow C)} (φ : X ⟶ Y),
  (CategoryTheory.Square.fromArrowArrowFunctor'.map φ).τ₃ = φ.right.left


/-- The Fourier integral of the `n`-th derivative of a function is obtained by multiplying the
Fourier integral of the original function by `(2πI L w ⬝ )^n`. -/
theorem fourierIntegral_iteratedFDeriv [FiniteDimensional ℝ V]
    {μ : Measure V} [Measure.IsAddHaarMeasure μ] {N : ℕ∞} (hf : ContDiff ℝ N f)
    (h'f : ∀ (n : ℕ), n ≤ N → Integrable (iteratedFDeriv ℝ n f) μ) {n : ℕ} (hn : n ≤ N) :
    fourierIntegral 𝐞 μ L.toLinearMap₂ (iteratedFDeriv ℝ n f)
      = (fun w ↦ fourierPowSMulRight (-L.flip) (fourierIntegral 𝐞 μ L.toLinearMap₂ f) w n)

(h'f : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (iteratedFDeriv ℝ n f) μ)

VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ (iteratedFDeriv ℝ n f) = fun w =>
  VectorFourier.fourierPowSMulRight (-L.flip) (VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f) w n


@[simp, norm_cast]
theorem const_apply (x : β) (i : ℕ) : (const x : ℕ → β) i = x

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(x : β)
(i : ℕ)


theorem dep_iff : M.Dep D ↔ ¬M.Indep D ∧ D ⊆ M.E

{α : Type u_1}
{M : Matroid α}
{D : Set α}


/-- The decreasing sequence of submodules consisting of the ranges of the iterates of a linear map.
-/
@[simps]
def iterateRange (f : M →ₗ[R] M) : ℕ →o (Submodule R M)ᵒᵈ

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : M →ₗ[R] M)
(n : ℕ)

f.iterateRange n = LinearMap.range (f ^ n)


/-- A "continuous induction principle" for a closed interval: if a set `s` meets `[a, b]`
on a closed subset, contains `a`, and for any `x ∈ s ∩ [a, b)` the set `s` includes some open
neighborhood of `x` within `(x, +∞)`, then `[a, b] ⊆ s`. -/
theorem IsClosed.Icc_subset_of_forall_mem_nhdsWithin {a b : α} {s : Set α}
    (hs : IsClosed (s ∩ Icc a b)) (ha : a ∈ s) (hgt : ∀ x ∈ s ∩ Ico a b, s ∈ 𝓝[>] x) :
    Icc a b ⊆ s

(hgt : ∀ x ∈ s ∩ Set.Ico a b, s ∈ 𝓝[>] x)


@[reassoc (attr := simp)]
lemma homologyIsoSc'_inv_ι :
    (K.homologyIsoSc' i j k hi hk).inv ≫ K.homologyι j =
      (K.sc' i j k).homologyι ≫ (K.opcyclesIsoSc' i j k hi hk).inv


/-- Coalgebra equivalences are transitive. -/
@[trans, simps!]
def trans (e₁₂ : A ≃ₗc[R] B) (e₂₃ : B ≃ₗc[R] C) : A ≃ₗc[R] C

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[AddCommMonoid C]
[Module R A]
[Module R B]
[Module R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
(e₁₂ : A ≃ₗc[R] B)
(e₂₃ : B ≃ₗc[R] C)

∀ (a : A), (e₁₂.trans e₂₃) a = e₂₃ (e₁₂ a)


@[to_additive] lemma min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (swap (· * ·)) (· < ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d

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

[CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x < x_1]


/-- Extra simp lemma that `dsimp` can use. `simp` will never use this. -/
@[to_additive "Extra simp lemma that `dsimp` can use. `simp` will never use this.",
  simp, nolint simpNF]
theorem mulLeft_symm_apply (a : G) : ((Equiv.mulLeft a).symm : G → G) = (a⁻¹ * ·)

⇑(Equiv.symm (Equiv.mulLeft a)) = fun x => a⁻¹ * x


@[simp]
theorem bracket_apply (x y : ⨁ i, L i) (i : ι) : ⁅x, y⁆ i = ⁅x i, y i⁆

{ι : Type v}
(L : ι → Type w)
[(i : ι) → LieRing (L i)]
(x y : DirectSum ι fun i => L i)
(i : ι)


protected theorem surjective (e : E) : Function.Surjective e

{E : Sort u_1}
{α : Sort u_3}
{β : Sort u_4}
[iE : EquivLike E α β]
(e : E)


@[simp]
theorem log_one_right (b : Ordinal) : log b 1 = 0


private lemma IsWeaklyRegular.swap {a b : R} (h1 : IsWeaklyRegular M [a, b])
    (h2 : torsionBy R M b = a • torsionBy R M b → torsionBy R M b = ⊥) :
    IsWeaklyRegular M [b, a]

(h1 : RingTheory.Sequence.IsWeaklyRegular M [a, b])

(h2 : Submodule.torsionBy R M b = a • Submodule.torsionBy R M b → Submodule.torsionBy R M b = ⊥)

RingTheory.Sequence.IsWeaklyRegular M [b, a]


@[to_additive (attr := simp)]
lemma coe_id {X : Grp} : (𝟙 X : X → X) = id


lemma tendsto_measure_biUnion_Ici_zero_of_pairwise_disjoint
    {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ]
    {Es : ℕ → Set X} (Es_mble : ∀ i, MeasurableSet (Es i))
    (Es_disj : Pairwise fun n m ↦ Disjoint (Es n) (Es m)) :
    Tendsto (μ ∘ fun n ↦ ⋃ i ≥ n, Es i) atTop (𝓝 0)

(Es_mble : ∀ (i : ℕ), MeasurableSet (Es i))

(Es_disj : Pairwise fun n m => Disjoint (Es n) (Es m))

Filter.Tendsto (⇑μ ∘ fun n => ⋃ i, ⋃ (_ : i ≥ n), Es i) Filter.atTop (𝓝 0)


@[simp]
theorem coe_submodule_le_coe_submodule : (K : Submodule R L) ≤ K' ↔ K ≤ K'

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(K K' : LieSubalgebra R L)


/-- The constant functor followed by the evaluation functor is just the identity. -/
@[simps!]
def Functor.constCompEvaluationObj (X : C) : Functor.const C ⋙ (evaluation C D).obj X ≅ 𝟭 D

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

∀ (X_1 : D), (CategoryTheory.Functor.constCompEvaluationObj D X).inv.app X_1 = CategoryTheory.CategoryStruct.id X_1


/-- An intermediate field contains the image of the smaller field. -/
theorem algebraMap_mem (x : K) : algebraMap K L x ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(x : K)


/-- A map between two inner product spaces is a conformal map if and only if it preserves inner
products up to a scalar factor, i.e., there exists a positive `c : ℝ` such that
`⟪f u, f v⟫ = c * ⟪u, v⟫` for all `u`, `v`. -/
theorem isConformalMap_iff (f : E →L[ℝ] F) :
    IsConformalMap f ↔ ∃ c : ℝ, 0 < c ∧ ∀ u v : E, ⟪f u, f v⟫ = c * ⟪u, v⟫

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ E]
[InnerProductSpace ℝ F]
(f : E →L[ℝ] F)

IsConformalMap f ↔ ∃ c, 0 < c ∧ ∀ (u v : E), ⟪f u, f v⟫_ℝ = c * ⟪u, v⟫_ℝ


@[simp, norm_cast]
theorem coe_one : ((1 : R) : ℍ[R]) = 1


@[ext]
theorem int_hom_ext {G : AddCommGrp.{0}} (f g : AddCommGrp.of ℤ ⟶ G)
    (w : f (1 : ℤ) = g (1 : ℤ)) : f = g

{G : AddCommGrp}
(f g : AddCommGrp.of ℤ ⟶ G)
(w : f 1 = g 1)


@[simp]
theorem image_symm_image (h : M ≃ₘ^n⟮I, J⟯ N) (s : Set N) : h '' (h.symm '' s) = s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
(s : Set N)


@[to_additive]
theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite α] :
    exponent α = 0

{α : Type u}
[AddGroup α]
[IsAddCyclic α]
[Infinite α]


theorem Finset.prod_dvd_of_isRelPrime :
    (t : Set I).Pairwise (IsRelPrime on s) → (∀ i ∈ t, s i ∣ z) → (∏ x ∈ t, s x) ∣ z

{α : Type u_2}
{I : Type u_1}
[CommMonoid α]
[DecompositionMonoid α]
{z : α}
{s : I → α}
{t : Finset I}

(↑t).Pairwise (IsRelPrime on s) → (∀ i ∈ t, s i ∣ z) → ∏ x ∈ t, s x ∣ z


@[simp, norm_cast]
theorem coe_star {U : unitary R} : ↑(star U) = (star U : R)

{R : Type u_1}
[Monoid R]
[StarMul R]
{U : ↥(unitary R)}


lemma toMvPolynomial_comp (g : M₂ →ₗ[R] M₃) (f : M₁ →ₗ[R] M₂) (i : ι₃) :
    (g ∘ₗ f).toMvPolynomial b₁ b₃ i =
      bind₁ (f.toMvPolynomial b₁ b₂) (g.toMvPolynomial b₂ b₃ i)

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
{M₃ : Type u_4}
{ι₁ : Type u_5}
{ι₂ : Type u_6}
{ι₃ : Type u_7}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Fintype ι₁]
[Fintype ι₂]
[Finite ι₃]
[DecidableEq ι₁]
[DecidableEq ι₂]
(b₁ : Basis ι₁ R M₁)
(b₂ : Basis ι₂ R M₂)
(b₃ : Basis ι₃ R M₃)
(g : M₂ →ₗ[R] M₃)
(f : M₁ →ₗ[R] M₂)
(i : ι₃)

LinearMap.toMvPolynomial b₁ b₃ (g ∘ₗ f) i =
  (MvPolynomial.bind₁ (LinearMap.toMvPolynomial b₁ b₂ f)) (LinearMap.toMvPolynomial b₂ b₃ g i)


@[simp] lemma mem_singleton [T1Space α] {a b : α} : a ∈ singleton b ↔ a = b

{α : Type u_2}
[TopologicalSpace α]
[T1Space α]
{a b : α}

a ∈ TopologicalSpace.Closeds.singleton b ↔ a = b


theorem mem_vsub : a ∈ s -ᵥ t ↔ ∃ b ∈ s, ∃ c ∈ t, b -ᵥ c = a

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


theorem hasDerivAt_neg : HasDerivAt Neg.neg (-1) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


theorem toFun_eq_coe (p : RingNorm R) : p.toFun = p

{R : Type u_2}
[NonUnitalRing R]
(p : RingNorm R)


@[aesop safe apply (rule_sets := [SetLike])]
lemma nnratCast_mem (s : S) (q : ℚ≥0) : (q : K) ∈ s

{K : Type u}
[DivisionRing K]
{S : Type u_1}
[SetLike S K]
[h : SubfieldClass S K]
(s : S)
(q : ℚ≥0)


@[simp]
theorem coe_zero : ↑(0 : SignType) = (0 : α)


@[to_additive]
lemma smul_def (a : M) (x : α × β) : a • x = (a • x.1, a • x.2)

{M : Type u_1}
{α : Type u_5}
{β : Type u_6}
[VAdd M α]
[VAdd M β]
(a : M)
(x : α × β)


theorem edist_le (f : α → E) {s : Set α} {x y : α} (hx : x ∈ s) (hy : y ∈ s) :
    edist (f x) (f y) ≤ eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
{s : Set α}
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)


theorem ediam_smul₀ (c : 𝕜) (s : Set E) : EMetric.diam (c • s) = ‖c‖₊ • EMetric.diam s

{𝕜 : Type u_1}
{E : Type u_2}
[NormedDivisionRing 𝕜]
[SeminormedAddCommGroup E]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
(c : 𝕜)
(s : Set E)


theorem strictAnti_iff_Icc [LinearOrderedAddCommGroup G] [Archimedean G] [OrderedAddCommGroup H]
    [AddConstMapClass F G H a b] {f : F} (ha : 0 < a) (l : G) :
    StrictAnti f ↔ StrictAntiOn f (Icc l (l + a))

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[LinearOrderedAddCommGroup G]
[Archimedean G]
[OrderedAddCommGroup H]
[AddConstMapClass F G H a b]
{f : F}
(ha : 0 < a)
(l : G)

StrictAnti ⇑f ↔ StrictAntiOn (⇑f) (Set.Icc l (l + a))


theorem rank_mul_le [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) :
    (A * B).rank ≤ min A.rank B.rank

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{R : Type u_5}
[Fintype n]
[Fintype o]
[CommRing R]
[StrongRankCondition R]
(A : Matrix m n R)
(B : Matrix n o R)


lemma ciInf_neg {p : Prop} {f : p → α} (hp : ¬ p) :
    ⨅ (h : p), f h = sInf (∅ : Set α)

{α : Type u_1}
[ConditionallyCompleteLattice α]
{p : Prop}
{f : p → α}
(hp : ¬p)


/-- If `f` and `g` with values in `ℝ≥0∞` are independent and almost everywhere measurable,
   then `E[f * g] = E[f] * E[g]` (slightly generalizing
   `lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun`). -/
theorem lintegral_mul_eq_lintegral_mul_lintegral_of_indepFun' (h_meas_f : AEMeasurable f μ)
    (h_meas_g : AEMeasurable g μ) (h_indep_fun : IndepFun f g μ) :
    (∫⁻ ω, (f * g) ω ∂μ) = (∫⁻ ω, f ω ∂μ) * ∫⁻ ω, g ω ∂μ

(h_indep_fun : ProbabilityTheory.IndepFun f g μ)

∫⁻ (ω : Ω), (f * g) ω ∂μ = (∫⁻ (ω : Ω), f ω ∂μ) * ∫⁻ (ω : Ω), g ω ∂μ


@[nontriviality]
lemma iIndepFun.of_subsingleton [IsProbabilityMeasure μ] [Subsingleton ι] : iIndepFun m f μ

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{β : ι → Type u_10}
{m : (i : ι) → MeasurableSpace (β i)}
{f : (i : ι) → Ω → β i}
[MeasureTheory.IsProbabilityMeasure μ]
[Subsingleton ι]


@[simp] theorem arrowCongr_trans {α₁ α₂ α₃ β₁ β₂ β₃ : Sort*}
    (e₁ : α₁ ≃ α₂) (e₁' : β₁ ≃ β₂) (e₂ : α₂ ≃ α₃) (e₂' : β₂ ≃ β₃) :
    arrowCongr (e₁.trans e₂) (e₁'.trans e₂') = (arrowCongr e₁ e₁').trans (arrowCongr e₂ e₂')

{α₁ : Sort u_1}
{α₂ : Sort u_2}
{α₃ : Sort u_3}
{β₁ : Sort u_4}
{β₂ : Sort u_5}
{β₃ : Sort u_6}
(e₁ : α₁ ≃ α₂)
(e₁' : β₁ ≃ β₂)
(e₂ : α₂ ≃ α₃)
(e₂' : β₂ ≃ β₃)

(e₁.trans e₂).arrowCongr (e₁'.trans e₂') = (e₁.arrowCongr e₁').trans (e₂.arrowCongr e₂')


lemma IsMeasurableRatCDF.le_one {f : α → ℚ → ℝ} (hf : IsMeasurableRatCDF f) (a : α) (q : ℚ) :
    f a q ≤ 1

{f : α → ℚ → ℝ}

(hf : ProbabilityTheory.IsMeasurableRatCDF f)


theorem quotEquivQuotMap_symm_apply_mk (f g : R[X]) (I : Ideal R) :
    (AdjoinRoot.quotEquivQuotMap f I).symm (Ideal.Quotient.mk _
      (Polynomial.map (Ideal.Quotient.mk I) g)) =
        Ideal.Quotient.mk (Ideal.map (of f) I) (AdjoinRoot.mk f g)

{R : Type u}
[CommRing R]
(f g : R[X])
(I : Ideal R)

(AdjoinRoot.quotEquivQuotMap f I).symm
    ((Ideal.Quotient.mk (Ideal.span {Polynomial.map (Ideal.Quotient.mk I) f}))
      (Polynomial.map (Ideal.Quotient.mk I) g)) =
  (Ideal.Quotient.mk (Ideal.map (AdjoinRoot.of f) I)) ((AdjoinRoot.mk f) g)


@[to_additive (attr := simp)]
theorem MulHom.coe_comp [Mul M] [Mul N] [Mul P] (g : N →ₙ* P) (f : M →ₙ* N) :
    ↑(g.comp f) = g ∘ f

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[Add M]
[Add N]
[Add P]
(g : AddHom N P)
(f : AddHom M N)


theorem uniq (h : IsUniversal f) (η : g ⟶ f) : η = h.from g

{f g : CategoryTheory.CostructuredArrow S T}

η = CategoryTheory.Limits.IsTerminal.from h g


@[simp]
theorem map_exp_nhds (x : ℝ) : map exp (𝓝 x) = 𝓝 (exp x)

Filter.map Real.exp (𝓝 x) = 𝓝 (Real.exp x)


theorem monotone_filter_left : Monotone (filter p)

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]


theorem foldrIdxM_eq_foldrM_enum {β} (f : ℕ → α → β → m β) (b : β) (as : List α) [LawfulMonad m] :
    foldrIdxM f b as = foldrM (uncurry f) b (enum as)

{α : Type u}
{m : Type u → Type v}
[Monad m]
{β : Type u}
(f : ℕ → α → β → m β)
(b : β)
(as : List α)
[LawfulMonad m]

List.foldrIdxM f b as = List.foldrM (Function.uncurry f) b as.enum


theorem range_eq_map_top (φ : A →⋆ₐ[R] B) : φ.range = (⊤ : StarSubalgebra R A).map φ

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
(φ : A →⋆ₐ[R] B)


/-- A relation isomorphism between equal relations on equal types. -/
@[simps! toEquiv apply]
protected def cast {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} (h₁ : α = β)
    (h₂ : HEq r s) : r ≃r s

(RelIso.cast h₁ h₂).toEquiv = Equiv.cast h₁


@[gcongr]
theorem closedBall_subset_closedBall (h : ε₁ ≤ ε₂) : closedBall x ε₁ ⊆ closedBall x ε₂

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε₁ ε₂ : ℝ}
(h : ε₁ ≤ ε₂)

Metric.closedBall x ε₁ ⊆ Metric.closedBall x ε₂


@[to_additive (attr := simp)]
theorem mem_map {f : F} {S : Submonoid M} {y : N} : y ∈ S.map f ↔ ∃ x ∈ S, f x = y

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
{S : AddSubmonoid M}
{y : N}

y ∈ AddSubmonoid.map f S ↔ ∃ x ∈ S, f x = y


@[simp]
theorem rpow_one (x : ℝ≥0∞) : x ^ (1 : ℝ) = x


theorem kerase_append_left {a} :
    ∀ {l₁ l₂ : List (Sigma β)}, a ∈ l₁.keys → kerase a (l₁ ++ l₂) = kerase a l₁ ++ l₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{l₁ l₂ : List (Sigma β)}

a ∈ l₁.keys → List.kerase a (l₁ ++ l₂) = List.kerase a l₁ ++ l₂


/-- If the domain of a function is a sequential space, then continuity of this function is
equivalent to its sequential continuity. -/
theorem continuous_iff_seqContinuous [SequentialSpace X] {f : X → Y} :
    Continuous f ↔ SeqContinuous f

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


theorem insert_inj_on (s : Finset α) : Set.InjOn (fun a => insert a s) sᶜ

{α : Type u_1}
[DecidableEq α]
(s : Finset α)


@[to_additive tendsto_norm_cobounded_atTop]
lemma tendsto_norm_cobounded_atTop' : Tendsto norm (cobounded E) atTop

Filter.Tendsto norm (Bornology.cobounded E) Filter.atTop


theorem eq_one_iff_not_exists_prime_dvd {n : ℕ} : n = 1 ↔ ∀ p : ℕ, p.Prime → ¬p ∣ n


/-- If a class has a Fraïssé limit, it must be Fraïssé. -/
theorem isFraisse [Countable (Σ l, L.Functions l)] [Countable M] (h : IsFraisseLimit K M) :
    IsFraisse K

(K : Set (CategoryTheory.Bundled L.Structure))

(h : FirstOrder.Language.IsFraisseLimit K M)


theorem image_sigmaMk_subset_sigma_left {a : ∀ i, α i} (ha : ∀ i, a i ∈ t i) :
    (fun i ↦ Sigma.mk i (a i)) '' s ⊆ s.sigma t

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{a : (i : ι) → α i}
(ha : ∀ (i : ι), a i ∈ t i)


theorem finset_sum_apply (I : Finset ι) (κ : ι → Kernel α β) (a : α) :
    (∑ i ∈ I, κ i) a = ∑ i ∈ I, κ i a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(I : Finset ι)
(κ : ι → ProbabilityTheory.Kernel α β)
(a : α)


theorem tendsto_atBot_of_eventually_const {ι : Type*} [SemilatticeInf ι] [Nonempty ι]
    {u : ι → X} {i₀ : ι} (h : ∀ i ≤ i₀, u i = x) : Tendsto u atBot (𝓝 x)

{X : Type u}
{x : X}
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf ι]
[Nonempty ι]
{u : ι → X}
{i₀ : ι}
(h : ∀ i ≤ i₀, u i = x)


theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{f : E → F}
{x : E}
(h : HasFPowerSeriesAt f p x)


theorem Integrable.sub (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    Integrable I l (f - g) vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f g : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
(hf : BoxIntegral.Integrable I l f vol)
(hg : BoxIntegral.Integrable I l g vol)


@[simp] lemma cond_eq_zero (hμs : μ s ≠ ⊤) : μ[|s] = 0 ↔ μ s = 0

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s : Set Ω}
(hμs : μ s ≠ ⊤)

ProbabilityTheory.cond μ s = 0 ↔ μ s = 0


theorem iIndepFun.indepFun {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} {β : ι → Type*}
    {m : ∀ x, MeasurableSpace (β x)} {f : ∀ i, Ω → β i} (hf_Indep : iIndepFun m f κ μ) {i j : ι}
    (hij : i ≠ j) : IndepFun (f i) (f j) κ μ

(hf_Indep : ProbabilityTheory.Kernel.iIndepFun m f κ μ)

ProbabilityTheory.Kernel.IndepFun (f i) (f j) κ μ


@[simp]
lemma φ_two : W.φ 2 = C X * W.ψ₂ ^ 2 - C W.Ψ₃

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)

W.φ 2 = Polynomial.C Polynomial.X * W.ψ₂ ^ 2 - Polynomial.C W.Ψ₃


@[mono] theorem mono {x y} (h : x ≤ y) : f x ≤ f y

(f : CircleDeg1Lift)
{x y : ℝ}
(h : x ≤ y)


theorem iSup_toAddSubmonoid {ι : Sort*} (p : ι → Submodule R M) :
    (⨆ i, p i).toAddSubmonoid = ⨆ i, (p i).toAddSubmonoid

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Sort u_9}
(p : ι → Submodule R M)


@[simp]
theorem blockTriangular_zero : BlockTriangular (0 : Matrix m m R) b

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
{b : m → α}
[LT α]


theorem _root_.IsAntichain.partiallyWellOrderedOn_iff (hs : IsAntichain r s) :
    s.PartiallyWellOrderedOn r ↔ s.Finite

{α : Type u_2}
{r : α → α → Prop}
{s : Set α}
[IsRefl α r]
(hs : IsAntichain r s)


protected theorem pair {g : α →ₛ γ} (hf : f.FinMeasSupp μ) (hg : g.FinMeasSupp μ) :
    (pair f g).FinMeasSupp μ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
[Zero β]
[Zero γ]
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α β}
{g : MeasureTheory.SimpleFunc α γ}
(hf : f.FinMeasSupp μ)
(hg : g.FinMeasSupp μ)


theorem equivalenceCounitIso_eq (hη : τ₀ = τ₁ hF hG η) :
    (equivalence hF hG).counitIso = equivalenceCounitIso η

{hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor}

(hη : AlgebraicTopology.DoldKan.Compatibility.τ₀ = AlgebraicTopology.DoldKan.Compatibility.τ₁ hF hG η)

(AlgebraicTopology.DoldKan.Compatibility.equivalence hF hG).counitIso =
  AlgebraicTopology.DoldKan.Compatibility.equivalenceCounitIso η


@[simp]
theorem iselect_cons [DecidableEq F.A] [Inhabited (M F)] (ps : Path F) {a} (f : F.B a → M F) {i} :
    iselect (⟨a, i⟩ :: ps) (M.mk ⟨a, f⟩) = iselect ps (f i)

{F : PFunctor.{u}}
[DecidableEq F.A]
[Inhabited F.M]
(ps : PFunctor.Approx.Path F)
{a : F.A}
(f : F.B a → F.M)
{i : F.B a}

PFunctor.M.iselect (⟨a, i⟩ :: ps) (PFunctor.M.mk ⟨a, f⟩) = PFunctor.M.iselect ps (f i)


/-- Closed balls and spheres coincide when the radius is non-positive -/
theorem closedBall_eq_sphere_of_nonpos (hε : ε ≤ 0) : closedBall x ε = sphere x ε

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}
(hε : ε ≤ 0)

Metric.closedBall x ε = Metric.sphere x ε


@[simp]
theorem coe_orderEmbeddingOfSet [DecidablePred (· ∈ s)] :
    ⇑(orderEmbeddingOfSet s) = (↑) ∘ Subtype.ofNat s

{s : Set ℕ}
[Infinite ↑s]
[DecidablePred fun x => x ∈ s]

⇑(Nat.orderEmbeddingOfSet s) = Subtype.val ∘ Nat.Subtype.ofNat s


@[simp]
theorem constr_basisSpanSingleton {N : Type*} [Semiring N] [Module N S] [SMulCommClass R N S]
    (b : Basis ι R S) {x : S} (hx : x ≠ 0) :
    (b.constr N).toFun (((↑) : _ → S) ∘ (basisSpanSingleton b hx)) = Algebra.lmul R S x

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[CommSemiring R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{N : Type u_4}
[Semiring N]
[Module N S]
[SMulCommClass R N S]
(b : Basis ι R S)
{x : S}
(hx : x ≠ 0)

(↑(b.constr N)).toFun (Subtype.val ∘ ⇑(Ideal.basisSpanSingleton b hx)) = (Algebra.lmul R S) x


/-- If `m₁ d ≤ m₂ d` for `d < ε` for some `ε > 0` (we use `≤ᶠ[𝓝[≥] 0]` to state this), then
`mkMetric m₁ hm₁ ≤ mkMetric m₂ hm₂`. -/
theorem mkMetric_mono {m₁ m₂ : ℝ≥0∞ → ℝ≥0∞} (hle : m₁ ≤ᶠ[𝓝[≥] 0] m₂) :
    (mkMetric m₁ : Measure X) ≤ mkMetric m₂

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
{m₁ m₂ : ℝ≥0∞ → ℝ≥0∞}
(hle : m₁ ≤ᶠ[𝓝[≥] 0] m₂)

MeasureTheory.Measure.mkMetric m₁ ≤ MeasureTheory.Measure.mkMetric m₂


theorem eq_zero_of_forall_index_sum_mul_pow_eq_zero {R : Type*} [CommRing R] [IsDomain R] {n : ℕ}
    {f v : Fin n → R} (hf : Function.Injective f) (hfv : ∀ j, (∑ i, v i * f j ^ (i : ℕ)) = 0) :
    v = 0

(hfv : ∀ (j : Fin n), ∑ i : Fin n, v i * f j ^ ↑i = 0)


/-- Functor translating a functor into the category of commutative monoid objects
to a commutative monoid object in the functor category
-/
@[simps!]
def inverse : (C ⥤ CommMon_ D) ⥤ CommMon_ (C ⥤ D)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
[CategoryTheory.BraidedCategory D]

∀ {X Y : C ⥤ CommMon_ D} (α : X ⟶ Y) (X_1 : C),
  (CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.inverse.map α).hom.app X_1 = (α.app X_1).hom


@[to_additive]
theorem tprod_le_tprod (h : ∀ i, f i ≤ g i) (hf : Multipliable f) (hg : Multipliable g) :
    ∏' i, f i ≤ ∏' i, g i

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f g : ι → α}
(h : ∀ (i : ι), f i ≤ g i)
(hf : Multipliable f)
(hg : Multipliable g)


@[simp]
theorem sInf_toSubsemigroup (s : Set (NonUnitalSubsemiring R)) :
    (sInf s).toSubsemigroup = ⨅ t ∈ s, NonUnitalSubsemiring.toSubsemigroup t

{R : Type u}
[NonUnitalNonAssocSemiring R]
(s : Set (NonUnitalSubsemiring R))

(sInf s).toSubsemigroup = ⨅ t ∈ s, t.toSubsemigroup


@[to_additive]
theorem one_le_of_le_mul_left [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (h : b ≤ a * b) :
    1 ≤ a

[ContravariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


@[simp] theorem toHopfAlgebraCatIso_trans (e : X ≃ₐc[R] Y) (f : Y ≃ₐc[R] Z) :
    toHopfAlgebraCatIso (e.trans f) = toHopfAlgebraCatIso e ≪≫ toHopfAlgebraCatIso f

{R : Type u}
[CommRing R]
{X Y Z : Type v}
[Ring X]
[Ring Y]
[Ring Z]
[HopfAlgebra R X]
[HopfAlgebra R Y]
[HopfAlgebra R Z]
(e : X ≃ₐc[R] Y)
(f : Y ≃ₐc[R] Z)

(e.trans f).toHopfAlgebraCatIso = e.toHopfAlgebraCatIso ≪≫ f.toHopfAlgebraCatIso


theorem bind_powerset_len {α : Type*} (S : Multiset α) :
    (bind (Multiset.range (card S + 1)) fun k => S.powersetCard k) = S.powerset

((Multiset.range (Multiset.card S + 1)).bind fun k => Multiset.powersetCard k S) = S.powerset


@[simp]
theorem mk'_coe' {X A : C} (f : A ⟶ X) [Mono f] : (mk' f : C) = A

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X A : C}
(f : A ⟶ X)
[CategoryTheory.Mono f]

(CategoryTheory.MonoOver.mk' f).obj.left = A


/-- The submonoid `A 0` of `R`. -/
@[simps]
def submonoid : Submonoid R

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Monoid R]
[AddMonoid ι]
(A : ι → S)
[SetLike.GradedMonoid A]

↑(SetLike.GradeZero.submonoid A) = ↑(A 0)


/-- In a complete space, if a family of closed sets with diameter tending to `0` is such that each
finite intersection is nonempty, then the total intersection is also nonempty. -/
theorem nonempty_iInter_of_nonempty_biInter [CompleteSpace α] {s : ℕ → Set α}
    (hs : ∀ n, IsClosed (s n)) (h's : ∀ n, IsBounded (s n)) (h : ∀ N, (⋂ n ≤ N, s n).Nonempty)
    (h' : Tendsto (fun n => diam (s n)) atTop (𝓝 0)) : (⋂ n, s n).Nonempty

(h's : ∀ (n : ℕ), Bornology.IsBounded (s n))

(h : ∀ (N : ℕ), (⋂ n, ⋂ (_ : n ≤ N), s n).Nonempty)

(h' : Filter.Tendsto (fun n => Metric.diam (s n)) Filter.atTop (𝓝 0))


@[to_additive]
theorem map_eq_range_iff {f : G →* N} {H : Subgroup G} :
    H.map f = f.range ↔ Codisjoint H f.ker

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{H : AddSubgroup G}

AddSubgroup.map f H = f.range ↔ Codisjoint H f.ker


theorem IsUpperSet.not_top_mem (hs : IsUpperSet s) : ⊤ ∉ s ↔ s = ∅

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

⊤ ∉ s ↔ s = ∅


@[simp]
theorem nndist_vadd_cancel_right (v₁ v₂ : V) (x : P) : nndist (v₁ +ᵥ x) (v₂ +ᵥ x) = nndist v₁ v₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(v₁ v₂ : V)
(x : P)


theorem chromaticNumber_bot [Nonempty V] : (⊥ : SimpleGraph V).chromaticNumber = 1


theorem contDiff_polynomial_eval_inv_mul {n : ℕ∞} (p : ℝ[X]) :
    ContDiff ℝ n (fun x ↦ p.eval x⁻¹ * expNegInvGlue x)

ContDiff ℝ n fun x => Polynomial.eval x⁻¹ p * expNegInvGlue x


protected theorem le_sub_iff_add_le {n : Nat} (h : k ≤ m) : n ≤ m - k ↔ n + k ≤ m


theorem uniqueDiffOn_empty : UniqueDiffOn 𝕜 (∅ : Set E)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]


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

Polynomial.map f Polynomial.X = Polynomial.X


@[to_additive]
theorem ker_prodMap {G' : Type*} {N' : Type*} [Group G'] [Group N'] (f : G →* N) (g : G' →* N') :
    (prodMap f g).ker = f.ker.prod g.ker

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{G' : Type u_8}
{N' : Type u_9}
[AddGroup G']
[AddGroup N']
(f : G →+ N)
(g : G' →+ N')


/-- Typeclass for a matroid having finite ground set. Just a wrapper for `M.E.Finite`-/
protected class Finite (M : Matroid α) : Prop where
  /-- The ground set is finite -/
  (ground_finite : M.E.Finite)

{α : Type u_1}
{M : Matroid α}
[self : M.Finite]


/-- Reformulation of `sinZeta_two_mul_nat_add_one` using `Gammaℂ`. -/
theorem sinZeta_two_mul_nat_add_one' (hk : k ≠ 0) (hx : x ∈ Icc (0 : ℝ) 1) :
    sinZeta x (2 * k + 1) = (-1) ^ (k + 1) / (2 * k + 1) / Gammaℂ (2 * k + 1) *
      ((Polynomial.bernoulli (2 * k + 1)).map (algebraMap ℚ ℂ)).eval (x : ℂ)

{k : ℕ}
{x : ℝ}
(hk : k ≠ 0)
(hx : x ∈ Set.Icc 0 1)

HurwitzZeta.sinZeta (↑x) (2 * ↑k + 1) =
  (-1) ^ (k + 1) / (2 * ↑k + 1) / (2 * ↑k + 1).Gammaℂ *
    Polynomial.eval (↑x) (Polynomial.map (algebraMap ℚ ℂ) (Polynomial.bernoulli (2 * k + 1)))


theorem uniformSpace_eq_iInf_precomp_of_cover {δ : ι → Type*} [∀ i, TopologicalSpace (δ i)]
    (φ : Π i, C(δ i, α)) (h_proper : ∀ i, IsProperMap (φ i))
    (h_lf : LocallyFinite fun i ↦ range (φ i)) (h_cover : ⋃ i, range (φ i) = univ) :
    (inferInstanceAs <| UniformSpace C(α, β)) = ⨅ i, .comap (comp · (φ i)) inferInstance

(h_proper : ∀ (i : ι), IsProperMap ⇑(φ i))

(h_lf : LocallyFinite fun i => Set.range ⇑(φ i))

(h_cover : ⋃ i, Set.range ⇑(φ i) = Set.univ)

inferInstanceAs (UniformSpace C(α, β)) = ⨅ i, UniformSpace.comap (fun x => x.comp (φ i)) inferInstance


theorem Equiv.uncountable_iff (e : α ≃ β) : Uncountable α ↔ Uncountable β


@[to_additive (attr := simp)]
theorem unop_top : (⊤ : Submonoid Mᵐᵒᵖ).unop = ⊤


theorem add_eq_three_iff {n m : WithBot ℕ} :
    n + m = 3 ↔ n = 0 ∧ m = 3 ∨ n = 1 ∧ m = 2 ∨ n = 2 ∧ m = 1 ∨ n = 3 ∧ m = 0


@[to_additive]
lemma orderOf_eq [Group G] (a : G) {x y : G} (h : SemiconjBy a x y) : orderOf x = orderOf y

{G : Type u_1}
[AddGroup G]
(a : G)
{x y : G}
(h : AddSemiconjBy a x y)


/-- Together `Matrix.detInvertibleOfInvertible` and `Matrix.invertibleOfDetInvertible` form an
equivalence, although both sides of the equiv are subsingleton anyway. -/
@[simps]
def invertibleEquivDetInvertible : Invertible A ≃ Invertible A.det

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
[Invertible A]

A.invertibleEquivDetInvertible inst✝ = A.detInvertibleOfInvertible


/-- A class registering that a real vector space admits bump functions. This will be instantiated
first for inner product spaces, and then for finite-dimensional normed spaces.
We use a specific class instead of `Nonempty (ContDiffBumpBase E)` for performance reasons. -/
class HasContDiffBump (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] : Prop where
  out : Nonempty (ContDiffBumpBase E)

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[self : HasContDiffBump E]


theorem eventually_ge_of_tendsto_gt {l : Filter γ} {f : γ → α} {u v : α} (hv : u < v)
    (h : Tendsto f l (𝓝 v)) : ∀ᶠ a in l, u ≤ f a

{α : Type u}
{γ : Type w}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{l : Filter γ}
{f : γ → α}
{u v : α}
(hv : u < v)
(h : Filter.Tendsto f l (𝓝 v))


@[to_additive (attr := simp)]
theorem inv_mem_iff {S G} [InvolutiveInv G] {_ : SetLike S G} [InvMemClass S G] {H : S}
    {x : G} : x⁻¹ ∈ H ↔ x ∈ H

{S : Type u_5}
{G : Type u_6}
[InvolutiveInv G]

∀ {x : SetLike S G} [inst : InvMemClass S G] {H : S} {x_1 : G}, x_1⁻¹ ∈ H ↔ x_1 ∈ H


theorem completeTheory.subset [MT : M ⊨ T] : T ⊆ L.completeTheory M

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{T : L.Theory}
[MT : M ⊨ T]


@[simp] theorem sign_neg (z : Int) : Int.sign (-z) = -Int.sign z


theorem Integrable.prod_mk {f : α → β} {g : α → γ} (hf : Integrable f μ) (hg : Integrable g μ) :
    Integrable (fun x => (f x, g x)) μ

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

MeasureTheory.Integrable (fun x => (f x, g x)) μ


@[simp, norm_cast]
theorem cast_add [Semiring α] (m n) : ((m + n : Num) : α) = m + n


theorem ratCast_lt {x y : ℚ} : (x : ℝ) < (y : ℝ) ↔ x < y


theorem iselect_eq_default [DecidableEq F.A] [Inhabited (M F)] (ps : Path F) (x : M F)
    (h : ¬IsPath ps x) : iselect ps x = head default

{F : PFunctor.{u}}
[DecidableEq F.A]
[Inhabited F.M]
(ps : PFunctor.Approx.Path F)
(x : F.M)
(h : ¬PFunctor.M.IsPath ps x)


theorem sub_def : μ - ν = sInf { d | μ ≤ d + ν }

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}


@[simp]
theorem count_filter_of_neg {p} [DecidablePred p] {a} {s : Multiset α} (h : ¬p a) :
    count a (filter p s) = 0

{α : Type u_1}
[DecidableEq α]
{p : α → Prop}
[DecidablePred p]
{a : α}
{s : Multiset α}
(h : ¬p a)

Multiset.count a (Multiset.filter p s) = 0


/-- `IntermediateField.extendScalars.orderIso` bundles `IntermediateField.extendScalars`
into an order isomorphism from
`{ E : IntermediateField K L // F ≤ E }` to `IntermediateField F L`. Its inverse is
`IntermediateField.restrictScalars`. -/
@[simps]
def extendScalars.orderIso : { E : IntermediateField K L // F ≤ E } ≃o IntermediateField F L

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(F : IntermediateField K L)
(E : IntermediateField (↥F) L)

↑((RelIso.symm (IntermediateField.extendScalars.orderIso F)) E) = IntermediateField.restrictScalars K E


@[simp, measurability]
theorem measurableSet_Icc : MeasurableSet (Icc a b)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[Preorder α]
[OrderClosedTopology α]
{a b : α}


@[to_additive]
theorem comap_sup_map_of_injective (S T : Submonoid M) : (S.map f ⊔ T.map f).comap f = S ⊔ T

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
(hf : Function.Injective ⇑f)
(S T : AddSubmonoid M)

AddSubmonoid.comap f (AddSubmonoid.map f S ⊔ AddSubmonoid.map f T) = S ⊔ T


theorem bihimp_left_injective (a : α) : Injective (· ⇔ a)

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


theorem continuousWithinAt_iff_lower_upperSemicontinuousWithinAt {f : α → γ} :
    ContinuousWithinAt f s x ↔
      LowerSemicontinuousWithinAt f s x ∧ UpperSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{s : Set α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}


@[to_additive]
theorem toFun_mul_inv_mem (hS : S ∈ Subgroup.rightTransversals (H : Set G)) (g : G) :
    (toFun hS g : G) * g⁻¹ ∈ H

(hS : S ∈ Subgroup.rightTransversals ↑H)

↑(Subgroup.MemRightTransversals.toFun hS g) * g⁻¹ ∈ H


@[to_additive]
protected theorem map_div : (f / g).map m = f.map m / g.map m

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[SubtractionMonoid β]
[FunLike F α β]
[AddMonoidHomClass F α β]
(m : F)
{f g : Filter α}

Filter.map (⇑m) (f - g) = Filter.map (⇑m) f - Filter.map (⇑m) g


/-- There exists an enumeration of an equipartition's parts where
larger parts map to smaller numbers and vice versa. -/
theorem IsEquipartition.exists_partsEquiv (hP : P.IsEquipartition) :
    ∃ f : P.parts ≃ Fin P.parts.card,
      ∀ t, t.1.card = s.card / P.parts.card + 1 ↔ f t < s.card % P.parts.card

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{P : Finpartition s}
(hP : P.IsEquipartition)

∃ f, ∀ (t : { x // x ∈ P.parts }), (↑t).card = s.card / P.parts.card + 1 ↔ ↑(f t) < s.card % P.parts.card


@[to_additive (attr := simp, norm_cast)]
theorem coe_one [One β] : ⇑(1 : α →ₛ β) = 1

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[One β]


@[simp]
theorem nndist_equiv_symm_single_same (i : ι) (b₁ b₂ : β i) :
    nndist
        ((WithLp.equiv p (∀ i, β i)).symm (Pi.single i b₁))
        ((WithLp.equiv p (∀ i, β i)).symm (Pi.single i b₂)) =
      nndist b₁ b₂

[(i : ι) → SeminormedAddCommGroup (β i)]

nndist ((WithLp.equiv p ((i : ι) → β i)).symm (Pi.single i b₁))
    ((WithLp.equiv p ((i : ι) → β i)).symm (Pi.single i b₂)) =
  nndist b₁ b₂


/-- A weighted sum of pairwise subtractions, where the point on the right is constant,
expressed as a subtraction involving a `weightedVSubOfPoint` expression. -/
theorem sum_smul_vsub_const_eq_weightedVSubOfPoint_sub (w : ι → k) (p₁ : ι → P) (p₂ b : P) :
    (∑ i ∈ s, w i • (p₁ i -ᵥ p₂)) = s.weightedVSubOfPoint p₁ b w - (∑ i ∈ s, w i) • (p₂ -ᵥ b)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p₁ : ι → P)
(p₂ b : P)

∑ i ∈ s, w i • (p₁ i -ᵥ p₂) = (s.weightedVSubOfPoint p₁ b) w - (∑ i ∈ s, w i) • (p₂ -ᵥ b)


@[simp]
theorem toDual_iSup (f : ι → α) : toDual (⨆ i, f i) = ⨅ i, toDual (f i)

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
(f : ι → α)

OrderDual.toDual (⨆ i, f i) = ⨅ i, OrderDual.toDual (f i)


/--
The type of homotopies between `f₀ f₁ : C(X, Y)`, where the intermediate maps satisfy the predicate
`P : C(X, Y) → Prop`
-/
structure HomotopyWith (f₀ f₁ : C(X, Y)) (P : C(X, Y) → Prop) extends Homotopy f₀ f₁ where
  -- Porting note (#11215): TODO: use `toHomotopy.curry t`
  /-- the intermediate maps of the homotopy satisfy the property -/
  prop' : ∀ t, P ⟨fun x => toFun (t, x),
    Continuous.comp continuous_toFun (continuous_const.prod_mk continuous_id')⟩

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{P : C(X, Y) → Prop}
(self : f₀.HomotopyWith f₁ P)
(t : ↑I)

P { toFun := fun x => self.toFun (t, x), continuous_toFun := ⋯ }


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

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

[ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[to_additive (attr := simp)]
theorem map_coe (f : α →ₙ* β) (a : α) : map f (a : WithOne α) = f a

{α : Type u}
{β : Type v}
[Add α]
[Add β]
(f : AddHom α β)
(a : α)


lemma nontrivial_of_char_ne_one {v : ℕ} (hv : v ≠ 1) [hr : CharP R v] : Nontrivial R

{R : Type u_1}
[NonAssocSemiring R]
{v : ℕ}
(hv : v ≠ 1)
[hr : CharP R v]


theorem exp_re : (exp x).re = Real.exp x.re * Real.cos x.im

(Complex.exp x).re = Real.exp x.re * Real.cos x.im


theorem coe_untop'_le (a : WithTop α) (b : α) : a.untop' b ≤ a

{α : Type u_1}
[Preorder α]
(a : WithTop α)
(b : α)


/-- If a function tends to infinity along a filter, then this function multiplied by a positive
constant (on the left) also tends to infinity. The archimedean assumption is convenient to get a
statement that works on `ℕ`, `ℤ` and `ℝ`, although not necessary (a version in ordered fields is
given in `Filter.Tendsto.const_mul_atTop`). -/
theorem Tendsto.const_mul_atTop' (hr : 0 < r) (hf : Tendsto f l atTop) :
    Tendsto (fun x => r * f x) l atTop

{α : Type u_1}
{R : Type u_2}
{l : Filter α}
{f : α → R}
{r : R}
[LinearOrderedSemiring R]
[Archimedean R]
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => r * f x) l Filter.atTop


theorem OrthogonalFamily.norm_sq_diff_sum [DecidableEq ι] (f : ∀ i, G i) (s₁ s₂ : Finset ι) :
    ‖(∑ i ∈ s₁, V i (f i)) - ∑ i ∈ s₂, V i (f i)‖ ^ 2 =
      (∑ i ∈ s₁ \ s₂, ‖f i‖ ^ 2) + ∑ i ∈ s₂ \ s₁, ‖f i‖ ^ 2

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{G : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
[DecidableEq ι]
(f : (i : ι) → G i)
(s₁ s₂ : Finset ι)

‖∑ i ∈ s₁, (V i) (f i) - ∑ i ∈ s₂, (V i) (f i)‖ ^ 2 = ∑ i ∈ s₁ \ s₂, ‖f i‖ ^ 2 + ∑ i ∈ s₂ \ s₁, ‖f i‖ ^ 2


/-- Reindexing by `Equiv.refl` yields the original simplex. -/
@[simp]
theorem reindex_refl {n : ℕ} (s : Simplex k P n) : s.reindex (Equiv.refl (Fin (n + 1))) = s

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{n : ℕ}
(s : Affine.Simplex k P n)


/-- Orbit-stabilizer theorem. -/
@[to_additive AddAction.card_orbit_mul_card_stabilizer_eq_card_addGroup "Orbit-stabilizer theorem."]
theorem card_orbit_mul_card_stabilizer_eq_card_group (b : β) [Fintype α] [Fintype <| orbit α b]
    [Fintype <| stabilizer α b] :
    Fintype.card (orbit α b) * Fintype.card (stabilizer α b) = Fintype.card α

(α : Type u)
{β : Type v}
[AddGroup α]
[AddAction α β]
(b : β)
[Fintype α]
[Fintype ↑(AddAction.orbit α b)]
[Fintype ↥(AddAction.stabilizer α b)]

Fintype.card ↑(AddAction.orbit α b) * Fintype.card ↥(AddAction.stabilizer α b) = Fintype.card α


theorem list_bind {f : α → List β} {g : α → β → List σ} (hf : Primrec f) (hg : Primrec₂ g) :
    Primrec (fun a => (f a).bind (g a))

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → List β}
{g : α → β → List σ}
(hf : Primrec f)
(hg : Primrec₂ g)


theorem associator_hom (X Y Z : C) :
    (α_ X Y Z).hom =
      prod.lift (Limits.prod.fst ≫ Limits.prod.fst)
        (prod.lift (Limits.prod.fst ≫ Limits.prod.snd) Limits.prod.snd)

(CategoryTheory.MonoidalCategory.associator X Y Z).hom =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst)
    (CategoryTheory.Limits.prod.lift
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.snd)
      CategoryTheory.Limits.prod.snd)


@[simp]
theorem monomial_eq_zero {s : σ →₀ ℕ} {b : R} : monomial s b = 0 ↔ b = 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{s : σ →₀ ℕ}
{b : R}


@[to_additive]
theorem mulSupport_eq_iff {f : α → M} {s : Set α} :
    mulSupport f = s ↔ (∀ x, x ∈ s → f x ≠ 1) ∧ ∀ x, x ∉ s → f x = 1

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α → M}
{s : Set α}

Function.support f = s ↔ (∀ x ∈ s, f x ≠ 0) ∧ ∀ x ∉ s, f x = 0


theorem le_of_mem_argmin : a ∈ l → m ∈ argmin f l → f m ≤ f a

{α : Type u_1}
{β : Type u_2}
[LinearOrder β]
{f : α → β}
{l : List α}
{a m : α}


/-- If a fundamental solution exists, then `d` must be a non-square. -/
theorem d_nonsquare {a : Solution₁ d} (h : IsFundamental a) : ¬IsSquare d

{d : ℤ}
{a : Pell.Solution₁ d}
(h : Pell.IsFundamental a)


@[simp]
theorem inv_left_iff₀ : Commute a⁻¹ b ↔ Commute a b

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}


theorem image_cast_int_Iio (a : ℕ) : (↑) '' Iio a = Ico (0 : ℤ) a


@[continuity]
protected theorem continuous (e : P₁ ≃ᵃL[k] P₂) : Continuous e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)


theorem integral_prod_swap (f : α × β → E) :
    ∫ z, f z.swap ∂ν.prod μ = ∫ z, f z ∂μ.prod ν

{α : Type u_1}
{β : Type u_3}
{E : Type u_6}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[NormedAddCommGroup E]
[MeasureTheory.SFinite ν]
[NormedSpace ℝ E]
[MeasureTheory.SFinite μ]
(f : α × β → E)

∫ (z : β × α), f z.swap ∂ν.prod μ = ∫ (z : α × β), f z ∂μ.prod ν


/-- The determinant of a basis constructed by `unitsSMul` is the product of the given units. -/
@[simp]
theorem Basis.det_unitsSMul_self (w : ι → Rˣ) : e.det (e.unitsSMul w) = ∏ i, (w i : R)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(e : Basis ι R M)
(w : ι → Rˣ)

e.det ⇑(e.unitsSMul w) = ∏ i : ι, ↑(w i)


@[to_additive]
theorem lt_or_le_of_mul_le_mul [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ ≤ a₂ * b₂ → a₁ < a₂ ∨ b₁ ≤ b₂

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

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

a₁ + b₁ ≤ a₂ + b₂ → a₁ < a₂ ∨ b₁ ≤ b₂


theorem transversal_nonempty (hφ : ∀ i, Injective (φ i)) : Nonempty (Transversal φ)

(hφ : ∀ (i : ι), Function.Injective ⇑(φ i))


/-- The p-adic valuation of `n` is equal to the logarithm w.r.t `p` iff
    `n` is less than `p` raised to one plus the p-adic valuation of `n`. -/
lemma nat_log_eq_padicValNat_iff {n : ℕ} [hp : Fact (Nat.Prime p)] (hn : 0 < n) :
    Nat.log p n = padicValNat p n ↔ n < p ^ (padicValNat p n + 1)

{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hn : 0 < n)


theorem isOpen_A (L : E →L[𝕜] F) (r ε : ℝ) : IsOpen (A f L r ε)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(L : E →L[𝕜] F)
(r ε : ℝ)


theorem concaveOn_of_convex_hypograph (h : Convex 𝕜 { p : E × β | p.1 ∈ s ∧ p.2 ≤ f p.1 }) :
    ConcaveOn 𝕜 s f

(h : Convex 𝕜 {p | p.1 ∈ s ∧ p.2 ≤ f p.1})


theorem not_dvd_index_sylow' [hp : Fact p.Prime] (P : Sylow p G) [(P : Subgroup G).Normal]
    [fP : FiniteIndex (P : Subgroup G)] : ¬p ∣ (P : Subgroup G).index

{p : ℕ}
{G : Type u_1}
[Group G]
[hp : Fact (Nat.Prime p)]
(P : Sylow p G)
[(↑P).Normal]
[fP : (↑P).FiniteIndex]


private lemma card_interedges_badVertices_le :
    (Rel.interedges G.Adj (badVertices G ε s t) t).card ≤
      (badVertices G ε s t).card * t.card * (G.edgeDensity s t - ε)

{α : Type u_1}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : ℝ}
{s t : Finset α}

↑(Rel.interedges G.Adj (SimpleGraph.badVertices G ε s t) t).card ≤
  ↑(SimpleGraph.badVertices G ε s t).card * ↑t.card * (↑(G.edgeDensity s t) - ε)


/-- For a function taking values in a second countable space, the set of points `x` for
which the image under `f` of `(-∞, x)` is separated below from `f x` is countable. -/
theorem countable_image_gt_image_Iio [OrderTopology α] [LinearOrder β] (f : β → α)
    [SecondCountableTopology α] : Set.Countable {x | ∃ z, z < f x ∧ ∀ y, y < x → f y ≤ z}

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[LinearOrder β]
(f : β → α)
[SecondCountableTopology α]

{x | ∃ z < f x, ∀ y < x, f y ≤ z}.Countable


@[norm_cast]
theorem coe_prod {s : Finset α} {f : α → ℚ≥0} : ↑(∏ a ∈ s, f a) = ∏ a ∈ s, (f a : ℚ)

{α : Type u_2}
{s : Finset α}
{f : α → ℚ≥0}


@[deprecated (since := "2024-06-05")]
theorem tailing_disjoint_tunnel_succ (f : M × N →ₗ[R] M) (i : Injective f) (n : ℕ) :
    Disjoint (tailing f i n) (OrderDual.ofDual (α := Submodule R M) <| tunnel f i (n + 1))

{R : Type u}
{M : Type v}
[Ring R]
{N : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(f : M × N →ₗ[R] M)
(i : Function.Injective ⇑f)
(n : ℕ)

Disjoint (f.tailing i n) (OrderDual.ofDual ((f.tunnel i) (n + 1)))


/-- Continuity of interval integral with respect to a parameter at a point.
  Given `F : X → ℝ → E`, assume `F x` is ae-measurable on `[a, b]` for `x` in a
  neighborhood of `x₀`, and assume it is bounded by a function integrable on
  `[a, b]` independent of `x` in a neighborhood of `x₀`. If `(fun x ↦ F x t)`
  is continuous at `x₀` for almost every `t` in `[a, b]`
  then the same holds for `(fun x ↦ ∫ t in a..b, F x t ∂μ) s x₀`. -/
theorem continuousAt_of_dominated_interval {F : X → ℝ → E} {x₀ : X} {bound : ℝ → ℝ} {a b : ℝ}
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) (μ.restrict <| Ι a b))
    (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ t ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)
    (bound_integrable : IntervalIntegrable bound μ a b)
    (h_cont : ∀ᵐ t ∂μ, t ∈ Ι a b → ContinuousAt (fun x => F x t) x₀) :
    ContinuousAt (fun x => ∫ t in a..b, F x t ∂μ) x₀

(hF_meas : ∀ᶠ (x : X) in nhds x₀, MeasureTheory.AEStronglyMeasurable (F x) (μ.restrict (Ι a b)))

(h_bound : ∀ᶠ (x : X) in nhds x₀, ∀ᵐ (t : ℝ) ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)

(h_cont : ∀ᵐ (t : ℝ) ∂μ, t ∈ Ι a b → ContinuousAt (fun x => F x t) x₀)

ContinuousAt (fun x => ∫ (t : ℝ) in a..b, F x t ∂μ) x₀


theorem wbtw_pointReflection (x y : P) : Wbtw R y x (pointReflection R x y)

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x y : P)

Wbtw R y x ((AffineEquiv.pointReflection R x) y)


@[simp]
protected lemma nnratCast (q : ℚ≥0) : IsSelfAdjoint (q : R)

{R : Type u_1}
[DivisionSemiring R]
[StarRing R]
(q : ℚ≥0)


@[to_additive]
theorem Finite.toFinset_smul (hs : s.Finite) (ht : t.Finite) (hf := hs.smul ht) :
    hf.toFinset = hs.toFinset • ht.toFinset

{α : Type u_2}
{β : Type u_3}
[SMul α β]
[DecidableEq β]
{s : Set α}
{t : Set β}
(hs : s.Finite)
(ht : t.Finite)
(hf : (s • t).Finite := ⋯)

Set.Finite.toFinset hf = hs.toFinset • ht.toFinset


/-- A weaker version of `Basis.opNorm_le` that abstracts away the value of `C`. -/
theorem Basis.exists_opNorm_le {ι : Type*} [Finite ι] (v : Basis ι 𝕜 E) :
    ∃ C > (0 : ℝ), ∀ {u : E →L[𝕜] F} {M : ℝ}, 0 ≤ M → (∀ i, ‖u (v i)‖ ≤ M) → ‖u‖ ≤ C * M

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{ι : Type u_1}
[Finite ι]
(v : Basis ι 𝕜 E)

∃ C > 0, ∀ {u : E →L[𝕜] F} {M : ℝ}, 0 ≤ M → (∀ (i : ι), ‖u (v i)‖ ≤ M) → ‖u‖ ≤ C * M


@[to_additive (attr := simp)]
theorem mul_eq_bot_iff : f * g = ⊥ ↔ f = ⊥ ∨ g = ⊥


@[simp]
theorem map_comap_incl : map N.incl (comap N.incl N') = N ⊓ N'

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N N' : LieSubmodule R L M)

LieSubmodule.map N.incl (LieSubmodule.comap N.incl N') = N ⊓ N'


theorem swap (hs : IsAntichain r s) : IsAntichain (swap r) s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(hs : IsAntichain r s)


@[to_additive]
theorem subset_smul_finset_iff : s ⊆ a • t ↔ a⁻¹ • s ⊆ t

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


@[to_additive (attr := simp)]
theorem mulDysonETransform_idem :
    mulDysonETransform e (mulDysonETransform e x) = mulDysonETransform e x

{α : Type u_1}
[DecidableEq α]
[CommGroup α]
(e : α)
(x : Finset α × Finset α)

Finset.mulDysonETransform e (Finset.mulDysonETransform e x) = Finset.mulDysonETransform e x


@[simp, norm_cast]
theorem descPochhammer_eval_cast (n : ℕ) (k : ℤ) :
    (((descPochhammer ℤ n).eval k : ℤ) : R) = ((descPochhammer R n).eval k : R)

↑(Polynomial.eval k (descPochhammer ℤ n)) = Polynomial.eval (↑k) (descPochhammer R n)


@[simp]
theorem insert_insert {a} {b b' : β a} (s : AList β) :
    (s.insert a b).insert a b' = s.insert a b'

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

AList.insert a b' (AList.insert a b s) = AList.insert a b' s


@[reassoc]
theorem kernel_map_comp_kernelSubobjectIso_inv (sq : Arrow.mk f ⟶ Arrow.mk f') :
    kernel.map f f' sq.1 sq.2 sq.3.symm ≫ (kernelSubobjectIso _).inv =
      (kernelSubobjectIso _).inv ≫ kernelSubobjectMap sq

(sq : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk f')

CategoryTheory.Limits.kernel.map f f' sq.left sq.right ⋯ ≫ (CategoryTheory.Limits.kernelSubobjectIso f').inv =
  (CategoryTheory.Limits.kernelSubobjectIso f).inv ≫ CategoryTheory.Limits.kernelSubobjectMap sq


theorem cthickening_subset_thickening {δ₁ : ℝ≥0} {δ₂ : ℝ} (hlt : (δ₁ : ℝ) < δ₂) (E : Set α) :
    cthickening δ₁ E ⊆ thickening δ₂ E

{α : Type u}
[PseudoEMetricSpace α]
{δ₁ : ℝ≥0}
{δ₂ : ℝ}
(hlt : ↑δ₁ < δ₂)
(E : Set α)

Metric.cthickening (↑δ₁) E ⊆ Metric.thickening δ₂ E


/-- Bounding the Hausdorff edistance by bounding the edistance of any point
in each set to the other set -/
theorem hausdorffEdist_le_of_infEdist {r : ℝ≥0∞} (H1 : ∀ x ∈ s, infEdist x t ≤ r)
    (H2 : ∀ x ∈ t, infEdist x s ≤ r) : hausdorffEdist s t ≤ r

(H1 : ∀ x ∈ s, EMetric.infEdist x t ≤ r)

(H2 : ∀ x ∈ t, EMetric.infEdist x s ≤ r)


@[simp]
lemma map_add_hom_app (a b : A) (X : C) :
    F.map ((add hF s i a b).hom.app X) =
      (i (a + b)).hom.app X ≫ (shiftFunctorAdd D a b).hom.app (F.obj X) ≫
        ((i a).inv.app X)⟦b⟧' ≫ (i b).inv.app ((s a).obj X)

(i : (i : A) → (s i).comp F ≅ F.comp (CategoryTheory.shiftFunctor D i))

F.map ((CategoryTheory.Functor.FullyFaithful.hasShift.add hF s i a b).hom.app X) =
  CategoryTheory.CategoryStruct.comp ((i (a + b)).hom.app X)
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorAdd D a b).hom.app (F.obj X))
      (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D b).map ((i a).inv.app X))
        ((i b).inv.app ((s a).obj X))))


theorem isUnit_divided_by_X_pow_order {f : k⟦X⟧} (hf : f ≠ 0) :
    IsUnit (divided_by_X_pow_order hf)

{k : Type u_2}
[Field k]
{f : PowerSeries k}
(hf : f ≠ 0)


/-- A module which satisfies the universal property is projective. Note that the universe variables
in `huniv` are somewhat restricted. -/
theorem Projective.of_lifting_property' {R : Type u} [Semiring R] {P : Type max u v}
    [AddCommMonoid P] [Module R P]
    -- If for all surjections of `R`-modules `M →ₗ N`, all maps `P →ₗ N` lift to `P →ₗ M`,
    (huniv : ∀ {M : Type max v u} {N : Type max u v} [AddCommMonoid M] [AddCommMonoid N]
      [Module R M] [Module R N] (f : M →ₗ[R] N) (g : P →ₗ[R] N),
        Function.Surjective f → ∃ h : P →ₗ[R] M, f.comp h = g) :
    -- then `P` is projective.
    Projective R P

(huniv :
  ∀ {M : Type (max v u)} {N : Type (max u v)} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] [inst_2 : Module R M]
    [inst_3 : Module R N] (f : M →ₗ[R] N) (g : P →ₗ[R] N), Function.Surjective ⇑f → ∃ h, f ∘ₗ h = g)


theorem sub_one_lt : ∀ {n : Nat}, n ≠ 0 → n - 1 < n


theorem leftRel_r_eq_leftCosetEquivalence :
    @Setoid.r _ (QuotientGroup.leftRel s) = LeftCosetEquivalence s

{α : Type u_1}
[Group α]
(s : Subgroup α)


{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


@[simp]
theorem toSubring_subtype {R A : Type*} [CommRing R] [NonUnitalRing A] [Module R A] [Star A]
    (S : NonUnitalStarSubalgebra R A) :
    NonUnitalSubringClass.subtype S = NonUnitalStarSubalgebraClass.subtype S

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[NonUnitalRing A]
[Module R A]
[Star A]
(S : NonUnitalStarSubalgebra R A)

NonUnitalSubringClass.subtype S = ↑(NonUnitalStarSubalgebraClass.subtype S)


@[simp, mfld_simps]
theorem hom_trivializationAt_source (x₀ : B) :
    (trivializationAt (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂) x₀).source =
      π (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂) ⁻¹'
        ((trivializationAt F₁ E₁ x₀).baseSet ∩ (trivializationAt F₂ E₂ x₀).baseSet)

(σ : 𝕜₁ →+* 𝕜₂)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

(trivializationAt (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂) x₀).source =
  Bundle.TotalSpace.proj ⁻¹' ((trivializationAt F₁ E₁ x₀).baseSet ∩ (trivializationAt F₂ E₂ x₀).baseSet)


@[ext]
lemma ext {p q : YonedaCollection F X} (h : p.fst = q.fst)
    (h' : F.map (eqToHom <| by rw [h]) q.snd = p.snd) : p = q

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

{p q : CategoryTheory.OverPresheafAux.YonedaCollection F X}

(h' : F.map (CategoryTheory.eqToHom ⋯) q.snd = p.snd)


theorem isLeast_lfp_le : IsLeast { a | f a ≤ a } (lfp f)

{α : Type u}
[CompleteLattice α]
(f : α →o α)


theorem not_isUnit_of_natDegree_pos (p : R[X])
    (hpl : 0 < p.natDegree) : ¬ IsUnit p

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
(p : R[X])
(hpl : 0 < p.natDegree)


lemma Indep_iff (m₁ m₂ : MeasurableSpace Ω) {_mΩ : MeasurableSpace Ω} (μ : Measure Ω) :
    Indep m₁ m₂ μ
      ↔ ∀ t1 t2, MeasurableSet[m₁] t1 → MeasurableSet[m₂] t2 → μ (t1 ∩ t2) = μ t1 * μ t2

{Ω : Type u_1}
(m₁ m₂ : MeasurableSpace Ω)
{_mΩ : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)

ProbabilityTheory.Indep m₁ m₂ μ ↔ ∀ (t1 t2 : Set Ω), MeasurableSet t1 → MeasurableSet t2 → μ (t1 ∩ t2) = μ t1 * μ t2


@[simp]
theorem transfer_append {w : V} (q : G.Walk v w) (hpq) :
    (p.append q).transfer H hpq =
      (p.transfer H fun e he => hpq _ (by simp [he])).append
        (q.transfer H fun e he => hpq _ (by simp [he]))

(hpq : ∀ e ∈ (p.append q).edges, e ∈ H.edgeSet)

(p.append q).transfer H hpq = (p.transfer H ⋯).append (q.transfer H ⋯)


/-- The function given in the definition of `torusIntegral` is integrable. -/
theorem function_integrable [NormedSpace ℂ E] (hf : TorusIntegrable f c R) :
    IntegrableOn (fun θ : ℝⁿ => (∏ i, R i * exp (θ i * I) * I : ℂ) • f (torusMap c R θ))
      (Icc (0 : ℝⁿ) fun _ => 2 * π) volume

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
{f : (Fin n → ℂ) → E}
{c : Fin n → ℂ}
{R : Fin n → ℝ}
[NormedSpace ℂ E]
(hf : TorusIntegrable f c R)

MeasureTheory.IntegrableOn (fun θ => (∏ i : Fin n, ↑(R i) * cexp (↑(θ i) * Complex.I) * Complex.I) • f (torusMap c R θ))
  (Set.Icc 0 fun x => 2 * π) MeasureTheory.volume


/-- Let `f : ℝ → ℝ` be a differentiable function. If `f'` is nonpositive, then `f` is an antitone
function. -/
lemma antitone_of_hasDerivAt_nonpos {f f' : ℝ → ℝ} (hf : ∀ x, HasDerivAt f (f' x) x)
    (hf' : f' ≤ 0) : Antitone f

{f f' : ℝ → ℝ}
(hf : ∀ (x : ℝ), HasDerivAt f (f' x) x)
(hf' : f' ≤ 0)


theorem isOpen_fiber {f : X → Y} (hf : IsLocallyConstant f) (y : Y) : IsOpen { x | f x = y }

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{f : X → Y}
(hf : IsLocallyConstant f)
(y : Y)


theorem mem_brange_self {o} (f : ∀ a < o, α) (i hi) : f i hi ∈ brange o f

{α : Type u_1}
{o : Ordinal.{u_4}}
(f : (a : Ordinal.{u_4}) → a < o → α)
(i : Ordinal.{u_4})
(hi : i < o)


/-- Given two multilinear maps `(ι₁ → N) → N₁` and `(ι₂ → N) → N₂`, this produces the map
`(ι₁ ⊕ ι₂ → N) → N₁ ⊗ N₂` by taking the coproduct of the domain and the tensor product
of the codomain.

This can be thought of as combining `Equiv.sumArrowEquivProdArrow.symm` with
`TensorProduct.map`, noting that the two operations can't be separated as the intermediate result
is not a `MultilinearMap`.

While this can be generalized to work for dependent `Π i : ι₁, N'₁ i` instead of `ι₁ → N`, doing so
introduces `Sum.elim N'₁ N'₂` types in the result which are difficult to work with and not defeq
to the simple case defined here. See [this zulip thread](
https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there.20code.20for.20X.3F/topic/Instances.20on.20.60sum.2Eelim.20A.20B.20i.60/near/218484619).
-/
@[simps apply]
def domCoprod (a : MultilinearMap R (fun _ : ι₁ => N) N₁)
    (b : MultilinearMap R (fun _ : ι₂ => N) N₂) :
    MultilinearMap R (fun _ : ι₁ ⊕ ι₂ => N) (N₁ ⊗[R] N₂)

{R : Type u_1}
{ι₁ : Type u_2}
{ι₂ : Type u_3}
[CommSemiring R]
{N₁ : Type u_6}
[AddCommMonoid N₁]
[Module R N₁]
{N₂ : Type u_7}
[AddCommMonoid N₂]
[Module R N₂]
{N : Type u_8}
[AddCommMonoid N]
[Module R N]
(a : MultilinearMap R (fun x => N) N₁)
(b : MultilinearMap R (fun x => N) N₂)
(v : ι₁ ⊕ ι₂ → N)

(a.domCoprod b) v = (a fun i => v (Sum.inl i)) ⊗ₜ[R] b fun i => v (Sum.inr i)


@[simp]
lemma exists_apply_eq_apply3 {α β γ δ} {f : α → β → γ → δ} {a : α} {b : β} {c : γ} :
    ∃ x y z, f x y z = f a b c

{α : Sort u_3}
{β : Sort u_4}
{γ : Sort u_5}
{δ : Sort u_6}
{f : α → β → γ → δ}
{a : α}
{b : β}
{c : γ}


/-- Pull a submonoid back to an opposite submonoid along `MulOpposite.unop`-/
@[to_additive (attr := simps) "Pull an additive submonoid back to an opposite submonoid along
`AddOpposite.unop`"]
protected def op (x : Submonoid M) : Submonoid Mᵐᵒᵖ

{M : Type u_2}
[MulOneClass M]
(x : Submonoid M)


theorem isConformalMap_complex_linear_conj {map : ℂ →L[ℂ] E} (nonzero : map ≠ 0) :
    IsConformalMap ((map.restrictScalars ℝ).comp (conjCLE : ℂ →L[ℝ] ℂ))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedSpace ℂ E]
{map : ℂ →L[ℂ] E}
(nonzero : map ≠ 0)

IsConformalMap ((ContinuousLinearMap.restrictScalars ℝ map).comp ↑Complex.conjCLE)


/-- Equal sets are equivalent.

TODO: this is the same as `Equiv.setCongr`! -/
@[simps! apply symm_apply]
protected def ofEq {α : Type u} {s t : Set α} (h : s = t) : s ≃ t

{α : Type u}
{s t : Set α}
(h : s = t)
(a : { a // (fun x => x ∈ s) a })


lemma sSup_inter (hS : BooleanGenerators S) {T₁ T₂ : Set α} (hT₁ : T₁ ⊆ S) (hT₂ : T₂ ⊆ S) :
    sSup (T₁ ∩ T₂) = (sSup T₁) ⊓ (sSup T₂)

(hS : IsCompactlyGenerated.BooleanGenerators S)


theorem Perm.of_eq (h : l₁ = l₂) : l₁ ~ l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ = l₂ → l₁ ~ l₂


theorem norm_eval_le_projectiveSeminorm (x : ⨂[𝕜] i, E i) (G : Type*) [SeminormedAddCommGroup G]
    [NormedSpace 𝕜 G] (f : ContinuousMultilinearMap 𝕜 E G) :
    ‖lift f.toMultilinearMap x‖ ≤ projectiveSeminorm x * ‖f‖

[(i : ι) → SeminormedAddCommGroup (E i)]

‖(PiTensorProduct.lift f.toMultilinearMap) x‖ ≤ PiTensorProduct.projectiveSeminorm x * ‖f‖


/-- The trace of a permutation matrix equals the number of fixed points. -/
theorem trace_permutation [AddCommMonoidWithOne R] :
    trace (σ.permMatrix R) = (Function.fixedPoints σ).ncard

{n : Type u_1}
{R : Type u_2}
[DecidableEq n]
[Fintype n]
(σ : Equiv.Perm n)
[AddCommMonoidWithOne R]

(Equiv.Perm.permMatrix R σ).trace = ↑(Function.fixedPoints ⇑σ).ncard


@[simp]
lemma negOnePow_abs (n : ℤ) : |n|.negOnePow = n.negOnePow


@[simp] protected lemma inv_one (n : ℕ) : (1⁻¹ : ZMod n) = 1


@[to_additive (attr := simp)]
theorem div_one (a : G) : a / 1 = a

{G : Type u_3}
[DivInvOneMonoid G]
(a : G)


@[to_additive]
theorem orderOf_eq_orderOf_iff {H : Type*} [Monoid H] {y : H} :
    orderOf x = orderOf y ↔ ∀ n : ℕ, x ^ n = 1 ↔ y ^ n = 1

{G : Type u_1}
[AddMonoid G]
{x : G}
{H : Type u_6}
[AddMonoid H]
{y : H}

addOrderOf x = addOrderOf y ↔ ∀ (n : ℕ), n • x = 0 ↔ n • y = 0


theorem countable_meas_le_ne_meas_lt (g : α → R) :
    {t : R | μ {a : α | t ≤ g a} ≠ μ {a : α | t < g a}}.Countable

{α : Type u_1}
{R : Type u_2}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
[LinearOrder R]
(g : α → R)

{t | μ {a | t ≤ g a} ≠ μ {a | t < g a}}.Countable


@[simp]
theorem coe_sup (f g : SupBotHom α β) : DFunLike.coe (f ⊔ g) = f ⊔ g

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[SemilatticeSup β]
[OrderBot β]
(f g : SupBotHom α β)


/-- The span of `univ` is `⊤`. -/
@[simp]
theorem span_univ : affineSpan k (Set.univ : Set P) = ⊤

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]


/-- The bottom-right evaluation `Square C ⥤ C`. -/
@[simps]
def evaluation₄ : Square C ⥤ C

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

CategoryTheory.Square.evaluation₄.obj sq = sq.X₄


theorem HasFDerivAt.congr_of_eventuallyEq (h : HasFDerivAt f f' x) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasFDerivAt f₁ f' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{f' : E →L[𝕜] F}
{x : E}
(h : HasFDerivAt f f' x)
(h₁ : f₁ =ᶠ[𝓝 x] f)


lemma isLocalization [F.Full] [F.Faithful] :
    G.IsLocalization ((MorphismProperty.isomorphisms C₂).inverseImage G)

{C₁ : Type u_1}
{C₂ : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C₁]
[CategoryTheory.Category.{u_5, u_2} C₂]
{G : CategoryTheory.Functor C₁ C₂}
{F : CategoryTheory.Functor C₂ C₁}
(adj : G ⊣ F)
[F.Full]
[F.Faithful]

G.IsLocalization ((CategoryTheory.MorphismProperty.isomorphisms C₂).inverseImage G)


lemma disjoint_biUnion_left (s : Finset α) (f : α → Finset β) (t : Finset β) :
    Disjoint (s.biUnion f) t ↔ ∀ i ∈ s, Disjoint (f i) t

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(s : Finset α)
(f : α → Finset β)
(t : Finset β)


/-- Shows that definability is closed under finite projections. -/
theorem Definable.image_comp_embedding {s : Set (β → M)} (h : A.Definable L s) (f : α ↪ β)
    [Finite β] : A.Definable L ((fun g : β → M => g ∘ f) '' s)

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}
{β : Type u_1}
{s : Set (β → M)}
(h : A.Definable L s)
(f : α ↪ β)
[Finite β]


theorem Filter.Eventually.intCast_atBot [StrictOrderedRing R] [Archimedean R] {p : R → Prop}
    (h : ∀ᶠ (x : R) in atBot, p x) : ∀ᶠ (n : ℤ) in atBot, p n

{R : Type u_2}
[StrictOrderedRing R]
[Archimedean R]
{p : R → Prop}
(h : ∀ᶠ (x : R) in Filter.atBot, p x)


/-- If one controls the seminorm for every `x`, then one controls the seminorm. -/
theorem seminorm_le_bound (k n : ℕ) (f : 𝓢(E, F)) {M : ℝ} (hMp : 0 ≤ M)
    (hM : ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖ ≤ M) : SchwartzMap.seminorm 𝕜 k n f ≤ M

(hM : ∀ (x : E), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖ ≤ M)


theorem invOf_mul_self_assoc [Monoid α] (a b : α) [Invertible a] : ⅟ a * (a * b) = b

{α : Type u}
[Monoid α]
(a b : α)
[Invertible a]


protected theorem tendsto_nhds {la : Filter α} {lb : Filter β} {f : α → Filter β} :
    Tendsto f la (𝓝 lb) ↔ ∀ s ∈ lb, ∀ᶠ a in la, s ∈ f a

{α : Type u_2}
{β : Type u_3}
{la : Filter α}
{lb : Filter β}
{f : α → Filter β}

Filter.Tendsto f la (𝓝 lb) ↔ ∀ s ∈ lb, ∀ᶠ (a : α) in la, s ∈ f a


/--
An alternative constructor for `LawfulMonad` which has more
defaultable fields in the common case.
-/
theorem LawfulMonad.mk' (m : Type u → Type v) [Monad m]
    (id_map : ∀ {α} (x : m α), id <$> x = x)
    (pure_bind : ∀ {α β} (x : α) (f : α → m β), pure x >>= f = f x)
    (bind_assoc : ∀ {α β γ} (x : m α) (f : α → m β) (g : β → m γ),
      x >>= f >>= g = x >>= fun x => f x >>= g)
    (map_const : ∀ {α β} (x : α) (y : m β),
      Functor.mapConst x y = Function.const β x <$> y := by intros; rfl)
    (seqLeft_eq : ∀ {α β} (x : m α) (y : m β),
      x <* y = (x >>= fun a => y >>= fun _ => pure a) := by intros; rfl)
    (seqRight_eq : ∀ {α β} (x : m α) (y : m β), x *> y = (x >>= fun _ => y) := by intros; rfl)
    (bind_pure_comp : ∀ {α β} (f : α → β) (x : m α),
      x >>= (fun y => pure (f y)) = f <$> x := by intros; rfl)
    (bind_map : ∀ {α β} (f : m (α → β)) (x : m α), f >>= (. <$> x) = f <*> x := by intros; rfl)
    : LawfulMonad m

(id_map : ∀ {α : Type u} (x : m α), id <$> x = x)

(pure_bind : ∀ {α β : Type u} (x : α) (f : α → m β), pure x >>= f = f x)

(bind_assoc : ∀ {α β γ : Type u} (x : m α) (f : α → m β) (g : β → m γ), x >>= f >>= g = x >>= fun x => f x >>= g)

(map_const : ∀ {α β : Type u} (x : α) (y : m β), Functor.mapConst x y = Function.const β x <$> y := by intros; rfl)

(seqLeft_eq :
  ∀ {α β : Type u} (x : m α) (y : m β),
    (SeqLeft.seqLeft x fun x => y) = do
      let a ← x
      let _ ← y
      pure a := by
  intros; rfl)

(seqRight_eq :
  ∀ {α β : Type u} (x : m α) (y : m β),
    (SeqRight.seqRight x fun x => y) = do
      let _ ← x
      y := by
  intros; rfl)

(bind_pure_comp :
  ∀ {α β : Type u} (f : α → β) (x : m α),
    (do
        let y ← x
        pure (f y)) =
      f <$> x := by
  intros; rfl)

(bind_map :
  ∀ {α β : Type u} (f : m (α → β)) (x : m α),
    (do
        let x_1 ← f
        x_1 <$> x) =
      Seq.seq f fun x_1 => x := by
  intros; rfl)


@[to_additive (attr := simp low+1)]
theorem singleton_smul : ({a} : Set α) • t = a • t

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{t : Set β}
{a : α}


lemma mul_self_lt_mul_self_iff : m * m < n * n ↔ m < n


theorem coeIdeal_finprod [IsLocalization S P] {α : Sort*} {f : α → Ideal R}
    (hS : S ≤ nonZeroDivisors R) :
    ((∏ᶠ a : α, f a : Ideal R) : FractionalIdeal S P) = ∏ᶠ a : α, (f a : FractionalIdeal S P)

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
(P : Type u_2)
[CommRing P]
[Algebra R P]
[IsLocalization S P]
{α : Sort u_3}
{f : α → Ideal R}
(hS : S ≤ R⁰)


/-- A generalized Heyting algebra is a lattice with an additional binary operation `⇨` called
Heyting implication such that `a ⇨` is right adjoint to `a ⊓`.

 This generalizes `HeytingAlgebra` by not requiring a bottom element. -/
class GeneralizedHeytingAlgebra (α : Type*) extends Lattice α, OrderTop α, HImp α where
  /-- `a ⇨` is right adjoint to `a ⊓` -/
  le_himp_iff (a b c : α) : a ≤ b ⇨ c ↔ a ⊓ b ≤ c

{α : Type u_4}
[self : GeneralizedHeytingAlgebra α]
(a b c : α)


@[simp]
lemma Ioc_inl_inr : Ioc (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iic b)).map toLex.toEmbedding

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(a : α)
(b : β)

Finset.Ioc (Sum.inlₗ a) (Sum.inrₗ b) = Finset.map toLex.toEmbedding ((Finset.Ioi a).disjSum (Finset.Iic b))


theorem ne_of_vne (h : i.val ≠ j.val) : i ≠ j


@[fun_prop]
theorem differentiableAt_fst : DifferentiableAt 𝕜 Prod.fst p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}


theorem op_geom_sum (x : α) (n : ℕ) : op (∑ i ∈ range n, x ^ i) = ∑ i ∈ range n, op x ^ i

{α : Type u}
[Semiring α]
(x : α)
(n : ℕ)

MulOpposite.op (∑ i ∈ Finset.range n, x ^ i) = ∑ i ∈ Finset.range n, MulOpposite.op x ^ i


theorem iUnion₂_mono {s t : ∀ i, κ i → Set α} (h : ∀ i j, s i j ⊆ t i j) :
    ⋃ (i) (j), s i j ⊆ ⋃ (i) (j), t i j

(h : ∀ (i : ι) (j : κ i), s i j ⊆ t i j)


theorem Restriction.of_subset {R' : Set α} (M : Matroid α) (h : R ⊆ R') : (M ↾ R) ≤r (M ↾ R')

{α : Type u_1}
{R R' : Set α}
(M : Matroid α)
(h : R ⊆ R')

(M.restrict R).Restriction (M.restrict R')


@[to_additive]
theorem swap_map (f : M →* M') (g : N →* N') (x : M ∗ N) :
    swap M' N' (map f g x) = map g f (swap M N x)

{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')
(x : AddMonoid.Coprod M N)

(AddMonoid.Coprod.swap M' N') ((AddMonoid.Coprod.map f g) x) =
  (AddMonoid.Coprod.map g f) ((AddMonoid.Coprod.swap M N) x)


/-- An order is simple iff it has exactly two elements, `⊥` and `⊤`. -/
class IsSimpleOrder (α : Type*) [LE α] [BoundedOrder α] extends Nontrivial α : Prop where
  /-- Every element is either `⊥` or `⊤` -/
  eq_bot_or_eq_top : ∀ a : α, a = ⊥ ∨ a = ⊤

{α : Type u_4}
[LE α]
[BoundedOrder α]
[self : IsSimpleOrder α]
(a : α)


@[reassoc]
theorem kernelSubobjectIso_comp_kernel_map (sq : Arrow.mk f ⟶ Arrow.mk f') :
    (kernelSubobjectIso _).hom ≫ kernel.map f f' sq.1 sq.2 sq.3.symm =
      kernelSubobjectMap sq ≫ (kernelSubobjectIso _).hom

(sq : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk f')

(CategoryTheory.Limits.kernelSubobjectIso f).hom ≫ CategoryTheory.Limits.kernel.map f f' sq.left sq.right ⋯ =
  CategoryTheory.Limits.kernelSubobjectMap sq ≫ (CategoryTheory.Limits.kernelSubobjectIso f').hom


theorem isComplete_iff_ultrafilter {s : Set α} :
    IsComplete s ↔ ∀ l : Ultrafilter α, Cauchy (l : Filter α) → ↑l ≤ 𝓟 s → ∃ x ∈ s, ↑l ≤ 𝓝 x

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}

IsComplete s ↔ ∀ (l : Ultrafilter α), Cauchy ↑l → ↑l ≤ 𝓟 s → ∃ x ∈ s, ↑l ≤ 𝓝 x


theorem Iterate.rec_zero (p : α → Sort*) {f : α → α} (h : ∀ a, p a → p (f a)) {a : α} (ha : p a) :
    Iterate.rec p h ha 0 = ha

{α : Type u}
(p : α → Sort u_1)
{f : α → α}
(h : (a : α) → p a → p (f a))
{a : α}
(ha : p a)


theorem init_pow (m : ℕ) (x : 𝕎 R) (n : ℕ) : init n (x ^ m) = init n (init n x ^ m)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{R : Type u_1}
[CommRing R]
(m : ℕ)
(x : 𝕎 R)
(n : ℕ)

WittVector.init n (x ^ m) = WittVector.init n (WittVector.init n x ^ m)


/-- In a Henstock prepartition, there are at most `2 ^ Fintype.card ι` boxes with a given tag. -/
theorem IsHenstock.card_filter_tag_eq_le [Fintype ι] (h : π.IsHenstock) (x : ι → ℝ) :
    (π.boxes.filter fun J => π.tag J = x).card ≤ 2 ^ Fintype.card ι

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π : BoxIntegral.TaggedPrepartition I}
[Fintype ι]
(h : π.IsHenstock)
(x : ι → ℝ)

(Finset.filter (fun J => π.tag J = x) π.boxes).card ≤ 2 ^ Fintype.card ι


@[simp]
theorem toQuadraticMap_zero : (0 : BilinMap R M N).toQuadraticMap = 0

(R : Type u_3)
(M : Type u_4)
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]


/-- Any matrix polynomial `p` is equivalent under evaluation to `p %ₘ M.charpoly`; that is, `p`
is equivalent to a polynomial with degree less than the dimension of the matrix. -/
theorem aeval_eq_aeval_mod_charpoly (M : Matrix n n R) (p : R[X]) :
    aeval M p = aeval M (p %ₘ M.charpoly)

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)
(p : R[X])

(Polynomial.aeval M) p = (Polynomial.aeval M) (p %ₘ M.charpoly)


lemma mul_def (f g : α →+* α) : f * g = f.comp g

∀ {x : NonAssocSemiring α} (f g : α →+* α), f * g = f.comp g


@[simp]
theorem liftNC_single (f : k →+ R) (g : G → R) (a : G) (b : k) :
    liftNC f g (single a b) = f b * g a

{k : Type u₁}
{G : Type u₂}
{R : Type u_2}
[Semiring k]
[NonUnitalNonAssocSemiring R]
(f : k →+ R)
(g : G → R)
(a : G)
(b : k)

(MonoidAlgebra.liftNC f g) (MonoidAlgebra.single a b) = f b * g a


@[simp]
theorem mapLe_isPath {G G' : SimpleGraph V} (h : G ≤ G') {u v : V} {p : G.Walk u v} :
    (p.mapLe h).IsPath ↔ p.IsPath

{V : Type u}
{G G' : SimpleGraph V}
(h : G ≤ G')
{u v : V}
{p : G.Walk u v}

(SimpleGraph.Walk.mapLe h p).IsPath ↔ p.IsPath


/-- If `z` is a non-real complex root of a real polynomial,
then `p` is divisible by a quadratic polynomial. -/
lemma Polynomial.quadratic_dvd_of_aeval_eq_zero_im_ne_zero (p : ℝ[X]) {z : ℂ} (h0 : aeval z p = 0)
    (hz : z.im ≠ 0) : X ^ 2 - C (2 * z.re) * X + C (‖z‖ ^ 2) ∣ p

(p : ℝ[X])
{z : ℂ}
(h0 : (Polynomial.aeval z) p = 0)
(hz : z.im ≠ 0)

Polynomial.X ^ 2 - Polynomial.C (2 * z.re) * Polynomial.X + Polynomial.C (‖z‖ ^ 2) ∣ p


theorem smul_def (r : R) (x : A) : r • x = algebraMap R A r * x

{R : Type u}
{A : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)
(x : A)


@[simp]
theorem top : x ≡ y [SMOD (⊤ : Submodule R M)]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{x y : M}


@[simp]
theorem subtype_apply (x : p) : p.subtype x = x

{R : Type u}
{M : Type v}
[SMul R M]
(p : SubMulAction R M)
(x : ↥p)


theorem ωSup_eq_some {c : Chain (Part α)} {a : α} (h : some a ∈ c) : Part.ωSup c = some a

{c : OmegaCompletePartialOrder.Chain (Part α)}


theorem w_mul_φ_nonneg (D : ℝ) (x y : E) : 0 ≤ w D y * φ (x - y)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(D : ℝ)
(x y : E)

0 ≤ ExistsContDiffBumpBase.w D y * ExistsContDiffBumpBase.φ (x - y)


@[measurability]
theorem measurable_dist : Measurable fun p : α × α => dist p.1 p.2

{α : Type u_1}
[PseudoMetricSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[SecondCountableTopology α]


@[simp]
theorem frontier_setOf_le_im (a : ℝ) : frontier { z : ℂ | a ≤ z.im } = { z | z.im = a }

frontier {z | a ≤ z.im} = {z | z.im = a}


/-- The Lusin-Souslin theorem: if `s` is Borel-measurable in a Polish space, then its image under
a continuous injective map is also Borel-measurable. -/
theorem _root_.MeasurableSet.image_of_continuousOn_injOn [OpensMeasurableSpace β]
    [tγ : TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ]
    (hs : MeasurableSet s)
    (f_cont : ContinuousOn f s) (f_inj : InjOn f s) : MeasurableSet (f '' s)

{γ : Type u_3}
{β : Type u_5}
[tβ : TopologicalSpace β]
[T2Space β]
[MeasurableSpace β]
{s : Set γ}
{f : γ → β}
[OpensMeasurableSpace β]
[tγ : TopologicalSpace γ]
[PolishSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
(hs : MeasurableSet s)
(f_cont : ContinuousOn f s)
(f_inj : Set.InjOn f s)


/-- The idempotent endomorphisms of a module with range equal to a submodule are in 1-1
correspondence with linear maps to the submodule that restrict to the identity on the submodule. -/
@[simps] def isIdempotentElemEquiv :
    { f : Module.End R E // IsIdempotentElem f ∧ range f = p } ≃
    { f : E →ₗ[R] p // ∀ x : p, f x = x }

(f : { f // IsIdempotentElem f ∧ LinearMap.range f = p })

↑(p.isIdempotentElemEquiv f) = LinearMap.codRestrict p ↑f ⋯


@[simp, nolint simpNF]
theorem sdiff_eq : a \ b = unit


/-- There exists an automorphism `f` of `A` that maps `b` to `a`.
`f` is obtained by considering `u` and `selfProdPermIncl h b`.
Both are inclusions of `A` into `selfProd F X` mapping `b` respectively `a` to the same element
in the fiber of `selfProd F X`. Applying `connected_component_unique` yields the result. -/
private lemma subobj_selfProd_trans (b : F.obj A) : ∃ (f : A ≅ A), F.map f.hom b = a

{F : CategoryTheory.Functor C FintypeCat}

{u : A ⟶ CategoryTheory.PreGaloisCategory.selfProd F X}

(h : F.map u a = CategoryTheory.PreGaloisCategory.mkSelfProdFib F X)


protected theorem P_mk (x : F (M F)) : AllAgree (Approx.sMk x)


@[simp] theorem sub_re : (a - b).re = a.re - b.re

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


theorem chain_of_chain_map {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, S (f a) (f b) → R a b)
    {a : α} {l : List α} (p : Chain S (f a) (map f l)) : Chain R a l

(H : ∀ (a b : α), S (f a) (f b) → R a b)


@[simp]
theorem isHenstock_biUnionTagged {π : Prepartition I} {πi : ∀ J, TaggedPrepartition J} :
    IsHenstock (π.biUnionTagged πi) ↔ ∀ J ∈ π, (πi J).IsHenstock

{πi : (J : BoxIntegral.Box ι) → BoxIntegral.TaggedPrepartition J}

(π.biUnionTagged πi).IsHenstock ↔ ∀ J ∈ π, (πi J).IsHenstock


/-- Version of `isProperMap_iff_isClosedMap_and_compact_fibers` in terms of `cofinite` and
`cocompact`. Only works when the codomain is `T1`. -/
lemma isProperMap_iff_isClosedMap_and_tendsto_cofinite [T1Space Y] :
    IsProperMap f ↔ Continuous f ∧ IsClosedMap f ∧ Tendsto f (cocompact X) cofinite

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

IsProperMap f ↔ Continuous f ∧ IsClosedMap f ∧ Filter.Tendsto f (Filter.cocompact X) Filter.cofinite


@[simp] lemma diracProba_toMeasure_apply [MeasurableSingletonClass X] (x : X) (A : Set X) :
    (diracProba x).toMeasure A = A.indicator 1 x

{X : Type u_1}
[MeasurableSpace X]
[MeasurableSingletonClass X]
(x : X)
(A : Set X)

↑(MeasureTheory.diracProba x) A = A.indicator 1 x


lemma shiftLeft_lt {x n m : ℕ} (h : x < 2 ^ n) : x <<< m < 2 ^ (n + m)