lemma prod_lt_prod (hf : ∀ i ∈ s, 0 < f i) (hfg : ∀ i ∈ s, f i ≤ g i)
    (hlt : ∃ i ∈ s, f i < g i) :
    ∏ i ∈ s, f i < ∏ i ∈ s, g i

{ι : Type u_1}
{R : Type u_2}
[CommMonoidWithZero R]
[PartialOrder R]
[ZeroLEOneClass R]
[PosMulStrictMono R]
[Nontrivial R]
{f g : ι → R}
{s : Finset ι}
(hf : ∀ i ∈ s, 0 < f i)
(hfg : ∀ i ∈ s, f i ≤ g i)
(hlt : ∃ i ∈ s, f i < g i)


theorem CompleteLattice.setIndependent_iff_finite {s : Set α} :
    CompleteLattice.SetIndependent s ↔
      ∀ t : Finset α, ↑t ⊆ s → CompleteLattice.SetIndependent (↑t : Set α)

{α : Type u_2}
[CompleteLattice α]
[IsCompactlyGenerated α]
{s : Set α}

CompleteLattice.SetIndependent s ↔ ∀ (t : Finset α), ↑t ⊆ s → CompleteLattice.SetIndependent ↑t


/-- `trim` sends the supremum of two outer measures to the supremum of the trimmed measures. -/
theorem trim_sup (m₁ m₂ : OuterMeasure α) : (m₁ ⊔ m₂).trim = m₁.trim ⊔ m₂.trim

{α : Type u_1}
[MeasurableSpace α]
(m₁ m₂ : MeasureTheory.OuterMeasure α)


/-- Shows `piToPiTop` is an isomorphism, whose inverse is precisely the pi product
of the induced projections. This shows that `fundamentalGroupoidFunctor` preserves products.
-/
@[simps]
def piIso : CategoryTheory.Grpd.of (∀ i : I, πₓ (X i)) ≅ πₓ (TopCat.of (∀ i, X i))

(FundamentalGroupoidFunctor.piIso X).hom = FundamentalGroupoidFunctor.piToPiTop X


/-- A product over all subsets of `s ∪ {x}` is obtained by multiplying the product over all subsets
of `s`, and over all subsets of `s` to which one adds `x`. -/
@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
of `s`, and over all subsets of `s` to which one adds `x`."]
lemma prod_powerset_cons (ha : a ∉ s) (f : Finset α → β) :
    ∏ t ∈ (s.cons a ha).powerset, f t = (∏ t ∈ s.powerset, f t) *
      ∏ t ∈ s.powerset.attach, f (cons a t $ not_mem_mono (mem_powerset.1 t.2) ha)

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{a : α}
[AddCommMonoid β]
(ha : a ∉ s)
(f : Finset α → β)

∑ t ∈ (Finset.cons a s ha).powerset, f t = ∑ t ∈ s.powerset, f t + ∑ t ∈ s.powerset.attach, f (Finset.cons a ↑t ⋯)


@[to_additive (attr := measurability)]
theorem Measurable.div_const [MeasurableDiv G] (hf : Measurable f) (c : G) :
    Measurable fun x => f x / c

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Sub G]
{m : MeasurableSpace α}
{f : α → G}
[MeasurableSub G]
(hf : Measurable f)
(c : G)


/-- An object `X` in a category is a *zero object* if for every object `Y`
there is a unique morphism `to : X → Y` and a unique morphism `from : Y → X`.

This is a characteristic predicate for `has_zero_object`. -/
structure IsZero (X : C) : Prop where
  /-- there are unique morphisms to the object -/
  unique_to : ∀ Y, Nonempty (Unique (X ⟶ Y))
  /-- there are unique morphisms from the object -/
  unique_from : ∀ Y, Nonempty (Unique (Y ⟶ X))

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : C}
(self : CategoryTheory.Limits.IsZero X)
(Y : C)


theorem HasBasis.hasBasis_self_subset {p : Set α → Prop} (h : l.HasBasis (fun s => s ∈ l ∧ p s) id)
    {V : Set α} (hV : V ∈ l) : l.HasBasis (fun s => s ∈ l ∧ p s ∧ s ⊆ V) id


@[simp]
theorem comp_right : (f ≫ g).right = f.right ≫ g.right

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{L : CategoryTheory.Functor A T}
{R : CategoryTheory.Functor B T}
{X Y Z : CategoryTheory.Comma L R}
{f : X ⟶ Y}
{g : Y ⟶ Z}

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


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X i ⟶ K.X j ⟶ K.X k` for arbitrary indices `i`, `j` and `k`. -/
@[simps]
def shortComplexFunctor' (i j k : ι) : HomologicalComplex C c ⥤ ShortComplex C

((HomologicalComplex.shortComplexFunctor' C c i j k).obj K).X₂ = K.X j


/-- `prod C D` gives the cartesian product of two categories.

See <https://stacks.math.columbia.edu/tag/001K>.
-/
@[simps (config := { notRecursive := [] }) Hom id_fst id_snd comp_fst comp_snd]
instance prod : Category.{max v₁ v₂} (C × D)

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

(CategoryTheory.CategoryStruct.id X).2 = CategoryTheory.CategoryStruct.id X.2


theorem ext_iff {x y : ZFSet.{u}} : x = y ↔ ∀ z : ZFSet.{u}, z ∈ x ↔ z ∈ y


theorem starLift_range (f : A →⋆ₙₐ[R] C) :
    (starLift f).range = StarAlgebra.adjoin R (NonUnitalStarAlgHom.range f : Set C)

{R : Type u_1}
{A : Type u_2}
{C : Type u_3}
[CommSemiring R]
[NonUnitalSemiring A]
[StarRing R]
[StarRing A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[StarModule R A]
[Semiring C]
[StarRing C]
[Algebra R C]
[StarModule R C]
(f : A →⋆ₙₐ[R] C)

(Unitization.starLift f).range = StarAlgebra.adjoin R ↑(NonUnitalStarAlgHom.range f)


/-- The backward direction for `functorProdFunctorEquiv` -/
@[simps]
def functorProdToProdFunctor : (A ⥤ B × C) ⥤ (A ⥤ B) × (A ⥤ C)

(A : Type u₁)
[CategoryTheory.Category.{v₁, u₁} A]
(B : Type u₂)
[CategoryTheory.Category.{v₂, u₂} B]
(C : Type u₃)
[CategoryTheory.Category.{v₃, u₃} C]
(F : CategoryTheory.Functor A (B × C))

(CategoryTheory.functorProdToProdFunctor A B C).obj F =
  (F.comp (CategoryTheory.Prod.fst B C), F.comp (CategoryTheory.Prod.snd B C))


lemma pow_mem_range_pow_of_coprime (hmn : m.Coprime n) (a : α) :
    a ^ m ∈ Set.range (· ^ n : α → α) ↔ a ∈ Set.range (· ^ n : α → α)

{α : Type u_1}
[CommGroupWithZero α]
{m n : ℕ}
(hmn : m.Coprime n)
(a : α)

(a ^ m ∈ Set.range fun x => x ^ n) ↔ a ∈ Set.range fun x => x ^ n


@[simp] lemma predAbove_castSucc_self (p : Fin n) : p.predAbove (castSucc p) = p


@[simp]
theorem intentClosure_iUnion (f : ι → Set α) :
    intentClosure r (⋃ i, f i) = ⋂ i, intentClosure r (f i)

{ι : Sort u_1}
{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)
(f : ι → Set α)


theorem lt_subset_interior_le (hf : Continuous f) (hg : Continuous g) :
    { b | f b < g b } ⊆ interior { b | f b ≤ g b }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f g : β → α}
[TopologicalSpace β]
(hf : Continuous f)
(hg : Continuous g)

{b | f b < g b} ⊆ interior {b | f b ≤ g b}


lemma evaluation_coevaluation :
    η_ _ _ ▷ X ≫ (α_ _ _ _).hom ≫ X ◁ ε_ _ Y = (λ_ X).hom ≫ (ρ_ X).inv

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
(X Y : C)
[CategoryTheory.ExactPairing X Y]

η_ X Y ▷ X ≫ (α_ X Y X).hom ≫ X ◁ ε_ X Y = (λ_ X).hom ≫ (ρ_ X).inv


lemma Affine.CoordinateRing.mk_ψ₂_sq : mk W W.ψ₂ ^ 2 = mk W (C W.Ψ₂Sq)

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

(WeierstrassCurve.Affine.CoordinateRing.mk W) W.ψ₂ ^ 2 =
  (WeierstrassCurve.Affine.CoordinateRing.mk W) (Polynomial.C W.Ψ₂Sq)


/--
A (Grothendieck) pretopology on `C` consists of a collection of families of morphisms with a fixed
target `X` for every object `X` in `C`, called "coverings" of `X`, which satisfies the following
three axioms:
1. Every family consisting of a single isomorphism is a covering family.
2. The collection of covering families is stable under pullback.
3. Given a covering family, and a covering family on each domain of the former, the composition
   is a covering family.

In some sense, a pretopology can be seen as Grothendieck topology with weaker saturation conditions,
in that each covering is not necessarily downward closed.

See: https://ncatlab.org/nlab/show/Grothendieck+pretopology, or
https://stacks.math.columbia.edu/tag/00VH, or [MM92] Chapter III, Section 2, Definition 2.
Note that Stacks calls a category together with a pretopology a site, and [MM92] calls this
a basis for a topology.
-/
@[ext]
structure Pretopology where
  coverings : ∀ X : C, Set (Presieve X)
  has_isos : ∀ ⦃X Y⦄ (f : Y ⟶ X) [IsIso f], Presieve.singleton f ∈ coverings X
  pullbacks : ∀ ⦃X Y⦄ (f : Y ⟶ X) (S), S ∈ coverings X → pullbackArrows f S ∈ coverings Y
  transitive :
    ∀ ⦃X : C⦄ (S : Presieve X) (Ti : ∀ ⦃Y⦄ (f : Y ⟶ X), S f → Presieve Y),
      S ∈ coverings X → (∀ ⦃Y⦄ (f) (H : S f), Ti f H ∈ coverings Y) → S.bind Ti ∈ coverings X

(Ti : ⦃Y : C⦄ → (f : Y ⟶ X) → S f → CategoryTheory.Presieve Y)

S ∈ self.coverings X → (∀ ⦃Y : C⦄ (f : Y ⟶ X) (H : S f), Ti f H ∈ self.coverings Y) → S.bind Ti ∈ self.coverings X


theorem gold_pow_sub_gold_pow (n : ℕ) : φ ^ (n + 2) - φ ^ (n + 1) = φ ^ n


protected theorem measurableSet_eq_of_countable_range (hτ : IsStoppingTime f τ)
    (h_countable : (Set.range τ).Countable) (i : ι) : MeasurableSet[f i] {ω | τ ω = i}

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


@[simp]
theorem subtypeDomain_not_piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) :
    subtypeDomain (¬P ·) (f.piecewise g) = g

{α : Type u_1}
{M : Type u_13}
[Zero M]
{P : α → Prop}
[DecidablePred P]
(f : Subtype P →₀ M)
(g : { a // ¬P a } →₀ M)

Finsupp.subtypeDomain (fun x => ¬P x) (f.piecewise g) = g


@[simp]
theorem Ico_diff_Ico_left (a b c : α) : Ico a b \ Ico a c = Ico (max a c) b

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
(a b c : α)

Finset.Ico a b \ Finset.Ico a c = Finset.Ico (max a c) b


theorem Nat.cauchy_induction (seed : ℕ) (hs : P seed) (f : ℕ → ℕ)
    (hf : ∀ x, seed ≤ x → P x → x < f x ∧ P (f x)) (n : ℕ) : P n

(hf : ∀ (x : ℕ), seed ≤ x → P x → x < f x ∧ P (f x))


theorem nonneg_or_nonneg_neg : ∀ (a : Int), NonNeg a ∨ NonNeg (-a)


/-- `eval` is a multiplicative homomorphism except when a denominator evaluates to `0`.

Counterexample: `eval _ 0 X * eval _ 0 (1/X) = 0 ≠ 1 = eval _ 0 1 = eval _ 0 (X * 1/X)`.

See also `RatFunc.eval₂_denom_ne_zero` to make the hypotheses simpler but less general.
-/
theorem eval_mul {x y : RatFunc K} (hx : Polynomial.eval₂ f a (denom x) ≠ 0)
    (hy : Polynomial.eval₂ f a (denom y) ≠ 0) : eval f a (x * y) = eval f a x * eval f a y

{K : Type u}
[Field K]
{L : Type u}
[Field L]
(f : K →+* L)
(a : L)
{x y : RatFunc K}
(hx : Polynomial.eval₂ f a x.denom ≠ 0)
(hy : Polynomial.eval₂ f a y.denom ≠ 0)

RatFunc.eval f a (x * y) = RatFunc.eval f a x * RatFunc.eval f a y


theorem closure_sUnion (s : Set (Set R)) : closure (⋃₀ s) = ⨆ t ∈ s, closure t

Subring.closure (⋃₀ s) = ⨆ t ∈ s, Subring.closure t


@[simp]
theorem mem_sdiff : a ∈ s \ t ↔ a ∈ s ∧ a ∉ t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
{a : α}


@[simp]
theorem prod_const (ι : Type u) (a : Cardinal.{v}) :
    (prod fun _ : ι => a) = lift.{u} a ^ lift.{v} #ι

(Cardinal.prod fun x => a) = Cardinal.lift.{u, v} a ^ Cardinal.lift.{v, u} (Cardinal.mk ι)


@[simp] theorem ofFinite_indep {E : Set α} hE Indep indep_empty indep_subset indep_aug
    subset_ground : (IndepMatroid.ofFinite
      (hE : E.Finite) Indep indep_empty indep_subset indep_aug subset_ground).Indep = Indep

(indep_subset : ∀ ⦃I J : Set α⦄, Indep J → I ⊆ J → Indep I)

(indep_aug : ∀ ⦃I J : Set α⦄, Indep I → Indep J → I.ncard < J.ncard → ∃ e ∈ J, e ∉ I ∧ Indep (insert e I))

(subset_ground : ∀ ⦃I : Set α⦄, Indep I → I ⊆ E)

(IndepMatroid.ofFinite hE Indep indep_empty indep_subset indep_aug subset_ground).Indep = Indep


theorem encard_strictMono [Finite α] : StrictMono (encard : Set α → ℕ∞)


lemma lTensor_shortComplex_exact [Flat R M] (C : ShortComplex $ ModuleCat R) (hC : C.Exact) :
    C.map (tensorLeft M) |>.Exact

(C : CategoryTheory.ShortComplex (ModuleCat R))


@[simp]
theorem singleton_infs : {a} ⊼ t = t.image fun b => a ⊓ b

{α : Type u_2}
[SemilatticeInf α]
{t : Set α}
{a : α}


@[simp] theorem fst_zero : fst (0 : Measure (α × β)) = 0

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]


/-- Sections of `F ⋙ coyoneda.obj (op X)` identify to natural
transformations `(const J).obj X ⟶ F`. -/
@[simps]
def compCoyonedaSectionsEquiv (F : J ⥤ C) (X : C) :
    (F ⋙ coyoneda.obj (op X)).sections ≃ ((const J).obj X ⟶ F)

(τ : (CategoryTheory.Functor.const J).obj X ⟶ F)

∀ (X_1 : J), ↑((CategoryTheory.Limits.compCoyonedaSectionsEquiv F X).symm τ) X_1 = τ.app X_1


@[reassoc]
lemma L₀X₂ToP_comp_φ₁ : S.L₀X₂ToP ≫ S.φ₁ = 0

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.L₀X₂ToP S.φ₁ = 0


/-- The map `toInductiveLimit n` mapping `X n` to the inductive limit is an isometry. -/
theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
    Isometry (toInductiveLimit I n)

{X : ℕ → Type u}
[(n : ℕ) → MetricSpace (X n)]
{f : (n : ℕ) → X n → X (n + 1)}
(I : ∀ (n : ℕ), Isometry (f n))
(n : ℕ)


/-- If A is an R-algebra all of whose elements are integral over R,
and B is an A-algebra all of whose elements are integral over A,
then all elements of B are integral over R. -/
protected theorem Algebra.IsIntegral.trans
    [Algebra.IsIntegral R A] [Algebra.IsIntegral A B] : Algebra.IsIntegral R B

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommRing R]
[CommRing A]
[Ring B]
[Algebra A B]
[Algebra R B]
[Algebra R A]
[IsScalarTower R A B]
[Algebra.IsIntegral R A]
[Algebra.IsIntegral A B]


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


theorem IsLUB.mul_left {s : Set α} (ha : 0 ≤ a) (hs : IsLUB s b) :
    IsLUB ((fun b => a * b) '' s) (a * b)

{α : Type u_2}
[LinearOrderedField α]
{a b : α}
{s : Set α}
(ha : 0 ≤ a)
(hs : IsLUB s b)


/-- Closure of a subring `S` equals `S`. -/
theorem closure_eq (s : Subring R) : closure (s : Set R) = s


@[to_additive (attr := simp) mod_natCard_nsmul]
lemma pow_mod_natCard (a : G) (n : ℕ) : a ^ (n % Nat.card G) = a ^ n

{G : Type u_1}
[AddGroup G]
(a : G)
(n : ℕ)


theorem cos_sub_pi_div_two (θ : Angle) : cos (θ - ↑(π / 2)) = sin θ


theorem not_lt_of_equiv {a b : α} : a ≈ b → ¬a ≺ b

{α : Sort u}
{r : α → α → Prop}
{a b : α}


@[simp]
theorem interior_compl : interior sᶜ = (closure s)ᶜ

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


@[ext]
theorem ext {x y : tsze R M} (h1 : x.fst = y.fst) (h2 : x.snd = y.snd) : x = y

{R : Type u}
{M : Type v}
{x y : tsze R M}
(h1 : x.fst = y.fst)
(h2 : x.snd = y.snd)


lemma exp_abs_le (x : ℝ) : exp |x| ≤ exp x + exp (-x)

Real.exp |x| ≤ Real.exp x + Real.exp (-x)


theorem indicator_ae_eq_restrict_compl (hs : MeasurableSet s) :
    indicator s f =ᵐ[μ.restrict sᶜ] 0

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
(hs : MeasurableSet s)


protected lemma iIndepFun.iIndep (hf : iIndepFun mβ f κ μ) :
    iIndep (fun x ↦ (mβ x).comap (f x)) κ μ

(hf : ProbabilityTheory.Kernel.iIndepFun mβ f κ μ)

ProbabilityTheory.Kernel.iIndep (fun x => MeasurableSpace.comap (f x) (mβ x)) κ μ


@[simp, nolint simpNF]
protected lemma sub_nonneg : 0 ≤ a - b ↔ b ≤ a


@[to_additive (attr := simp)]
theorem mulRothNumber_empty : mulRothNumber (∅ : Finset α) = 0

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]


@[to_additive]
lemma innerRegularWRT_isCompact_isClosed_measure_ne_top_of_group [h : InnerRegularCompactLTTop μ] :
    InnerRegularWRT μ (fun s ↦ IsCompact s ∧ IsClosed s) (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[TopologicalGroup G]
[h : μ.InnerRegularCompactLTTop]

μ.InnerRegularWRT (fun s => IsCompact s ∧ IsClosed s) fun s => MeasurableSet s ∧ μ s ≠ ⊤


@[to_additive (attr := simp)]
theorem dist_smul [PseudoMetricSpace X] [SMul M X] [IsometricSMul M X] (c : M) (x y : X) :
    dist (c • x) (c • y) = dist x y

{M : Type u}
{X : Type w}
[PseudoMetricSpace X]
[VAdd M X]
[IsometricVAdd M X]
(c : M)
(x y : X)


theorem range_toAddSubgroup [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) :
    (range f).toAddSubgroup = f.toAddMonoidHom.range

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Ring R]
[Ring R₂]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)

(LinearMap.range f).toAddSubgroup = f.toAddMonoidHom.range


theorem gcd_image [DecidableEq β] {g : γ → β} (s : Finset γ) :
    (s.image g).gcd f = s.gcd (f ∘ g)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{f : β → α}
[DecidableEq β]
{g : γ → β}
(s : Finset γ)

(Finset.image g s).gcd f = s.gcd (f ∘ g)


theorem fderiv_add (hf : DifferentiableAt 𝕜 f x) (hg : DifferentiableAt 𝕜 g x) :
    fderiv 𝕜 (fun y => f y + g y) x = fderiv 𝕜 f x + fderiv 𝕜 g x

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


theorem hasLimit_comp_equivalence (E : D ⥤ C) [E.IsEquivalence] [HasLimit K] : HasLimit (K ⋙ E)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{J : Type u}
[CategoryTheory.Category.{v, u} J]
(K : CategoryTheory.Functor J D)
(E : CategoryTheory.Functor D C)
[E.IsEquivalence]
[CategoryTheory.Limits.HasLimit K]


@[simp]
lemma sectionsMap_id {M : PresheafOfModules.{v} R} (s : M.sections) :
    sectionsMap (𝟙 M) s = s

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
{M : PresheafOfModules R}
(s : M.sections)

PresheafOfModules.sectionsMap (𝟙 M) s = s


theorem map_le_map_iff_of_injOn {l₁ l₂ : Filter α} {f : α → β} {s : Set α} (h₁ : s ∈ l₁)
    (h₂ : s ∈ l₂) (hinj : InjOn f s) : map f l₁ ≤ map f l₂ ↔ l₁ ≤ l₂

{α : Type u}
{β : Type v}
{l₁ l₂ : Filter α}
{f : α → β}
{s : Set α}
(h₁ : s ∈ l₁)
(h₂ : s ∈ l₂)
(hinj : Set.InjOn f s)

Filter.map f l₁ ≤ Filter.map f l₂ ↔ l₁ ≤ l₂


@[simp]
theorem coe_finsupport : (ρ.finsupport x₀ : Set ι) = support fun i ↦ ρ i x₀

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)

↑(ρ.finsupport x₀) = Function.support fun i => (ρ i) x₀


@[simp] lemma pushforward_obj_val (f : X ⟶ Y) (F : X.Sheaf C) :
    ((pushforward C f).obj F).1 = f _* F.1

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(f : X ⟶ Y)
(F : TopCat.Sheaf C X)

((TopCat.Sheaf.pushforward C f).obj F).val = (TopCat.Presheaf.pushforward C f).obj F.val


@[simp]
theorem ofBijective_apply_symm_apply (f : E →SL[σ] F) (hinj : ker f = ⊥)
    (hsurj : LinearMap.range f = ⊤) (y : F) : f ((ofBijective f hinj hsurj).symm y) = y

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
(f : E →SL[σ] F)
(hinj : LinearMap.ker f = ⊥)
(hsurj : LinearMap.range f = ⊤)
(y : F)

f ((ContinuousLinearEquiv.ofBijective f hinj hsurj).symm y) = y


@[simp]
theorem arccos_le_pi_div_two {x} : arccos x ≤ π / 2 ↔ 0 ≤ x


@[reassoc]
lemma shiftMap_comp' {X Y Z : C} {n : M} (f : X ⟶ Y) (g : Y ⟶ Z⟦n⟧) (a a' : M) (ha' : n + a = a') :
    F.shiftMap (f ≫ g) a a' ha' = (F.shift a).map f ≫ F.shiftMap g a a' ha'

(g : Y ⟶ (CategoryTheory.shiftFunctor C n).obj Z)


@[simp]
theorem update_inr_comp_inl [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : β} {x : γ} :
    update f (inr i) x ∘ inl = f ∘ inl

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i : β}
{x : γ}

Function.update f (Sum.inr i) x ∘ Sum.inl = f ∘ Sum.inl


theorem image_preimage_subset_inter_codom (s : Set β) : s ∩ r.codom ⊆ r.image (r.preimage s)

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)
(s : Set β)


theorem PairwiseDisjoint.prod {f : ι → Set α} {g : ι' → Set β} (hs : s.PairwiseDisjoint f)
    (ht : t.PairwiseDisjoint g) :
    (s ×ˢ t : Set (ι × ι')).PairwiseDisjoint fun i => f i.1 ×ˢ g i.2

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
{ι' : Type u_5}
{s : Set ι}
{t : Set ι'}
{f : ι → Set α}
{g : ι' → Set β}
(hs : s.PairwiseDisjoint f)
(ht : t.PairwiseDisjoint g)

(s ×ˢ t).PairwiseDisjoint fun i => f i.1 ×ˢ g i.2


@[simp]
theorem toLieEquiv_symm_apply (x : A₂) : e.toLieEquiv.symm x = e.symm x

{R : Type u}
{A₁ : Type v}
{A₂ : Type w}
[CommRing R]
[Ring A₁]
[Ring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
(x : A₂)


theorem _root_.PrimrecPred.not {p : α → Prop} [DecidablePred p] (hp : PrimrecPred p) :
    PrimrecPred fun a => ¬p a

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


@[simp]
theorem mem_think (s : WSeq α) (a) : a ∈ think s ↔ a ∈ s

{α : Type u}
(s : Stream'.WSeq α)
(a : α)


theorem Quotient.preimage_mem_nhds [TopologicalSpace X] [s : Setoid X] {V : Set <| Quotient s}
    {x : X} (hs : V ∈ 𝓝 (Quotient.mk' x)) : Quotient.mk' ⁻¹' V ∈ 𝓝 x

{X : Type u}
[TopologicalSpace X]
[s : Setoid X]
{V : Set (Quotient s)}
{x : X}
(hs : V ∈ 𝓝 (Quotient.mk' x))


theorem aeval_X_left_apply (p : MvPolynomial σ R) : aeval X p = p

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)

(MvPolynomial.aeval MvPolynomial.X) p = p


@[simp]
theorem mem_toSubmonoid {s : Subsemiring R} {x : R} : x ∈ s.toSubmonoid ↔ x ∈ s

{R : Type u}
[NonAssocSemiring R]
{s : Subsemiring R}
{x : R}


@[to_additive]
theorem left_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : a.Dom

{α : Type u_1}
[Add α]
{a b : Part α}
(hab : (a + b).Dom)


theorem isLUB_iff_isGreatest [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsLUB (s : Set α) i ↔ IsGreatest (↑s) i

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


theorem isBounded_const (ι' : Type*) [Nonempty ι'] {p : ι → Seminorm 𝕜 E} {q : Seminorm 𝕜₂ F}
    (f : E →ₛₗ[σ₁₂] F) :
    IsBounded p (fun _ : ι' => q) f ↔ ∃ (s : Finset ι) (C : ℝ≥0), q.comp f ≤ C • s.sup p

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_5}
{F : Type u_6}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedField 𝕜₂]
[AddCommGroup F]
[Module 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(ι' : Type u_10)
[Nonempty ι']
{p : ι → Seminorm 𝕜 E}
{q : Seminorm 𝕜₂ F}
(f : E →ₛₗ[σ₁₂] F)

Seminorm.IsBounded p (fun x => q) f ↔ ∃ s C, q.comp f ≤ C • s.sup p


/-- The complex power function `x ↦ x^s` is integrable on `(0, t)` iff `-1 < s.re`. -/
theorem integrableOn_Ioo_cpow_iff {s : ℂ} {t : ℝ} (ht : 0 < t) :
    IntegrableOn (fun x : ℝ ↦ (x : ℂ) ^ s) (Ioo (0 : ℝ) t) ↔ -1 < s.re

MeasureTheory.IntegrableOn (fun x => ↑x ^ s) (Set.Ioo 0 t) MeasureTheory.volume ↔ -1 < s.re


@[to_additive (attr := simp)]
lemma le_minOrder {n : ℕ∞} :
    n ≤ minOrder α ↔ ∀ ⦃a : α⦄, a ≠ 1 → IsOfFinOrder a → n ≤ orderOf a

n ≤ AddMonoid.minOrder α ↔ ∀ ⦃a : α⦄, a ≠ 0 → IsOfFinAddOrder a → n ≤ ↑(addOrderOf a)


@[simp]
theorem toRelIsoLT_symm (e : α ≃o β) : e.toRelIsoLT.symm = e.symm.toRelIsoLT

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(e : α ≃o β)


theorem repOfTprodIso_inv_apply (x : TensorProduct k V W) : (repOfTprodIso ρ τ).inv.hom x = x

{k G : Type u}
[CommRing k]
[Monoid G]
{V W : Type u}
[AddCommGroup V]
[AddCommGroup W]
[Module k V]
[Module k W]
(ρ : Representation k G V)
(τ : Representation k G W)
(x : TensorProduct k V W)


theorem antilipschitz_of_bound (f : E →SL[σ] F) {K : ℝ≥0} (h : ∀ x, ‖x‖ ≤ K * ‖f x‖) :
    AntilipschitzWith K f

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Ring 𝕜]
[Ring 𝕜₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜₂ F]
{σ : 𝕜 →+* 𝕜₂}
(f : E →SL[σ] F)
{K : ℝ≥0}
(h : ∀ (x : E), ‖x‖ ≤ ↑K * ‖f x‖)


theorem tsub_right_inj (hba : b ≤ a) (hca : c ≤ a) : a - b = a - c ↔ b = c

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


@[simp]
theorem toNonneg_coe {a : { x : α // 0 ≤ x }} : toNonneg (a : α) = a

{α : Type u_1}
[Zero α]
[LinearOrder α]
{a : { x // 0 ≤ x }}


theorem toLinearMap_ofAlgHom (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
    (ofAlgHom f g h₁ h₂).toLinearMap = f.toLinearMap

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(f : A₁ →ₐ[R] A₂)
(g : A₂ →ₐ[R] A₁)
(h₁ : f.comp g = AlgHom.id R A₂)
(h₂ : g.comp f = AlgHom.id R A₁)

(AlgEquiv.ofAlgHom f g h₁ h₂).toLinearMap = f.toLinearMap


theorem map_mul' : ∀ x y, f (x * y) = f x * f y

{α : Type u}
{β : Type v}
[Group α]
[Group β]
{f : α → β}
(hf : IsGroupHom f)
(x y : α)


theorem IsQuotient.norm_le {f : NormedAddGroupHom M N} (hquot : IsQuotient f) (m : M) :
    ‖f m‖ ≤ ‖m‖

{M : Type u_1}
{N : Type u_2}
[SeminormedAddCommGroup M]
[SeminormedAddCommGroup N]
{f : NormedAddGroupHom M N}
(hquot : f.IsQuotient)
(m : M)


@[to_additive (attr := simp)]
theorem comp_apply (x : F) : (p.comp f) x = p (f x)

{E : Type u_4}
{F : Type u_5}
[Group E]
[Group F]
(p : GroupSeminorm E)
(f : F →* E)
(x : F)


theorem removeNone_aux_some {x : α} (h : ∃ x', e (some x) = some x') :
    some (removeNone_aux e x) = e (some x)

{α : Type u_1}
{β : Type u_2}
(e : Option α ≃ Option β)
{x : α}
(h : ∃ x', e (some x) = some x')


theorem Set.Finite.isClopen_biUnion {s : Set Y} {f : Y → Set X} (hs : s.Finite)
    (h : ∀ i ∈ s, IsClopen <| f i) : IsClopen (⋃ i ∈ s, f i)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
{s : Set Y}
{f : Y → Set X}
(hs : s.Finite)
(h : ∀ i ∈ s, IsClopen (f i))


/-- To show a function into matrices is continuous it suffices to show the coefficients of the
resulting matrix are continuous -/
@[continuity]
theorem continuous_matrix [TopologicalSpace α] {f : α → Matrix m n R}
    (h : ∀ i j, Continuous fun a => f a i j) : Continuous f

(h : ∀ (i : m) (j : n), Continuous fun a => f a i j)


lemma coe_toEuclideanCLM_eq_toEuclideanLin (A : Matrix n n 𝕜) :
    (toEuclideanCLM (n := n) (𝕜 := 𝕜) A : _ →ₗ[𝕜] _) = toEuclideanLin A

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
(A : Matrix n n 𝕜)

↑(Matrix.toEuclideanCLM A) = Matrix.toEuclideanLin A


/-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N

(f_η : ∀ (X : C), CategoryTheory.CategoryStruct.comp (M.η.app X) (f.hom.app X) = N.η.app X := by aesop_cat)

(f_μ :
  ∀ (X : C),
    CategoryTheory.CategoryStruct.comp (M.μ.app X) (f.hom.app X) =
      CategoryTheory.CategoryStruct.comp
        (CategoryTheory.CategoryStruct.comp (M.map (f.hom.app X)) (f.hom.app (N.obj X))) (N.μ.app X) := by
  aesop_cat)

(CategoryTheory.MonadIso.mk f f_η f_μ).hom.toNatTrans = f.hom


theorem mod_pow_succ {x b k : Nat} :
    x % b ^ (k + 1) = x % b ^ k + b ^ k * ((x / b ^ k) % b)


/-- A compact subset has finite measure for a measure which is finite on compacts. -/
theorem _root_.IsCompact.measure_lt_top [TopologicalSpace α] {μ : Measure α}
    [IsFiniteMeasureOnCompacts μ] ⦃K : Set α⦄ (hK : IsCompact K) : μ K < ∞


theorem lift'_mk (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x))
    (m : M) (s : S) :
    LocalizedModule.lift' S g h (LocalizedModule.mk m s) = (h s).unit⁻¹.val (g m)

(h : ∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x))

LocalizedModule.lift' S g h (LocalizedModule.mk m s) = ↑⋯.unit⁻¹ (g m)


theorem _root_.Commute.ofNat_right (x : α) (n : ℕ) [n.AtLeastTwo] : Commute x (OfNat.ofNat n)

{α : Type u_1}
[NonAssocSemiring α]
(x : α)
(n : ℕ)
[n.AtLeastTwo]


theorem diag_eq_of_commute_stdBasisMatrix {i j : n} {M : Matrix n n α}
    (hM : Commute (stdBasisMatrix i j 1) M) : M i i = M j j

(hM : Commute (Matrix.stdBasisMatrix i j 1) M)


theorem coe_mul_of_apply_aux [AddMonoid ι] [SetLike.GradedMonoid A] (r : ⨁ i, A i) {i : ι}
    (r' : A i) {j n : ι} (H : ∀ x : ι, x + i = n ↔ x = j) :
    ((r * of (fun i => A i) i r') n : R) = r j * r'

{ι : Type u_1}
{σ : Type u_2}
{R : Type u_4}
[DecidableEq ι]
[Semiring R]
[SetLike σ R]
[AddSubmonoidClass σ R]
(A : ι → σ)
[AddMonoid ι]
[SetLike.GradedMonoid A]
(r : ⨁ (i : ι), ↥(A i))
{i : ι}
(r' : ↥(A i))
{j n : ι}
(H : ∀ (x : ι), x + i = n ↔ x = j)

↑((r * (DirectSum.of (fun i => ↥(A i)) i) r') n) = ↑(r j) * ↑r'


theorem coe_ne_zero {x : I} : (x : ℝ) ≠ 0 ↔ x ≠ 0

↑x ≠ 0 ↔ x ≠ 0


theorem sym_fill_mem (a : α) {i : Fin (n + 1)} {m : Sym α (n - i)} (h : m ∈ s.sym (n - i)) :
    m.fill a i ∈ (insert a s).sym n

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{n : ℕ}
(a : α)
{i : Fin (n + 1)}
{m : Sym α (n - ↑i)}
(h : m ∈ s.sym (n - ↑i))


@[simp]
protected theorem nonempty (C : G.ComponentCompl K) : (C : Set V).Nonempty

{V : Type u}
{G : SimpleGraph V}
{K : Set V}
(C : G.ComponentCompl K)


theorem Integrable.of_integral_ne_zero {f : α → G} (h : ∫ a, f a ∂μ ≠ 0) : Integrable f μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → G}
(h : ∫ (a : α), f a ∂μ ≠ 0)


theorem mul_div_root_cancel [Fact (Irreducible f)] :
    (X - C (root f)) * ((f.map (of f)) / (X - C (root f))) = f.map (of f)

{K : Type w}
[Field K]
(f : K[X])
[Fact (Irreducible f)]

(Polynomial.X - Polynomial.C (AdjoinRoot.root f)) *
    (Polynomial.map (AdjoinRoot.of f) f / (Polynomial.X - Polynomial.C (AdjoinRoot.root f))) =
  Polynomial.map (AdjoinRoot.of f) f


theorem martingale_zero (ℱ : Filtration ι m0) (μ : Measure Ω) : Martingale (0 : ι → Ω → E) ℱ μ

{Ω : Type u_1}
(E : Type u_2)
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
(ℱ : MeasureTheory.Filtration ι m0)
(μ : MeasureTheory.Measure Ω)


theorem coeff_X_add_C_pow (r : R) (n k : ℕ) :
    ((X + C r) ^ n).coeff k = r ^ (n - k) * (n.choose k : R)

{R : Type u}
[Semiring R]
(r : R)
(n k : ℕ)

((Polynomial.X + Polynomial.C r) ^ n).coeff k = r ^ (n - k) * ↑(n.choose k)


@[simp]
theorem span_span_coe_preimage : span R (((↑) : span R s → M) ⁻¹' s) = ⊤

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set M}

Submodule.span R (Subtype.val ⁻¹' s) = ⊤


/-- *Dirichlet's approximation theorem:*
For any real number `ξ` and positive natural `n`, there is a fraction `q`
such that `q.den ≤ n` and `|ξ - q| ≤ 1/((n+1)*q.den)`.

See also `AddCircle.exists_norm_nsmul_le`. -/
theorem exists_rat_abs_sub_le_and_den_le (ξ : ℝ) {n : ℕ} (n_pos : 0 < n) :
    ∃ q : ℚ, |ξ - q| ≤ 1 / ((n + 1) * q.den) ∧ q.den ≤ n

∃ q, |ξ - ↑q| ≤ 1 / ((↑n + 1) * ↑q.den) ∧ q.den ≤ n


theorem card_erase_eq_ite {a : α} {s : Multiset α} :
    card (s.erase a) = if a ∈ s then pred (card s) else card s

{α : Type u_1}
[DecidableEq α]
{a : α}
{s : Multiset α}

Multiset.card (s.erase a) = if a ∈ s then (Multiset.card s).pred else Multiset.card s


theorem finite_setOf_absNorm_eq [CharZero S] {n : ℕ} (hn : 0 < n) :
    {I : Ideal S | Ideal.absNorm I = n}.Finite

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
[Module.Finite ℤ S]
[CharZero S]
{n : ℕ}
(hn : 0 < n)


theorem subset_pointwise_smul_iff {a : M} {S T : Subsemiring R} : S ≤ a • T ↔ a⁻¹ • S ≤ T

{M : Type u_1}
{R : Type u_2}
[Group M]
[Semiring R]
[MulSemiringAction M R]
{a : M}
{S T : Subsemiring R}

S ≤ a • T ↔ a⁻¹ • S ≤ T


theorem HasDerivAt.tendsto_punctured_nhds (h : HasDerivAt f f' x) (hf' : f' ≠ 0) :
    Tendsto f (𝓝[≠] x) (𝓝[≠] f x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(h : HasDerivAt f f' x)
(hf' : f' ≠ 0)


theorem symm_continuousWithinAt_comp_right_iff {X} [TopologicalSpace X] {f : H → X} {s : Set H}
    {x : H} :
    ContinuousWithinAt (f ∘ I.symm) (I.symm ⁻¹' s ∩ range I) (I x) ↔ ContinuousWithinAt f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{X : Type u_4}
[TopologicalSpace X]
{f : H → X}
{s : Set H}
{x : H}

ContinuousWithinAt (f ∘ ↑I.symm) (↑I.symm ⁻¹' s ∩ Set.range ↑I) (↑I x) ↔ ContinuousWithinAt f s x


theorem pointwise_smul_subset_iff {a : α} {S T : Subgroup G} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{G : Type u_2}
[Group G]
[Group α]
[MulDistribMulAction α G]
{a : α}
{S T : Subgroup G}

a • S ≤ T ↔ S ≤ a⁻¹ • T


lemma cfcₙHom_id :
    cfcₙHom ha ⟨(ContinuousMap.id R).restrict <| σₙ R a, rfl⟩ = a

(cfcₙHom ha) { toContinuousMap := ContinuousMap.restrict (σₙ R a) (ContinuousMap.id R), map_zero' := ⋯ } = a


@[simp] lemma ceilDiv_apply (f : ∀ i, π i) (a : α) (i : ι) : (f ⌈/⌉ a) i = f i ⌈/⌉ a

{ι : Type u_1}
{α : Type u_2}
{π : ι → Type u_4}
[OrderedAddCommMonoid α]
[(i : ι) → OrderedAddCommMonoid (π i)]
[(i : ι) → SMulZeroClass α (π i)]
[(i : ι) → CeilDiv α (π i)]
(f : (i : ι) → π i)
(a : α)
(i : ι)


/-- A non-unital subring is closed under negation. -/
protected theorem neg_mem {x : R} : x ∈ s → -x ∈ s

{R : Type u}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)
{x : R}


theorem Valid'.balanceL {l} {x : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hr : Valid' x r o₂)
    (H : (∃ l', Raised l' (size l) ∧ BalancedSz l' (size r)) ∨
        ∃ r', Raised (size r) r' ∧ BalancedSz (size l) r') :
    Valid' o₁ (@balanceL α l x r) o₂

(H :
  (∃ l', Ordnode.Raised l' l.size ∧ Ordnode.BalancedSz l' r.size) ∨
    ∃ r', Ordnode.Raised r.size r' ∧ Ordnode.BalancedSz l.size r')


protected theorem le_sub_right_of_add_le {a b c : Int} (h : a + b ≤ c) : a ≤ c - b


/-- `MulOpposite.op` as a homeomorphism. -/
@[to_additive (attr := simps!) "`AddOpposite.op` as a homeomorphism."]
def opHomeomorph : M ≃ₜ Mᵐᵒᵖ

∀ (a : Mᵃᵒᵖ), AddOpposite.opHomeomorph.symm a = AddOpposite.unop a


/-- The angle between three points is zero if and only if one of the first and third points is
strictly between the other two, or those two points are equal but not equal to the second. -/
theorem angle_eq_zero_iff_eq_and_ne_or_sbtw {p₁ p₂ p₃ : P} :
    ∠ p₁ p₂ p₃ = 0 ↔ p₁ = p₃ ∧ p₁ ≠ p₂ ∨ Sbtw ℝ p₂ p₁ p₃ ∨ Sbtw ℝ p₂ p₃ p₁

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}

EuclideanGeometry.angle p₁ p₂ p₃ = 0 ↔ p₁ = p₃ ∧ p₁ ≠ p₂ ∨ Sbtw ℝ p₂ p₁ p₃ ∨ Sbtw ℝ p₂ p₃ p₁


@[to_additive]
theorem uniformContinuous_inv : UniformContinuous fun x : α => x⁻¹

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]


theorem measurableSet_eq_fun {m : MeasurableSpace α} {E} [TopologicalSpace E] [MetrizableSpace E]
    {f g : α → E} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    MeasurableSet { x | f x = g x }

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)


theorem ker_le_comap {K : Ideal S} (f : F) : RingHom.ker f ≤ comap f K

{R : Type u_1}
{S : Type u_2}
{F : Type u_3}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
{K : Ideal S}
(f : F)


/-- A set stable by infimum is `≥`-directed. -/
theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
    (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : DirectedOn (· ≥ ·) S

(H : ∀ ⦃i j : α⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S)


theorem map_inf_le : (N ⊓ N₂).map f ≤ N.map f ⊓ N₂.map f

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N N₂ : LieSubmodule R L M}

LieSubmodule.map f (N ⊓ N₂) ≤ LieSubmodule.map f N ⊓ LieSubmodule.map f N₂


theorem integral_coe_le_of_lintegral_coe_le {f : α → ℝ≥0} {b : ℝ≥0} (h : ∫⁻ a, f a ∂μ ≤ b) :
    ∫ a, (f a : ℝ) ∂μ ≤ b

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0}
{b : ℝ≥0}
(h : ∫⁻ (a : α), ↑(f a) ∂μ ≤ ↑b)


theorem ofConjAct_one : ofConjAct (1 : ConjAct G) = 1


@[simp]
theorem isAdjointPair_toBilin' [DecidableEq n] :
    BilinForm.IsAdjointPair (Matrix.toBilin' J) (Matrix.toBilin' J₃) (Matrix.toLin' A)
        (Matrix.toLin' A') ↔
      Matrix.IsAdjointPair J J₃ A A'

{R₃ : Type u_7}
[CommRing R₃]
{n : Type u_11}
[Fintype n]
(J J₃ A A' : Matrix n n R₃)
[DecidableEq n]

(Matrix.toBilin' J).IsAdjointPair (Matrix.toBilin' J₃) (Matrix.toLin' A) (Matrix.toLin' A') ↔ J.IsAdjointPair J₃ A A'


/-- If `f` sends two periodic points `x` and `y` of the same positive period to the same point,
then `x = y`. For a similar statement about points of different periods see `eq_of_apply_eq`. -/
theorem eq_of_apply_eq_same (hx : IsPeriodicPt f n x) (hy : IsPeriodicPt f n y) (hn : 0 < n)
    (h : f x = f y) : x = y

{α : Type u_1}
{f : α → α}
{x y : α}
{n : ℕ}
(hx : Function.IsPeriodicPt f n x)
(hy : Function.IsPeriodicPt f n y)
(hn : 0 < n)
(h : f x = f y)


/-- The pretopology associated to a space induces the Grothendieck topology associated to the space.
-/
@[simp]
theorem pretopology_toGrothendieck :
    Pretopology.toGrothendieck _ (Opens.pretopology T) = Opens.grothendieckTopology T

CategoryTheory.Pretopology.toGrothendieck (TopologicalSpace.Opens T) (Opens.pretopology T) =
  Opens.grothendieckTopology T


theorem liminf_compl : (liminf u f)ᶜ = limsup (compl ∘ u) f

{α : Type u_1}
{β : Type u_2}
[CompleteBooleanAlgebra α]
(f : Filter β)
(u : β → α)

(Filter.liminf u f)ᶜ = Filter.limsup (compl ∘ u) f


theorem image_neg_Ioc : Neg.neg '' Ioc a b = Ico (-b) (-a)

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

Neg.neg '' Set.Ioc a b = Set.Ico (-b) (-a)


@[simp]
theorem mem_pmap {p : α → Prop} {f : ∀ a, p a → β} {l H b} :
    b ∈ pmap f l H ↔ ∃ (a : _) (h : a ∈ l), f a (H a h) = b

{α : Type u}
{β : Type v}
{p : α → Prop}
{f : (a : α) → p a → β}
{l : List α}
{H : ∀ (a : α), a ∈ l → p a}
{b : β}


theorem submodule_span_le_lieSpan : Submodule.span R s ≤ lieSpan R L s

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{s : Set L}

Submodule.span R s ≤ (LieSubalgebra.lieSpan R L s).toSubmodule


/-- `star` as an `AddEquiv` -/
@[simps apply]
def starAddEquiv [AddMonoid R] [StarAddMonoid R] : R ≃+ R

{R : Type u}
[AddMonoid R]
[StarAddMonoid R]


theorem _root_.Set.PairwiseDisjoint.exists_mem_filter_basis {I : Type*} {l : I → Filter α}
    {ι : I → Sort*} {p : ∀ i, ι i → Prop} {s : ∀ i, ι i → Set α} {S : Set I}
    (hd : S.PairwiseDisjoint l) (hS : S.Finite) (h : ∀ i, (l i).HasBasis (p i) (s i)) :
    ∃ ind : ∀ i, ι i, (∀ i, p i (ind i)) ∧ S.PairwiseDisjoint fun i => s i (ind i)

(h : ∀ (i : I), (l i).HasBasis (p i) (s i))

∃ ind, (∀ (i : I), p i (ind i)) ∧ S.PairwiseDisjoint fun i => s i (ind i)


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

{R : Type u}
{I : Type v}
[CommSemiring R]
{z : R}
{s : I → R}
{t : Finset I}

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


theorem RelEmbedding.maximals_preimage_eq (f : r ↪r s) (y : Set β) :
    maximals r (f ⁻¹' y) = f ⁻¹' maximals s (y ∩ range f)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
(y : Set β)

maximals r (⇑f ⁻¹' y) = ⇑f ⁻¹' maximals s (y ∩ Set.range ⇑f)


theorem support_mul [DecidableEq α] {g₁ g₂ : α →₀ β} :
    (g₁ * g₂).support ⊆ g₁.support ∩ g₂.support

{α : Type u₁}
{β : Type u₂}
[MulZeroClass β]
[DecidableEq α]
{g₁ g₂ : α →₀ β}


@[reassoc]
lemma d_sndX (i j : ι) (hij : c.Rel i j) :
    d φ i j ≫ sndX φ j = fstX φ i j hij ≫ φ.f j + sndX φ i ≫ G.d i j

HomologicalComplex.homotopyCofiber.d φ i j ≫ HomologicalComplex.homotopyCofiber.sndX φ j =
  HomologicalComplex.homotopyCofiber.fstX φ i j hij ≫ φ.f j + HomologicalComplex.homotopyCofiber.sndX φ i ≫ G.d i j


@[to_additive]
theorem right_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : b.Dom

{α : Type u_1}
[Div α]
{a b : Part α}
(hab : (a / b).Dom)


/-- A structure encapsulating minimal axioms needed to defined a seminormed vector space, as found
in textbooks. This is meant to be used to easily define `SeminormedAddCommGroup E` instances from
scratch on a type with no preexisting distance or topology. -/
structure SeminormedAddCommGroup.Core (𝕜 : Type*) (E : Type*) [NormedField 𝕜] [AddCommGroup E]
    [Norm E] [Module 𝕜 E] : Prop where
  norm_nonneg (x : E) : 0 ≤ ‖x‖
  norm_smul (c : 𝕜) (x : E) : ‖c • x‖ = ‖c‖ * ‖x‖
  norm_triangle (x y : E) : ‖x + y‖ ≤ ‖x‖ + ‖y‖

(self : SeminormedAddCommGroup.Core 𝕜 E)

‖x + y‖ ≤ ‖x‖ + ‖y‖


@[to_additive]
theorem isOpenMap_mul_right (a : G) : IsOpenMap (· * a)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[ContinuousAdd G]
(a : G)


@[simp]
theorem mk_mul (f g : CauSeq β abv) : mk f * mk g = mk (f * g)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f g : CauSeq β abv)

CauSeq.Completion.mk f * CauSeq.Completion.mk g = CauSeq.Completion.mk (f * g)


/-- **Maximum modulus principle**: if `f : E → F` is complex differentiable on a nonempty bounded
set `U` and is continuous on its closure, then there exists a point `z ∈ frontier U` such that
`(‖f ·‖)` takes it maximum value on `closure U` at `z`. -/
theorem exists_mem_frontier_isMaxOn_norm [FiniteDimensional ℂ E] {f : E → F} {U : Set E}
    (hb : IsBounded U) (hne : U.Nonempty) (hd : DiffContOnCl ℂ f U) :
    ∃ z ∈ frontier U, IsMaxOn (norm ∘ f) (closure U) z

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
[Nontrivial E]
[FiniteDimensional ℂ E]
{f : E → F}
{U : Set E}
(hb : Bornology.IsBounded U)
(hne : U.Nonempty)
(hd : DiffContOnCl ℂ f U)


theorem mk_equiv_of_lift_eq (leq : lift.{v} #α = lift.{u} #β') : #(α ≃ β') = 2 ^ lift.{v} #α

(leq : Cardinal.lift.{v, u} #α = Cardinal.lift.{u, v} #β')


theorem cond_mul_eq_inter [IsFiniteMeasure μ] (hms : MeasurableSet s) (t : Set Ω) :
    μ[t|s] * μ s = μ (s ∩ t)

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s : Set Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hms : MeasurableSet s)
(t : Set Ω)

(ProbabilityTheory.cond μ s) t * μ s = μ (s ∩ t)


@[to_additive (attr := simp)]
theorem comap_top (f : M →ₙ* N) : (⊤ : Subsemigroup N).comap f = ⊤

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)


theorem dualAnnihilator_inf_eq (W W' : Subspace K V₁) :
    (W ⊓ W').dualAnnihilator = W.dualAnnihilator ⊔ W'.dualAnnihilator

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
[AddCommGroup V₁]
[Module K V₁]
(W W' : Subspace K V₁)

Submodule.dualAnnihilator (W ⊓ W') = Submodule.dualAnnihilator W ⊔ Submodule.dualAnnihilator W'


theorem frobenius_mk (x : ℕ × K) :
    (frobenius (PerfectClosure K p) p : PerfectClosure K p → PerfectClosure K p) (mk K p x) =
      mk _ _ (x.1, x.2 ^ p)

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]
(x : ℕ × K)

(frobenius (PerfectClosure K p) p) (PerfectClosure.mk K p x) = PerfectClosure.mk K p (x.1, x.2 ^ p)


theorem iInter₂_mono' {s : ∀ i, κ i → Set α} {t : ∀ i', κ' i' → Set α}
    (h : ∀ i' j', ∃ i j, s i j ⊆ t i' j') : ⋂ (i) (j), s i j ⊆ ⋂ (i') (j'), t i' j'


theorem intermediate_value_Ico {a b : α} (hab : a ≤ b) {f : α → δ} (hf : ContinuousOn f (Icc a b)) :
    Ico (f a) (f b) ⊆ f '' Ico a b

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
(hab : a ≤ b)
{f : α → δ}
(hf : ContinuousOn f (Set.Icc a b))


@[to_additive (attr := measurability)]
protected theorem Measurable.leOnePart : Measurable fun x ↦ leOnePart (f x)

{α : Type u_1}
{β : Type u_2}
[Lattice α]
[AddGroup α]
[MeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Measurable f)
[MeasurableSup α]
[MeasurableNeg α]


/-- An `n`-Freiman homomorphism from a set `A` to a set `B` is a map which preserves products of `n`
elements. -/
@[to_additive]
structure IsMulFreimanHom (n : ℕ) (A : Set α) (B : Set β) (f : α → β) : Prop where
  mapsTo : MapsTo f A B
  /-- An `n`-Freiman homomorphism preserves products of `n` elements. -/
  map_prod_eq_map_prod ⦃s t : Multiset α⦄ (hsA : ∀ ⦃x⦄, x ∈ s → x ∈ A) (htA : ∀ ⦃x⦄, x ∈ t → x ∈ A)
    (hs : Multiset.card s = n) (ht : Multiset.card t = n) (h : s.prod = t.prod) :
    (s.map f).prod = (t.map f).prod

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{n : ℕ}
{A : Set α}
{B : Set β}
{f : α → β}
(self : IsMulFreimanHom n A B f)
⦃s t : Multiset α⦄
(hsA : ∀ ⦃x : α⦄, x ∈ s → x ∈ A)
(htA : ∀ ⦃x : α⦄, x ∈ t → x ∈ A)
(hs : Multiset.card s = n)
(ht : Multiset.card t = n)
(h : s.prod = t.prod)

(Multiset.map f s).prod = (Multiset.map f t).prod


@[to_additive]
theorem tprod_range {g : γ → β} (f : β → α) (hg : Injective g) :
    ∏' x : Set.range g, f x = ∏' x, f (g x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
{g : γ → β}
(f : β → α)
(hg : Function.Injective g)

∏' (x : ↑(Set.range g)), f ↑x = ∏' (x : γ), f (g x)


theorem ordConnected_def : OrdConnected s ↔ ∀ ⦃x⦄ (_ : x ∈ s) ⦃y⦄ (_ : y ∈ s), Icc x y ⊆ s

s.OrdConnected ↔ ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → Set.Icc x y ⊆ s


theorem eLpNormEssSup_indicator_const_eq (s : Set α) (c : G) (hμs : μ s ≠ 0) :
    eLpNormEssSup (s.indicator fun _ : α => c) μ = ‖c‖₊

{α : Type u_1}
{G : Type u_4}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup G]
(s : Set α)
(c : G)
(hμs : μ s ≠ 0)

MeasureTheory.eLpNormEssSup (s.indicator fun x => c) μ = ↑‖c‖₊


theorem isPartition_single_iff (hJ : J ≤ I) (h : x ∈ Box.Icc I) :
    (single I J hJ x h).IsPartition ↔ J = I

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{x : ι → ℝ}
(hJ : J ≤ I)
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I J hJ x h).IsPartition ↔ J = I


@[simp]
theorem inv_im (z : ℂ) : z⁻¹.im = -z.im / normSq z


theorem linear_isometry_complex (f : ℂ ≃ₗᵢ[ℝ] ℂ) :
    ∃ a : circle, f = rotation a ∨ f = conjLIE.trans (rotation a)

(f : ℂ ≃ₗᵢ[ℝ] ℂ)

∃ a, f = rotation a ∨ f = Complex.conjLIE.trans (rotation a)


@[simp]
theorem norm_equiv_symm_snd (y : β) : ‖(WithLp.equiv p (α × β)).symm (0, y)‖ = ‖y‖

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(y : β)


/-- First technical lemma to control the growth of coefficients of the inverse. Bound the explicit
expression for `∑_{k<n+1} aᵏ Qₖ` in terms of a sum of powers of the same sum one step before,
in a general abstract setup. -/
theorem radius_right_inv_pos_of_radius_pos_aux1 (n : ℕ) (p : ℕ → ℝ) (hp : ∀ k, 0 ≤ p k) {r a : ℝ}
    (hr : 0 ≤ r) (ha : 0 ≤ a) :
    ∑ k ∈ Ico 2 (n + 1),
        a ^ k *
          ∑ c ∈ ({c | 1 < Composition.length c}.toFinset : Finset (Composition k)),
            r ^ c.length * ∏ j, p (c.blocksFun j) ≤
      ∑ j ∈ Ico 2 (n + 1), r ^ j * (∑ k ∈ Ico 1 n, a ^ k * p k) ^ j

(n : ℕ)
(p : ℕ → ℝ)
(hp : ∀ (k : ℕ), 0 ≤ p k)
{r a : ℝ}
(hr : 0 ≤ r)
(ha : 0 ≤ a)

∑ k ∈ Finset.Ico 2 (n + 1),
    a ^ k * ∑ c ∈ {c | 1 < c.length}.toFinset, r ^ c.length * ∏ j : Fin c.length, p (c.blocksFun j) ≤
  ∑ j ∈ Finset.Ico 2 (n + 1), r ^ j * (∑ k ∈ Finset.Ico 1 n, a ^ k * p k) ^ j


theorem Primrec₂.comp₂ {f : γ → δ → σ} {g : α → β → γ} {h : α → β → δ} (hf : Primrec₂ f)
    (hg : Primrec₂ g) (hh : Primrec₂ h) : Primrec₂ fun a b => f (g a b) (h a b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
[Primcodable δ]
[Primcodable σ]
{f : γ → δ → σ}
{g : α → β → γ}
{h : α → β → δ}
(hf : Primrec₂ f)
(hg : Primrec₂ g)
(hh : Primrec₂ h)


/-- A local maximum of a concave function is a global maximum. -/
theorem IsMaxOn.of_isLocalMax_of_convex_univ {f : E → β} {a : E} (h_local_max : IsLocalMax f a)
    (h_conc : ConcaveOn ℝ univ f) : ∀ x, f x ≤ f a

{E : Type u_1}
{β : Type u_2}
[AddCommGroup E]
[TopologicalSpace E]
[Module ℝ E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
[OrderedAddCommGroup β]
[Module ℝ β]
[OrderedSMul ℝ β]
{f : E → β}
{a : E}
(h_local_max : IsLocalMax f a)
(h_conc : ConcaveOn ℝ Set.univ f)
(x : E)


@[simp]
theorem seq_apply (f : α →ₛ β → γ) (g : α →ₛ β) (a : α) : f.seq g a = f a (g a)

(f : MeasureTheory.SimpleFunc α (β → γ))


lemma Base.closure_of_superset (hB : M.Base B) (hBX : B ⊆ X) : M.closure X = M.E

{α : Type u_2}
{M : Matroid α}
{X B : Set α}
(hB : M.Base B)
(hBX : B ⊆ X)


@[to_additive]
theorem some_mul_some [Mul α] (a b : α) : some a * some b = some (a * b)

Part.some a * Part.some b = Part.some (a * b)


/-- A left homology map data for a morphism of short complexes in the opposite category
induces a right homology map data in the original category. -/
@[simps]
def LeftHomologyMapData.unop {S₁ S₂ : ShortComplex Cᵒᵖ} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.LeftHomologyData} {h₂ : S₂.LeftHomologyData}
    (ψ : LeftHomologyMapData φ h₁ h₂) : RightHomologyMapData (unopMap φ) h₂.unop h₁.unop

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}

(ψ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)


theorem one_le_rpow_of_pos_of_le_one_of_nonpos {x : ℝ≥0} {z : ℝ} (hx1 : 0 < x) (hx2 : x ≤ 1)
    (hz : z ≤ 0) : 1 ≤ x ^ z


/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is strictly above the
segment `[(a, f a), (b, f b)]` if and only if `slope f c b < slope f a b`. -/
theorem lineMap_lt_map_iff_slope_lt_slope_right (h : 0 < (1 - r) * (b - a)) :
    lineMap (f a) (f b) r < f c ↔ slope f c b < slope f a b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(h : 0 < (1 - r) * (b - a))

(AffineMap.lineMap (f a) (f b)) r < f ((AffineMap.lineMap a b) r) ↔ slope f ((AffineMap.lineMap a b) r) b < slope f a b


lemma densityProcess_nonneg (κ : Kernel α (γ × β)) (ν : Kernel α γ) (n : ℕ)
    (a : α) (x : γ) (s : Set β) :
    0 ≤ densityProcess κ ν n a x s

(κ : ProbabilityTheory.Kernel α (γ × β))


@[simp]
theorem inv_mul_cancel_right₀ (h : b ≠ 0) (a : G₀) : a * b⁻¹ * b = a

{G₀ : Type u_3}
[GroupWithZero G₀]
{b : G₀}
(h : b ≠ 0)
(a : G₀)


theorem extChartAt_prod (x : M × M') :
    extChartAt (I.prod I') x = (extChartAt I x.1).prod (extChartAt I' x.2)

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


@[to_additive (attr := simp)]
theorem MonoidHom.mk_coe [MulOneClass M] [MulOneClass N] (f : M →* N) (hmul) :
    MonoidHom.mk f hmul = f

(hmul : ∀ (x y : M), (↑f).toFun (x + y) = (↑f).toFun x + (↑f).toFun y)

{ toZeroHom := ↑f, map_add' := hmul } = f


@[simp]
theorem cyclicPermutations_eq_singleton_iff {l : List α} {x : α} :
    cyclicPermutations l = [[x]] ↔ l = [x]


theorem not_inseparable_infty_coe {x : X} : ¬Inseparable ∞ (x : OnePoint X)

{X : Type u_1}
[TopologicalSpace X]
{x : X}


@[to_additive]
theorem intro' {K : Set α} (hK : IsCompact K) (h'K : IsClosed K)
    (hfK : ∀ x, x ∉ K → f x = 1) : HasCompactMulSupport f

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[Zero β]
{f : α → β}
{K : Set α}
(hK : IsCompact K)
(h'K : IsClosed K)
(hfK : ∀ x ∉ K, f x = 0)


@[deprecated exists_subsuperset_card_eq (since := "2024-06-24")]
theorem exists_intermediate_set' {m : ℕ} (hs : s.ncard ≤ m) (ht : m ≤ t.ncard) (h : s ⊆ t) :
    ∃ r : Set α, s ⊆ r ∧ r ⊆ t ∧ r.ncard = m

{α : Type u_1}
{s t : Set α}
{m : ℕ}
(hs : s.ncard ≤ m)
(ht : m ≤ t.ncard)
(h : s ⊆ t)


@[simp]
theorem Icc_mk_mk : Icc (⟨i, a⟩ : Sigma α) ⟨i, b⟩ = (Icc a b).map (Embedding.sigmaMk i)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → Preorder (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(i : ι)
(a b : α i)

Finset.Icc ⟨i, a⟩ ⟨i, b⟩ = Finset.map (Function.Embedding.sigmaMk i) (Finset.Icc a b)


@[simp] lemma coe_chainBot : (chainBot α β : L → R) = (-chainBotCoeff α β : ℤ) • α + β

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α : L → R)
(β : LieModule.Weight R L M)

⇑(LieModule.chainBot α β) = -↑(LieModule.chainBotCoeff α β) • α + ⇑β


/-- (internal implementation) the fact that the proposed limit cone is the limit -/
@[simps]
noncomputable def limitConeIsLimit (F : J ⥤ TypeMax.{v, u}) : IsLimit (limitCone F)

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ TypeMax)
(s : CategoryTheory.Limits.Cone F)
(v : s.pt)
(j : J)

↑((CategoryTheory.Limits.Types.limitConeIsLimit F).lift s v) j = s.π.app j v


/-- The vertical composition of two commutative squares as below is a commutative square.
```
  W ---f---> X
  |          |
  g          h
  |          |
  v          v
  Y ---i---> Z
  |          |
  g'         h'
  |          |
  v          v
  Y'---i'--> Z'

```
-/
lemma vert_comp {W X Y Y' Z Z' : C} {f : W ⟶ X} {g : W ⟶ Y} {g' : Y ⟶ Y'} {h : X ⟶ Z}
    {h' : Z ⟶ Z'} {i : Y ⟶ Z} {i' : Y' ⟶ Z'} (hsq₁ : CommSq f g h i) (hsq₂ : CommSq i g' h' i') :
    CommSq f (g ≫ g') (h ≫ h') i'

(hsq₂ : CategoryTheory.CommSq i g' h' i')

CategoryTheory.CommSq f (CategoryTheory.CategoryStruct.comp g g') (CategoryTheory.CategoryStruct.comp h h') i'


theorem mk_le_mk_of_dvd {a b : α} : a ∣ b → Associates.mk a ≤ Associates.mk b


/-- Twice the angle between a vector and a multiple of that vector is 0. -/
@[simp]
theorem two_zsmul_oangle_smul_right_self (x : V) {r : ℝ} : (2 : ℤ) • o.oangle x (r • x) = 0

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


lemma CFC.spectrum_algebraMap_eq [Nontrivial A] (r : R) :
    spectrum R (algebraMap R A r) = {r}

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
[Nontrivial A]
(r : R)


theorem tendsto_approxOn_range_Lp [BorelSpace E] {f : β → E} [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞)
    {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
    (hf : Memℒp f p μ) :
    Tendsto
      (fun n =>
        (memℒp_approxOn_range fmeas hf n).toLp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n))
      atTop (𝓝 (hf.toLp f))

[TopologicalSpace.SeparableSpace ↑(Set.range f ∪ {0})]

Filter.Tendsto
  (fun n => MeasureTheory.Memℒp.toLp ↑(MeasureTheory.SimpleFunc.approxOn f fmeas (Set.range f ∪ {0}) 0 ⋯ n) ⋯)
  Filter.atTop (𝓝 (MeasureTheory.Memℒp.toLp f hf))


/-- If there is an absolute upper bound on the size of an independent set, then the maximality axiom
  isn't needed to define a matroid by independent sets. -/
@[simps E] protected def ofBdd (E : Set α) (Indep : Set α → Prop)
    (indep_empty : Indep ∅)
    (indep_subset : ∀ ⦃I J⦄, Indep J → I ⊆ J → Indep I)
    (indep_aug : ∀⦃I B⦄, Indep I → I ∉ maximals (· ⊆ ·) {I | Indep I} →
      B ∈ maximals (· ⊆ ·) {I | Indep I} → ∃ x ∈ B \ I, Indep (insert x I))
    (subset_ground : ∀ I, Indep I → I ⊆ E)
    (indep_bdd : ∃ (n : ℕ), ∀ I, Indep I → I.encard ≤ n ) : IndepMatroid α

(indep_subset : ∀ ⦃I J : Set α⦄, Indep J → I ⊆ J → Indep I)

(indep_aug :
  ∀ ⦃I B : Set α⦄,
    Indep I →
      I ∉ maximals (fun x x_1 => x ⊆ x_1) {I | Indep I} →
        B ∈ maximals (fun x x_1 => x ⊆ x_1) {I | Indep I} → ∃ x ∈ B \ I, Indep (insert x I))

(subset_ground : ∀ (I : Set α), Indep I → I ⊆ E)

(indep_bdd : ∃ n, ∀ (I : Set α), Indep I → I.encard ≤ ↑n)

(IndepMatroid.ofBdd E Indep indep_empty indep_subset indep_aug subset_ground indep_bdd).E = E


theorem roots_cyclotomic_nodup [NeZero (n : R)] : (cyclotomic n R).roots.Nodup

{R : Type u_1}
[CommRing R]
{n : ℕ}
[IsDomain R]
[NeZero ↑n]


theorem continuous (hf : ClosedEmbedding f) : Continuous f

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


@[to_additive (attr := simp)]
lemma unitsLift_apply_inv_apply (f : C(X, Mˣ)) (x : X) :
    (↑(ContinuousMap.unitsLift f)⁻¹ : C(X, M)) x = (f x)⁻¹

{X : Type u_1}
{M : Type u_2}
[TopologicalSpace X]
[Monoid M]
[TopologicalSpace M]
[ContinuousMul M]
(f : C(X, Mˣ))
(x : X)

↑(ContinuousMap.unitsLift f)⁻¹ x = ↑(f x)⁻¹


/-- `reverse` acts only on the right of the tensor product. -/
theorem toBaseChange_reverse (Q : QuadraticForm R V) (x : CliffordAlgebra (Q.baseChange A)) :
    toBaseChange A Q (reverse x) =
      TensorProduct.map LinearMap.id reverse (toBaseChange A Q x)

(x : CliffordAlgebra (QuadraticForm.baseChange A Q))

(CliffordAlgebra.toBaseChange A Q) (CliffordAlgebra.reverse x) =
  (TensorProduct.map LinearMap.id CliffordAlgebra.reverse) ((CliffordAlgebra.toBaseChange A Q) x)


theorem norm_sub_le_of_mem_A {c : 𝕜} (hc : 1 < ‖c‖) {r ε : ℝ} (hε : 0 < ε) (hr : 0 < r) {x : E}
    {L₁ L₂ : E →L[𝕜] F} (h₁ : x ∈ A f L₁ r ε) (h₂ : x ∈ A f L₂ r ε) : ‖L₁ - L₂‖ ≤ 4 * ‖c‖ * ε

(h₁ : x ∈ FDerivMeasurableAux.A f L₁ r ε)

(h₂ : x ∈ FDerivMeasurableAux.A f L₂ r ε)

‖L₁ - L₂‖ ≤ 4 * ‖c‖ * ε


@[simp]
theorem coe_one : ⇑(1 : α →ₙ+* α) = id

{α : Type u_2}
[NonUnitalNonAssocSemiring α]


@[simp]
theorem pure_def {α} : (pure : α → Erased α) = @mk _


@[measurability]
protected theorem stronglyMeasurable (f : Lp E p μ) : StronglyMeasurable f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))


theorem finrank_hom_simple_simple_eq_one_iff (X Y : C) [FiniteDimensional 𝕜 (X ⟶ X)]
    [FiniteDimensional 𝕜 (X ⟶ Y)] [Simple X] [Simple Y] :
    finrank 𝕜 (X ⟶ Y) = 1 ↔ Nonempty (X ≅ Y)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(𝕜 : Type u_2)
[Field 𝕜]
[IsAlgClosed 𝕜]
[CategoryTheory.Linear 𝕜 C]
[CategoryTheory.Limits.HasKernels C]
(X Y : C)
[FiniteDimensional 𝕜 (X ⟶ X)]
[FiniteDimensional 𝕜 (X ⟶ Y)]
[CategoryTheory.Simple X]
[CategoryTheory.Simple Y]

FiniteDimensional.finrank 𝕜 (X ⟶ Y) = 1 ↔ Nonempty (X ≅ Y)


theorem X_dvd_sub_C : X ∣ p - C (p.coeff 0)

Polynomial.X ∣ p - Polynomial.C (p.coeff 0)


/-- If `b` is a right identity for a binary operation `f`, then `some b` is a right identity for
`Option.map₂ f`. -/
lemma map₂_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (o : Option α) :
    map₂ f o (some b) = o

{α : Type u_1}
{β : Type u_2}
{f : α → β → α}
{b : β}
(h : ∀ (a : α), f a b = a)
(o : Option α)


theorem closure_diff : closure s \ closure t ⊆ closure (s \ t)

{X : Type u}
{s t : Set X}
[TopologicalSpace X]


/-- The sheaf condition in terms of an equalizer diagram is equivalent
to the reformulation in terms of the presheaf preserving the limit of the diagram
consisting of the `U i` and `U i ⊓ U j`.
-/
theorem isSheaf_iff_isSheafPreservesLimitPairwiseIntersections :
    F.IsSheaf ↔ F.IsSheafPreservesLimitPairwiseIntersections

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Presheaf C X)


theorem summable_mul_of_summable_norm [CompleteSpace R] {f : ι → R} {g : ι' → R}
    (hf : Summable fun x => ‖f x‖) (hg : Summable fun x => ‖g x‖) :
    Summable fun x : ι × ι' => f x.1 * g x.2

{R : Type u_1}
{ι : Type u_2}
{ι' : Type u_3}
[NormedRing R]
[CompleteSpace R]
{f : ι → R}
{g : ι' → R}
(hf : Summable fun x => ‖f x‖)
(hg : Summable fun x => ‖g x‖)


@[to_additive (attr := simp)]
theorem uncurry_mulSingle_mulSingle [DecidableEq α] [∀ a, DecidableEq (β a)] [∀ a b, One (γ a b)]
    (a : α) (b : β a) (x : γ a b) :
    Sigma.uncurry (Pi.mulSingle a (Pi.mulSingle b x)) = Pi.mulSingle (Sigma.mk a b) x

{α : Type u_3}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_5}
[DecidableEq α]
[(a : α) → DecidableEq (β a)]
[(a : α) → (b : β a) → One (γ a b)]
(a : α)
(b : β a)
(x : γ a b)

Sigma.uncurry (Pi.mulSingle a (Pi.mulSingle b x)) = Pi.mulSingle ⟨a, b⟩ x


@[to_additive]
theorem prod_Ico_eq_prod_range (f : ℕ → M) (m n : ℕ) :
    ∏ k ∈ Ico m n, f k = ∏ k ∈ range (n - m), f (m + k)

{M : Type u_2}
[CommMonoid M]
(f : ℕ → M)
(m n : ℕ)

∏ k ∈ Finset.Ico m n, f k = ∏ k ∈ Finset.range (n - m), f (m + k)


/-- The natural `ℝ`-linear equivalence between `selfAdjoint ℂ` and `ℝ`. -/
@[simps apply symm_apply]
def Complex.selfAdjointEquiv : selfAdjoint ℂ ≃ₗ[ℝ] ℝ

Complex.selfAdjointEquiv.symm x = ⟨↑x, ⋯⟩


/-- Right-multiplying a permutation with `swap i j` twice gives the original permutation.

  This specialization of `swap_mul_self` is useful when using cosets of permutations.
-/
@[simp]
theorem mul_swap_mul_self (i j : α) (σ : Perm α) : σ * Equiv.swap i j * Equiv.swap i j = σ

{α : Type u}
[DecidableEq α]
(i j : α)
(σ : Equiv.Perm α)


/--
Let `R` be a linearly ordered semiring in which the property `a ≤ b → ∃ c, a + c = b` holds
(e.g. `R = ℕ`). If `S : R` is a sum of squares in `R`, then `0 ≤ S`. This is used in
`Mathlib.Algebra.Ring.Semireal.Defs` to show that linearly ordered fields are semireal.
-/
theorem isSumSq.nonneg {R : Type*} [LinearOrderedSemiring R] [ExistsAddOfLE R] {S : R}
    (pS : isSumSq S) : 0 ≤ S

{R : Type u_2}
[LinearOrderedSemiring R]
[ExistsAddOfLE R]
{S : R}
(pS : isSumSq S)


lemma isQuasiregular_iff_isUnit' (R : Type*) {A : Type*} [CommSemiring R] [NonUnitalSemiring A]
    [Module R A] [IsScalarTower R A A] [SMulCommClass R A A] {x : A} :
    IsQuasiregular x ↔ IsUnit (1 + x : Unitization R A)

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{x : A}


@[simp] theorem rotateLeft_zero (l : List α) : rotateLeft l 0 = l


@[to_additive]
theorem smul_def : s • t = (s ×ˢ t).image fun p : α × β => p.1 • p.2

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

s • t = Finset.image (fun p => p.1 • p.2) (s ×ˢ t)


theorem power_nat_eq {c : Cardinal.{u}} {n : ℕ} (h1 : ℵ₀ ≤ c) (h2 : 1 ≤ n) : c ^ n = c


theorem indicatorConstLp_compMeasurePreserving {s : Set β} (hs : MeasurableSet s)
    (hμs : μb s ≠ ∞) (c : E) (hf : MeasurePreserving f μ μb) :
    Lp.compMeasurePreserving f hf (indicatorConstLp p hs hμs c) =
      indicatorConstLp p (hs.preimage hf.measurable)
        (by rwa [hf.measure_preimage hs.nullMeasurableSet]) c

(hf : MeasureTheory.MeasurePreserving f μ μb)

(MeasureTheory.Lp.compMeasurePreserving f hf) (MeasureTheory.indicatorConstLp p hs hμs c) =
  MeasureTheory.indicatorConstLp p ⋯ ⋯ c


@[norm_cast] lemma cast_id (n : ℚ≥0) : NNRat.cast n = n


theorem infinitePos_of_tendsto_top {f : ℕ → ℝ} (hf : Tendsto f atTop atTop) :
    InfinitePos (ofSeq f)

(hf : Filter.Tendsto f Filter.atTop Filter.atTop)


theorem Real.cos_eq_tsum (r : ℝ) : Real.cos r = ∑' n : ℕ, (-1) ^ n * r ^ (2 * n) / ↑(2 * n)!


theorem cos_eq_zero_iff {θ : ℂ} : cos θ = 0 ↔ ∃ k : ℤ, θ = (2 * k + 1) * π / 2

Complex.cos θ = 0 ↔ ∃ k, θ = (2 * ↑k + 1) * ↑Real.pi / 2


@[simp]
theorem ωUnit_coe (p : ℕ) : (ωUnit p : X (q p)) = ω

↑(LucasLehmer.ωUnit p) = LucasLehmer.X.ω


/-- `(F ⨿ G).obj a` is in bijection with disjoint union of `F.obj a` and `G.obj a`. -/
@[simps]
noncomputable
def binaryCoproductEquiv (a : C) :
    (F ⨿ G).obj a ≃ (F.obj a) ⊕ (G.obj a)

(F G : CategoryTheory.Functor C (Type w))

(CategoryTheory.FunctorToTypes.binaryCoproductEquiv F G a) z =
  (CategoryTheory.FunctorToTypes.binaryCoproductIso F G).hom.app a z


/-- A cocone `t` on `F` is a colimit cocone if each cocone on `F` admits a unique
cocone morphism from `t`.

See <https://stacks.math.columbia.edu/tag/002F>.
-/
-- Porting note(#5171): removed @[nolint has_nonempty_instance]
structure IsColimit (t : Cocone F) where
  /-- `t.pt` maps to all other cocone covertices -/
  desc : ∀ s : Cocone F, t.pt ⟶ s.pt
  /-- The map `desc` makes the diagram with the natural transformations commute -/
  fac : ∀ (s : Cocone F) (j : J), t.ι.app j ≫ desc s = s.ι.app j := by aesop_cat
  /-- `desc` is the unique such map -/
  uniq :
    ∀ (s : Cocone F) (m : t.pt ⟶ s.pt) (_ : ∀ j : J, t.ι.app j ≫ m = s.ι.app j), m = desc s := by
    aesop_cat

(self : CategoryTheory.Limits.IsColimit t)


protected theorem map_neg (x : M) : f (-x) = -f x

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[Semiring S]
[AddCommGroup M]
[AddCommGroup M₂]
{module_M : Module R M}
{module_M₂ : Module S M₂}
{σ : R →+* S}
(f : M →ₛₗ[σ] M₂)
(x : M)


theorem mem_interior : x ∈ interior s ↔ ∃ t ⊆ s, IsOpen t ∧ x ∈ t

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]


theorem comap_mk_nhdsSet : comap mk (𝓝ˢ t) = 𝓝ˢ (mk ⁻¹' t)

{X : Type u_1}
[TopologicalSpace X]
{t : Set (SeparationQuotient X)}

Filter.comap SeparationQuotient.mk (𝓝ˢ t) = 𝓝ˢ (SeparationQuotient.mk ⁻¹' t)


@[reassoc (attr := simp)]
theorem complex_d_comp_π_f_zero :
    P.complex.d 1 0 ≫ P.π.f 0 = 0

(P : CategoryTheory.ProjectiveResolution Z)

CategoryTheory.CategoryStruct.comp (P.complex.d 1 0) (P.π.f 0) = 0


theorem comp_range : (g.comp f).range = AddSubgroup.map g.toAddMonoidHom f.range

{V₁ : Type u_3}
{V₂ : Type u_4}
{V₃ : Type u_5}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
[SeminormedAddCommGroup V₃]
(f : NormedAddGroupHom V₁ V₂)
(g : NormedAddGroupHom V₂ V₃)


theorem gcd_dvd_gcd_mul_right [GCDMonoid α] (m n k : α) : gcd m n ∣ gcd (m * k) n

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(m n k : α)


@[simp]
theorem aeval_eq (p : R[X]) : aeval (root f) p = mk f p

{R : Type u}
[CommRing R]
{f : R[X]}
(p : R[X])

(Polynomial.aeval (AdjoinRoot.root f)) p = (AdjoinRoot.mk f) p


protected theorem one_add_sub_one (n : Nat) : (1 + n) - 1 = n


@[to_additive (attr := norm_cast)]
theorem eq_iff {a b : αˣ} : (a : α) = b ↔ a = b


/--
A Lie algebra *has trivial radical* if its radical is trivial.
This is equivalent to having no non-trivial solvable ideals,
and further equivalent to having no non-trivial abelian ideals.

In characteristic zero, it is also equivalent to `LieAlgebra.IsSemisimple`.

Note that the label 'semisimple' is apparently not universally agreed
[upon](https://mathoverflow.net/questions/149391/on-radicals-of-a-lie-algebra#comment383669_149391)
for general coefficients.

For example [Seligman, page 15](seligman1967) uses the label for `LieAlgebra.HasTrivialRadical`,
whereas we reserve it for Lie algebras that are a direct sum of simple Lie algebras.
-/
class HasTrivialRadical : Prop where
  radical_eq_bot : radical R L = ⊥

[self : LieAlgebra.HasTrivialRadical R L]


/-- If `p` is a prime and `n` is `p`-smooth, then `p` and `n` are coprime. -/
lemma Prime.smoothNumbers_coprime {p n : ℕ} (hp : p.Prime) (hn : n ∈ smoothNumbers p) :
    Nat.Coprime p n

{p n : ℕ}
(hp : Nat.Prime p)
(hn : n ∈ p.smoothNumbers)


/-- `exp ∘ f` is analytic -/
theorem AnalyticOn.cexp (fs : AnalyticOn ℂ f s) : AnalyticOn ℂ (fun z ↦ exp (f z)) s

{E : Type}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{s : Set E}
(fs : AnalyticOn ℂ f s)


protected nonrec theorem SmoothAt.coordChangeL
    (hf : SmoothAt IM IB f x) (he : f x ∈ e.baseSet) (he' : f x ∈ e'.baseSet) :
    SmoothAt IM 𝓘(𝕜, F →L[𝕜] F) (fun y ↦ (e.coordChangeL 𝕜 e' (f y) : F →L[𝕜] F)) x

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

SmoothAt IM 𝓘(𝕜, F →L[𝕜] F) (fun y => ↑(Trivialization.coordChangeL 𝕜 e e' (f y))) x


theorem fderivWithin_ccos (hf : DifferentiableWithinAt ℂ f s x) (hxs : UniqueDiffWithinAt ℂ s x) :
    fderivWithin ℂ (fun x => Complex.cos (f x)) s x = -Complex.sin (f x) • fderivWithin ℂ f s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℂ f s x)
(hxs : UniqueDiffWithinAt ℂ s x)


/-- Local instance for `TransOrd ord.opposite`. -/
theorem TransOrd.instOpposite [ord : Ord α] [inst : TransOrd α] : @TransOrd _ ord.opposite

{α : Type u_1}
[ord : Ord α]
[inst : Batteries.TransOrd α]


@[simp, norm_cast]
theorem const_sup [Sup β] (a b : β) : ↑(a ⊔ b) = (↑a ⊔ ↑b : Germ l β)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[Sup β]
(a b : β)


@[to_additive]
theorem one_div_mul_eq_div : 1 / a * b = b / a

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


theorem union_zeroLocus (s s' : Set A) :
    zeroLocus 𝒜 s ∪ zeroLocus 𝒜 s' = zeroLocus 𝒜 (Ideal.span s ⊓ Ideal.span s' : Ideal A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(s s' : Set A)

ProjectiveSpectrum.zeroLocus 𝒜 s ∪ ProjectiveSpectrum.zeroLocus 𝒜 s' =
  ProjectiveSpectrum.zeroLocus 𝒜 ↑(Ideal.span s ⊓ Ideal.span s')


theorem rpow_sum_of_nonneg {ι : Type*} {a : ℝ} (ha : 0 ≤ a) {s : Finset ι} {f : ι → ℝ}
    (h : ∀ x ∈ s, 0 ≤ f x) : (a ^ ∑ x ∈ s, f x) = ∏ x ∈ s, a ^ f x

{ι : Type u_1}
{a : ℝ}
(ha : 0 ≤ a)
{s : Finset ι}
{f : ι → ℝ}
(h : ∀ x ∈ s, 0 ≤ f x)


/-- A *path* is a walk with no repeating vertices.
Use `SimpleGraph.Walk.IsPath.mk'` for a simpler constructor. -/
structure IsPath {u v : V} (p : G.Walk u v) extends IsTrail p : Prop where
  support_nodup : p.support.Nodup

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{p : G.Walk u v}
(self : p.IsPath)


theorem coe_injective : Injective ((↑) : Complementeds α → α)

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


theorem pairwise_subtype_iff_pairwise_set (s : Set α) (r : α → α → Prop) :
    (Pairwise fun (x : s) (y : s) => r x y) ↔ s.Pairwise r

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

(Pairwise fun x y => r ↑x ↑y) ↔ s.Pairwise r


/-- The obvious triangle `X₁ ⟶ X₁ ⊞ X₂ ⟶ X₂ ⟶ X₁⟦1⟧`. -/
@[simps!]
def binaryBiproductTriangle (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryBiproduct X₁ X₂] :
    Triangle C

(CategoryTheory.Pretriangulated.binaryBiproductTriangle X₁ X₂).obj₃ = X₂


@[to_additive]
theorem unit_mem_leftInv (x : Mˣ) (hx : (x : M) ∈ S) : ((x⁻¹ : _) : M) ∈ S.leftInv

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
(x : Mˣ)
(hx : ↑x ∈ S)


/-- Scaling by an element `k` of the scalar ring as a `DilationEquiv` with ratio `‖k‖₊`, mapping
from a normed space to a normed torsor over that space sending `0` to `c`. -/
@[simps]
def DilationEquiv.smulTorsor (c : P) {k : 𝕜} (hk : k ≠ 0) : E ≃ᵈ P

{𝕜 : Type u_1}
{E : Type u_2}
[NormedDivisionRing 𝕜]
[SeminormedAddCommGroup E]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
{P : Type u_3}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
{k : 𝕜}
(hk : k ≠ 0)

∀ (x : P), (DilationEquiv.smulTorsor c hk).symm x = (k⁻¹ • fun x => x -ᵥ c) x


theorem toSeminorm_ball_zero {f : E →ₗ[𝕜] 𝕜} {r : ℝ} :
    Seminorm.ball f.toSeminorm 0 r = { x : E | ‖f x‖ < r }

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{f : E →ₗ[𝕜] 𝕜}
{r : ℝ}


theorem Mem.left_unique : Relator.LeftUnique ((· ∈ ·) : α → Computation α → Prop)


/-- Change of variables, most common version. If `f` has continuous derivative `f'` on `[a, b]`,
and `g` is continuous, then we can substitute `u = f x` to get
`∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_mul_deriv {f f' g : ℝ → ℝ} (h : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
    (h' : ContinuousOn f' (uIcc a b)) (hg : Continuous g) :
    (∫ x in a..b, (g ∘ f) x * f' x) = ∫ x in f a..f b, g x

(h : ∀ x ∈ [[a, b]], HasDerivAt f (f' x) x)

∫ (x : ℝ) in a..b, (g ∘ f) x * f' x = ∫ (x : ℝ) in f a..f b, g x


theorem measurableSet_eq_stopping_time [AddGroup ι] [TopologicalSpace ι] [MeasurableSpace ι]
    [BorelSpace ι] [OrderTopology ι] [MeasurableSingletonClass ι] [SecondCountableTopology ι]
    [MeasurableSub₂ ι] (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π) :
    MeasurableSet[hτ.measurableSpace] {ω | τ ω = π ω}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ π : Ω → ι}
[AddGroup ι]
[TopologicalSpace ι]
[MeasurableSpace ι]
[BorelSpace ι]
[OrderTopology ι]
[MeasurableSingletonClass ι]
[SecondCountableTopology ι]
[MeasurableSub₂ ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(hπ : MeasureTheory.IsStoppingTime f π)


/--
A `ProjectiveResolution Z` consists of a bundled `ℕ`-indexed chain complex of projective objects,
along with a quasi-isomorphism to the complex consisting of just `Z` supported in degree `0`.
-/
structure ProjectiveResolution (Z : C) where
  /-- the chain complex involved in the resolution -/
  complex : ChainComplex C ℕ
  /-- the chain complex must be degreewise projective -/
  projective : ∀ n, Projective (complex.X n) := by infer_instance
  /-- the chain complex must have homology -/
  [hasHomology : ∀ i, complex.HasHomology i]
  /-- the morphism to the single chain complex with `Z` in degree `0` -/
  π : complex ⟶ (ChainComplex.single₀ C).obj Z
  /-- the morphism to the single chain complex with `Z` in degree `0` is a quasi-isomorphism -/
  quasiIso : QuasiIso π := by infer_instance

(self : CategoryTheory.ProjectiveResolution Z)


lemma dvd_iff {p : A[X]} : minpoly A x ∣ p ↔ Polynomial.aeval x p = 0

{A : Type u_1}
{B : Type u_2}
[Field A]
[Ring B]
[Algebra A B]
{x : B}
{p : A[X]}

minpoly A x ∣ p ↔ (Polynomial.aeval x) p = 0


@[simp]
theorem mem_ndinsert {a b : α} {s : Multiset α} : a ∈ ndinsert b s ↔ a = b ∨ a ∈ s

{α : Type u_1}
[DecidableEq α]
{a b : α}
{s : Multiset α}

a ∈ Multiset.ndinsert b s ↔ a = b ∨ a ∈ s


theorem preimage_invFun_of_mem [n : Nonempty α] {f : α → β} (hf : Injective f) {s : Set α}
    (h : Classical.choice n ∈ s) : invFun f ⁻¹' s = f '' s ∪ (range f)ᶜ

{α : Type u_1}
{β : Type u_2}
[n : Nonempty α]
{f : α → β}
(hf : Function.Injective f)
{s : Set α}
(h : Classical.choice n ∈ s)

Function.invFun f ⁻¹' s = f '' s ∪ (Set.range f)ᶜ


theorem indexOf_cons [BEq α] :
    (x :: xs : List α).indexOf y = bif x == y then 0 else xs.indexOf y + 1

{α : Type u_1}
{x : α}
{xs : List α}
{y : α}
[BEq α]

List.indexOf y (x :: xs) = bif x == y then 0 else List.indexOf y xs + 1


/-- The equivalence between `Bipointed` and itself induced by `Prod.swap` both ways. -/
@[simps!]
def swapEquiv : Bipointed ≌ Bipointed

(Bipointed.swapEquiv.inverse.obj X).X = X.X


theorem Decidable.not_imp_iff_and_not [Decidable a] : ¬(a → b) ↔ a ∧ ¬b


@[simp]
theorem csSup_Iic : sSup (Iic a) = a

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


theorem card_le_card_of_rightTotal_unique (h₁ : RightTotal r) (h₂ : RightUnique r) :
    Fintype.card β ≤ Fintype.card α

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
{r : α → β → Prop}
(h₁ : Relator.RightTotal r)
(h₂ : Relator.RightUnique r)


theorem left_unitality (X : Type u) :
    (λ_ ((free R).obj X)).hom =
      (ε R ⊗ 𝟙 ((free R).obj X)) ≫ (μ R (𝟙_ (Type u)) X).hom ≫ map (free R).obj (λ_ X).hom

(CategoryTheory.MonoidalCategory.leftUnitor ((ModuleCat.free R).obj X)).hom =
  CategoryTheory.MonoidalCategory.tensorHom (ModuleCat.Free.ε R) (𝟙 ((ModuleCat.free R).obj X)) ≫
    (ModuleCat.Free.μ R (𝟙_ (Type u)) X).hom ≫
      CategoryTheory.map (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.leftUnitor X).hom


theorem EuclideanSpace.piLpCongrLeft_single
    {ι' : Type*} [Fintype ι'] [DecidableEq ι'] (e : ι' ≃ ι) (i' : ι') (v : 𝕜) :
    LinearIsometryEquiv.piLpCongrLeft 2 𝕜 𝕜 e (EuclideanSpace.single i' v) =
      EuclideanSpace.single (e i') v

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
[DecidableEq ι]
[Fintype ι]
{ι' : Type u_8}
[Fintype ι']
[DecidableEq ι']
(e : ι' ≃ ι)
(i' : ι')
(v : 𝕜)

(LinearIsometryEquiv.piLpCongrLeft 2 𝕜 𝕜 e) (EuclideanSpace.single i' v) = EuclideanSpace.single (e i') v


lemma indicator_mul_left (s : Set ι) (f g : ι → M₀) :
    indicator s (fun j ↦ f j * g j) i = indicator s f i * g i

{ι : Type u_1}
{M₀ : Type u_4}
[MulZeroClass M₀]
{i : ι}
(s : Set ι)
(f g : ι → M₀)

s.indicator (fun j => f j * g j) i = s.indicator f i * g i


/-- If a function is differentiable on the right of a point `a : ℝ`, continuous at `a`, and
its derivative also converges at `a`, then `f` is differentiable on the right at `a`. -/
theorem hasDerivWithinAt_Ici_of_tendsto_deriv {s : Set ℝ} {e : E} {a : ℝ} {f : ℝ → E}
    (f_diff : DifferentiableOn ℝ f s) (f_lim : ContinuousWithinAt f s a) (hs : s ∈ 𝓝[>] a)
    (f_lim' : Tendsto (fun x => deriv f x) (𝓝[>] a) (𝓝 e)) : HasDerivWithinAt f e (Ici a) a

(f_lim' : Filter.Tendsto (fun x => deriv f x) (𝓝[>] a) (𝓝 e))


theorem pairwise_on_bool (hr : Symmetric r) {a b : α} :
    Pairwise (r on fun c => cond c a b) ↔ r a b

{α : Type u_1}
{r : α → α → Prop}
(hr : Symmetric r)
{a b : α}

Pairwise (r on fun c => bif c then a else b) ↔ r a b


@[simp]
theorem Composition.toCompositionAsSet_boundaries (c : Composition n) :
    c.toCompositionAsSet.boundaries = c.boundaries


@[reassoc]
lemma descOpcycles_comp {A' : C} (α : A ⟶ A') :
    S.descOpcycles k hk ≫ α = S.descOpcycles (k ≫ α) (by rw [reassoc_of% hk, zero_comp])

(hk : CategoryTheory.CategoryStruct.comp S.f k = 0)

CategoryTheory.CategoryStruct.comp (S.descOpcycles k hk) α = S.descOpcycles (CategoryTheory.CategoryStruct.comp k α) ⋯


theorem Icc_eq_pi : Box.Icc I = pi univ fun i ↦ Icc (I.lower i) (I.upper i)

BoxIntegral.Box.Icc I = Set.univ.pi fun i => Set.Icc (I.lower i) (I.upper i)


theorem forall₃_imp {p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c → q a b c) :
    (∀ a b c, p a b c) → ∀ a b c, q a b c

{p q : (a : α) → (b : β a) → γ a b → Prop}

(h : ∀ (a : α) (b : β a) (c : γ a b), p a b c → q a b c)

(∀ (a : α) (b : β a) (c : γ a b), p a b c) → ∀ (a : α) (b : β a) (c : γ a b), q a b c


@[to_additive (attr := continuity, fun_prop)]
theorem Continuous.zpow {f : α → G} (h : Continuous f) (z : ℤ) : Continuous fun b => f b ^ z

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[TopologicalSpace α]
{f : α → G}
(h : Continuous f)
(z : ℤ)


@[simp]
theorem toPGame_lf_iff {a b : Ordinal} : a.toPGame ⧏ b.toPGame ↔ a < b


@[to_additive]
lemma prod_div_prod_mem_mulSpan (ht : t ⊆ s) (hu : u ⊆ s) :
    (∏ a in t, a) / ∏ a in u, a ∈ mulSpan s

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
[Fintype α]
{s t u : Finset α}
(ht : t ⊆ s)
(hu : u ⊆ s)


/-- `some_basis` gives a basis with the required orientation. -/
@[simp]
theorem someBasis_orientation [Nonempty ι] [DecidableEq ι] (x : Orientation R M ι)
    (h : Fintype.card ι = finrank R M) : (x.someBasis h).orientation = x

(h : Fintype.card ι = FiniteDimensional.finrank R M)


/-- The cartesian product of `C^n` functions at a point in a domain is `C^n`. -/
theorem ContDiffWithinAt.prod {s : Set E} {f : E → F} {g : E → G} (hf : ContDiffWithinAt 𝕜 n f s x)
    (hg : ContDiffWithinAt 𝕜 n g s x) : ContDiffWithinAt 𝕜 n (fun x : E => (f x, g x)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{n : ℕ∞}
{s : Set E}
{f : E → F}
{g : E → G}
(hf : ContDiffWithinAt 𝕜 n f s x)
(hg : ContDiffWithinAt 𝕜 n g s x)

ContDiffWithinAt 𝕜 n (fun x => (f x, g x)) s x


/-- If `X` is a real random variable with Gaussian law with mean `μ` and variance `v`, then `y + X`
has Gaussian law with mean `μ + y` and variance `v`. -/
lemma gaussianReal_const_add {X : Ω → ℝ} (hX : Measure.map X ℙ = gaussianReal μ v) (y : ℝ) :
    Measure.map (fun ω ↦ y + X ω) ℙ = gaussianReal (μ + y) v

(hX : MeasureTheory.Measure.map X MeasureTheory.volume = ProbabilityTheory.gaussianReal μ v)

MeasureTheory.Measure.map (fun ω => y + X ω) MeasureTheory.volume = ProbabilityTheory.gaussianReal (μ + y) v


@[to_additive]
theorem bot_pow : ∀ {n : ℕ}, n ≠ 0 → (⊥ : Interval α) ^ n = ⊥

{α : Type u_2}
[OrderedAddCommMonoid α]
{n : ℕ}

n ≠ 0 → n • ⊥ = ⊥


theorem comp_unify {α : Type*} {x : α → Σˣ f} {i j : ι} (ij : i ≤ j)
    (h : i ∈ upperBounds (range (Sigma.fst ∘ x))) :
    f i j ij ∘ unify f x i h = unify f x j
      fun k hk => _root_.trans (mem_upperBounds.1 h k hk) ij

[DirectedSystem G fun i j h => ⇑(f i j h)]

{x : α → FirstOrder.Language.Structure.Sigma f}

(h : i ∈ upperBounds (Set.range (Sigma.fst ∘ x)))

⇑(f i j ij) ∘ FirstOrder.Language.DirectLimit.unify f x i h = FirstOrder.Language.DirectLimit.unify f x j ⋯


/-- The even subalgebras of the algebras with quadratic form `Q` and `-Q` are isomorphic.

Stated another way, `𝒞ℓ⁺(p,q,r)` and `𝒞ℓ⁺(q,p,r)` are isomorphic. -/
@[simps!]
def evenEquivEvenNeg : CliffordAlgebra.even Q ≃ₐ[R] CliffordAlgebra.even (-Q)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(a : ↥(CliffordAlgebra.even (-Q)))

(CliffordAlgebra.evenEquivEvenNeg Q).symm a = (CliffordAlgebra.evenToNeg (-Q) Q ⋯) a


theorem commute_star_comm {x y : R} : Commute (star x) y ↔ Commute x (star y)

{R : Type u}
[Mul R]
[StarMul R]
{x y : R}


/-- `a` semiconjugates `x` to `a * x * a⁻¹`. -/
@[to_additive "`a` semiconjugates `x` to `a + x + -a`."]
theorem conj_mk (a x : G) : SemiconjBy a x (a * x * a⁻¹)


theorem coeff_bdd_of_norm_le {B : ℝ} {x : K} (h : ∀ φ : K →+* A, ‖φ x‖ ≤ B) (i : ℕ) :
    ‖(minpoly ℚ x).coeff i‖ ≤ max B 1 ^ finrank ℚ K * (finrank ℚ K).choose (finrank ℚ K / 2)

{K : Type u_1}
[Field K]
[NumberField K]
{A : Type u_2}
[NormedField A]
[IsAlgClosed A]
[NormedAlgebra ℚ A]
{B : ℝ}
{x : K}
(h : ∀ (φ : K →+* A), ‖φ x‖ ≤ B)
(i : ℕ)

‖(minpoly ℚ x).coeff i‖ ≤
  max B 1 ^ FiniteDimensional.finrank ℚ K *
    ↑((FiniteDimensional.finrank ℚ K).choose (FiniteDimensional.finrank ℚ K / 2))


/-- An abstract version of continuity of sequentially continuous functions on metric spaces:
if a filter `k` is countably generated then `Tendsto f k l` iff for every sequence `u`
converging to `k`, `f ∘ u` tends to `l`. -/
theorem tendsto_iff_seq_tendsto {f : α → β} {k : Filter α} {l : Filter β} [k.IsCountablyGenerated] :
    Tendsto f k l ↔ ∀ x : ℕ → α, Tendsto x atTop k → Tendsto (f ∘ x) atTop l

{α : Type u_3}
{β : Type u_4}
{f : α → β}
{k : Filter α}
{l : Filter β}
[k.IsCountablyGenerated]

Filter.Tendsto f k l ↔ ∀ (x : ℕ → α), Filter.Tendsto x Filter.atTop k → Filter.Tendsto (f ∘ x) Filter.atTop l


@[to_additive (attr := simp)]
theorem mem_mulAntidiagonal : x ∈ mulAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a

{α : Type u_1}
[OrderedCancelCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}
{a : α}
{x : α × α}

x ∈ Finset.mulAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a


@[simp] lemma mem_nonZeroDivisorsLeft_iff {x : M₀} :
    x ∈ nonZeroDivisorsLeft M₀ ↔ ∀ y, y * x = 0 → y = 0

(M₀ : Type u_1)
[MonoidWithZero M₀]
{x : M₀}

x ∈ nonZeroDivisorsLeft M₀ ↔ ∀ (y : M₀), y * x = 0 → y = 0


@[simp]
theorem frobenius_norm_row (v : m → α) : ‖row ι v‖ = ‖(WithLp.equiv 2 _).symm v‖

{m : Type u_3}
{α : Type u_5}
{ι : Type u_7}
[Fintype m]
[Unique ι]
[SeminormedAddCommGroup α]
(v : m → α)

‖Matrix.row ι v‖ = ‖(WithLp.equiv 2 (m → α)).symm v‖


theorem nhds_basis_abs_convex_open :
    (𝓝 (0 : E)).HasBasis (fun s => (0 : E) ∈ s ∧ IsOpen s ∧ Balanced 𝕜 s ∧ Convex ℝ s) id

(𝕜 : Type u_1)
(E : Type u_2)
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Module ℝ E]
[SMulCommClass ℝ 𝕜 E]
[TopologicalSpace E]
[LocallyConvexSpace ℝ E]
[ContinuousSMul 𝕜 E]
[ContinuousSMul ℝ E]
[TopologicalAddGroup E]

(𝓝 0).HasBasis (fun s => 0 ∈ s ∧ IsOpen s ∧ Balanced 𝕜 s ∧ Convex ℝ s) id


theorem mem_carrier {s : NonUnitalSubsemiring R} {x : R} : x ∈ s.carrier ↔ x ∈ s

{R : Type u}
[NonUnitalNonAssocSemiring R]
{s : NonUnitalSubsemiring R}
{x : R}


/-- A multiplicative action M ↻ X viewed as a functor mapping the single object of M to X
  and an element `m : M` to the map `X → X` given by multiplication by `m`. -/
@[simps]
def actionAsFunctor : SingleObj M ⥤ Type u

(M : Type u_1)
[Monoid M]
(X : Type u)
[MulAction M X]

∀ {X_1 Y : CategoryTheory.SingleObj M} (x : X_1 ⟶ Y) (x_1 : X), (CategoryTheory.actionAsFunctor M X).map x x_1 = x • x_1


/-- An encoding of a type in a certain alphabet, together with a decoding. -/
structure Encoding (α : Type u) where
  Γ : Type v
  encode : α → List Γ
  decode : List Γ → Option α
  decode_encode : ∀ x, decode (encode x) = some x

{α : Type u}
(self : Computability.Encoding α)
(x : α)


protected theorem _root_.Finset.nullMeasurableSet (s : Finset α) : NullMeasurableSet (↑s) μ

[MeasurableSingletonClass (MeasureTheory.NullMeasurableSpace α μ)]


theorem nonpos_of_restrict_le_zero (hi₂ : v ≤[i] 0) : v i ≤ 0

(hi₂ : v.restrict i ≤ MeasureTheory.VectorMeasure.restrict 0 i)


lemma even_xor_odd (n : ℕ) : Xor' (Even n) (Odd n)


theorem mop_inj_iff (x y : C) : mop x = mop y ↔ x = y


theorem Equiv.infinite_iff (e : α ≃ β) : Infinite α ↔ Infinite β

{α : Sort u_1}
{β : Sort u_2}
(e : α ≃ β)


@[to_additive (attr := simp, norm_cast)]
theorem val_zpow_eq_zpow_val : ∀ (u : αˣ) (n : ℤ), ((u ^ n : αˣ) : α) = (u : α) ^ n

{α : Type u_1}
[SubtractionMonoid α]
(u : AddUnits α)
(n : ℤ)


@[to_additive Iio_add_Iic_subset]
theorem Iio_mul_Iic_subset' [LocallyFiniteOrderBot α] (a b : α) : Iio a * Iic b ⊆ Iio (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]

Finset.Iio a * Finset.Iic b ⊆ Finset.Iio (a * b)


@[simp]
theorem natCast_lt_top (x : ℕ) : (x : PartENat) < ⊤


theorem diam_image (s : Set P) : Metric.diam (f '' s) = Metric.diam s

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f : P →ᵃⁱ[𝕜] P₂)
(s : Set P)


theorem subset_toMeasurable (μ : Measure α) (s : Set α) : s ⊆ toMeasurable μ s

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


/-- Given linear maps `f : M → Q`, `g : N → S`, and `h : P → T`, if we identify `M ⊗ (N ⊗ P)`
with `(M ⊗ N) ⊗ P` and `Q ⊗ (S ⊗ T)` with `(Q ⊗ S) ⊗ T`, then this lemma states that
`(f ⊗ g) ⊗ h = f ⊗ (g ⊗ h)`. -/
lemma map_map_comp_assoc_symm_eq (f : M →ₗ[R] Q) (g : N →ₗ[R] S) (h : P →ₗ[R] T) :
    map (map f g) h ∘ₗ (TensorProduct.assoc R M N P).symm =
      (TensorProduct.assoc R Q S T).symm ∘ₗ map f (map g h)

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
{S : Type u_8}
{T : Type u_9}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[AddCommMonoid S]
[AddCommMonoid T]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
[Module R S]
[Module R T]
(f : M →ₗ[R] Q)
(g : N →ₗ[R] S)
(h : P →ₗ[R] T)

TensorProduct.map (TensorProduct.map f g) h ∘ₗ ↑(TensorProduct.assoc R M N P).symm =
  ↑(TensorProduct.assoc R Q S T).symm ∘ₗ TensorProduct.map f (TensorProduct.map g h)


theorem equicontinuous_iInf_rng {u : κ → UniformSpace α'} {F : ι → X → α'} :
    Equicontinuous (uα := ⨅ k, u k) F ↔ ∀ k, Equicontinuous (uα := u k) F

{ι : Type u_1}
{κ : Type u_2}
{X : Type u_3}
{α' : Type u_8}
[tX : TopologicalSpace X]
{u : κ → UniformSpace α'}
{F : ι → X → α'}

Equicontinuous F ↔ ∀ (k : κ), Equicontinuous F


theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) :
    (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
      t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{t : MeasureTheory.SignedMeasure α}
{f : α → ℝ}
(hf : Measurable f)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)

(t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x)) ⟂ₘ
  t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x)


theorem stronglyMeasurable_mk (hf : AEStronglyMeasurable f μ) : StronglyMeasurable (hf.mk f)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.StronglyMeasurable (MeasureTheory.AEStronglyMeasurable.mk f hf)


theorem isSheaf_of_yoneda {P : Cᵒᵖ ⥤ Type v}
    (h : ∀ {X} (S : Sieve X), S ∈ J X → YonedaSheafCondition P S) : IsSheaf J P

(J : CategoryTheory.GrothendieckTopology C)

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

(h : ∀ {X : C}, ∀ S ∈ J.sieves X, CategoryTheory.Presieve.YonedaSheafCondition P S)


@[simp]
theorem prod_top : (prod ⊤ ⊤ : Subalgebra R (A × B)) = ⊤

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]


theorem FieldAxiom.realize_toSentence_iff_toProp {K : Type*}
    [Add K] [Mul K] [Neg K] [Zero K] [One K] [CompatibleRing K]
    (ax : FieldAxiom) :
    (K ⊨ (ax.toSentence : Sentence Language.ring)) ↔ ax.toProp K

{K : Type u_2}
[Add K]
[Mul K]
[Neg K]
[Zero K]
[One K]
[FirstOrder.Ring.CompatibleRing K]
(ax : FirstOrder.Field.FieldAxiom)

K ⊨ ax.toSentence ↔ FirstOrder.Field.FieldAxiom.toProp K ax


@[to_additive]
protected theorem Finset.multipliable (s : Finset β) (f : β → α) :
    Multipliable (f ∘ (↑) : (↑s : Set β) → α)

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


lemma AnalyticWithinAt.congr_of_eventuallyEq [CompleteSpace F] {f g : E → F} {s : Set E} {x : E}
    (hf : AnalyticWithinAt 𝕜 f s x) (hs : f =ᶠ[𝓝[s] x] g) (hx : f x = g x) :
    AnalyticWithinAt 𝕜 g s x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f g : E → F}
{s : Set E}
{x : E}
(hf : AnalyticWithinAt 𝕜 f s x)
(hs : f =ᶠ[𝓝[s] x] g)
(hx : f x = g x)


@[simp]
theorem hasFDerivWithinAt_pi' :
    HasFDerivWithinAt Φ Φ' s x ↔ ∀ i, HasFDerivWithinAt (fun x => Φ x i) ((proj i).comp Φ') s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{Φ : E → (i : ι) → F' i}
{Φ' : E →L[𝕜] (i : ι) → F' i}

HasFDerivWithinAt Φ Φ' s x ↔ ∀ (i : ι), HasFDerivWithinAt (fun x => Φ x i) ((ContinuousLinearMap.proj i).comp Φ') s x


@[simp, norm_cast]
theorem coe_smul {S : Type*} [Semiring S] [Module R S] (r : R) (x : PowerSeries S) :
    ((r • x : PowerSeries S) : LaurentSeries S) = r • (ofPowerSeries ℤ S x)

{R : Type u_1}
[Semiring R]
{S : Type u_3}
[Semiring S]
[Module R S]
(r : R)
(x : PowerSeries S)

(HahnSeries.ofPowerSeries ℤ S) (r • x) = r • (HahnSeries.ofPowerSeries ℤ S) x


@[simp] theorem getRight?_swap (x : α ⊕ β) : x.swap.getRight? = x.getLeft?

{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)


@[reassoc (attr := simp)]
lemma _root_.CategoryTheory.Iso.hom_inv_id_triangle_hom₂ {A B : Triangle C} (e : A ≅ B) :
    e.hom.hom₂ ≫ e.inv.hom₂ = 𝟙 _

{A B : CategoryTheory.Pretriangulated.Triangle C}


theorem fourierCoeffOn.const_smul {a b : ℝ} (f : ℝ → E) (c : ℂ) (n : ℤ) (hab : a < b) :
    fourierCoeffOn hab (c • f) n = c • fourierCoeffOn hab f n

{E : Type}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{a b : ℝ}
(f : ℝ → E)
(c : ℂ)
(n : ℤ)
(hab : a < b)


@[simp]
theorem coe_comp (f : BoundedOrderHom β γ) (g : BoundedOrderHom α β) : (f.comp g : α → γ) = f ∘ g

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


theorem exists_forall_pow_toEnd_eq_zero [hM : IsNilpotent R L M] :
    ∃ k : ℕ, ∀ x : L, toEnd R L M x ^ k = 0

(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]
[hM : LieModule.IsNilpotent R L M]

∃ k, ∀ (x : L), (LieModule.toEnd R L M) x ^ k = 0


/-- **Weighted Hölder inequality**. -/
lemma inner_le_weight_mul_Lp (s : Finset ι) {p : ℝ} (hp : 1 ≤ p) (w f : ι → ℝ≥0) :
    ∑ i ∈ s, w i * f i ≤ (∑ i ∈ s, w i) ^ (1 - p⁻¹) * (∑ i ∈ s, w i * f i ^ p) ^ p⁻¹

{ι : Type u}
(s : Finset ι)
{p : ℝ}
(hp : 1 ≤ p)
(w f : ι → ℝ≥0)


theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α]
    [SuccOrder α] : DiscreteTopology α ↔ OrderTopology α

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[PredOrder α]
[SuccOrder α]


theorem bind_congr {s1 s2 : Computation α} {f1 f2 : α → Computation β} (h1 : s1 ~ s2)
    (h2 : ∀ a, f1 a ~ f2 a) : bind s1 f1 ~ bind s2 f2

{α : Type u}
{β : Type v}
{s1 s2 : Computation α}
{f1 f2 : α → Computation β}
(h1 : s1.Equiv s2)
(h2 : ∀ (a : α), (f1 a).Equiv (f2 a))


@[simp]
theorem exists_length_eq_zero_iff {u v : V} : (∃ p : G.Walk u v, p.length = 0) ↔ u = v

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


@[to_additive]
theorem orderOf_le_card_univ [Fintype G] : orderOf x ≤ Fintype.card G

{G : Type u_1}
[AddMonoid G]
{x : G}
[Fintype G]


theorem lpTrimToLpMeasSubgroup_ae_eq (hm : m ≤ m0) (f : Lp F p (μ.trim hm)) :
    lpTrimToLpMeasSubgroup F p μ hm f =ᵐ[μ] f

(f : ↥(MeasureTheory.Lp F p (μ.trim hm)))

↑↑↑(MeasureTheory.lpTrimToLpMeasSubgroup F p μ hm f) =ᵐ[μ] ↑↑f


private theorem _root_.Nat.mod_eq_sub_of_lt_two_mul {x n} (h₁ : n ≤ x) (h₂ : x < 2 * n) :
    x % n = x - n

{x n : Nat}
(h₁ : n ≤ x)
(h₂ : x < 2 * n)


@[reassoc (attr := simp)]
theorem mapMono_comp (i' : Δ'' ⟶ Δ') (i : Δ' ⟶ Δ) [Mono i'] [Mono i] :
    mapMono K i ≫ mapMono K i' = mapMono K (i' ≫ i)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(K : ChainComplex C ℕ)
{Δ Δ' Δ'' : SimplexCategory}
(i' : Δ'' ⟶ Δ')
(i : Δ' ⟶ Δ)
[CategoryTheory.Mono i']
[CategoryTheory.Mono i]

AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i ≫ AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i' =
  AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K (i' ≫ i)


theorem decompose'_apply [DecidableEq M] (φ : MvPolynomial σ R) (m : M) :
    (decompose' R w φ m : MvPolynomial σ R) = weightedHomogeneousComponent w m φ

(R : Type u_1)
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
(w : σ → M)
[AddCommMonoid M]
[DecidableEq M]
(φ : MvPolynomial σ R)
(m : M)

↑((MvPolynomial.decompose' R w φ) m) = (MvPolynomial.weightedHomogeneousComponent w m) φ


theorem ContDiff.exp {n} (hf : ContDiff ℝ n f) : ContDiff ℝ n fun x => Real.exp (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
(hf : ContDiff ℝ n f)


theorem map_neg {f : M → M₂} (lin : IsLinearMap R f) (x : M) : f (-x) = -f x

{R : Type u_1}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R M₂]
{f : M → M₂}
(lin : IsLinearMap R f)
(x : M)


theorem eval_range {ι : Type*} [Finite ι] (b : Basis ι R M) :
    LinearMap.range (Dual.eval R M) = ⊤

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
{ι : Type u_1}
[Finite ι]
(b : Basis ι R M)

LinearMap.range (Module.Dual.eval R M) = ⊤


/-- Change a cocone on `F : Jᵒᵖ ⥤ Cᵒᵖ` into a cone on `F.unop : J ⥤ C`. -/
@[simps]
def coneUnopOfCocone (c : Cocone F) : Cone F.unop

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : Jᵒᵖ ⥤ Cᵒᵖ}
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.coneUnopOfCocone c).pt = Opposite.unop c.pt


/-- To show a property of all powers of `g` it suffices to show it is closed under multiplication
by `g` and `g⁻¹` on the right. For subgroups generated by more than one element, see
`Subgroup.closure_induction_right`. -/
@[to_additive "To show a property of all multiples of `g` it suffices to show it is closed under
addition by `g` and `-g` on the right. For additive subgroups generated by more than one element,
see `AddSubgroup.closure_induction_right`."]
lemma zpow_induction_right {g : G} {P : G → Prop} (h_one : P (1 : G))
    (h_mul : ∀ a, P a → P (a * g)) (h_inv : ∀ a, P a → P (a * g⁻¹)) (n : ℤ) : P (g ^ n)

{G : Type u_3}
[Group G]
{g : G}
{P : G → Prop}
(h_one : P 1)
(h_mul : ∀ (a : G), P a → P (a * g))
(h_inv : ∀ (a : G), P a → P (a * g⁻¹))
(n : ℤ)


theorem IsLeast.isLeast_iff_eq (Ha : IsLeast s a) : IsLeast s b ↔ a = b

{α : Type u}
[PartialOrder α]
{s : Set α}
{a b : α}
(Ha : IsLeast s a)


theorem unop_sSup (S : Set (Subsemiring Rᵐᵒᵖ)) : (sSup S).unop = sSup (.op ⁻¹' S)

{R : Type u_2}
[NonAssocSemiring R]
(S : Set (Subsemiring Rᵐᵒᵖ))

(sSup S).unop = sSup (Subsemiring.op ⁻¹' S)


theorem tangentCone_univ : tangentConeAt 𝕜 univ x = univ

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


lemma topology_eq : ‹_› = scottHausdorff α

(α : Type u_1)
[Preorder α]
[TopologicalSpace α]
[Topology.IsScottHausdorff α]


@[simp]
theorem empty_subset (s : Set α) : ∅ ⊆ s


theorem swap_dist : Function.swap (@dist α _) = dist


theorem gcd_eq_zero_iff {i j : ℤ} : gcd i j = 0 ↔ i = 0 ∧ j = 0


@[simp] theorem ofExistsFiniteBase_base (E : Set α) Base exists_finite_base
    base_exchange subset_ground : (Matroid.ofExistsFiniteBase
      E Base exists_finite_base base_exchange subset_ground).Base = Base

(exists_finite_base : ∃ B, Base B ∧ B.Finite)

(base_exchange : Matroid.ExchangeProperty Base)

(subset_ground : ∀ (B : Set α), Base B → B ⊆ E)


@[simp] lemma exp_eq_zero_iff {x : EReal} : exp x = 0 ↔ x = ⊥


theorem norm_map_le (hf : ψ.comp f₁ = f₂.comp φ) (hg : ψ.comp g₁ = g₂.comp φ) (C : ℝ)
    (hφ : ‖φ.comp (ι f₁ g₁)‖ ≤ C) : ‖map φ ψ hf hg‖ ≤ C

(hφ : ‖φ.comp (NormedAddGroupHom.Equalizer.ι f₁ g₁)‖ ≤ C)

‖NormedAddGroupHom.Equalizer.map φ ψ hf hg‖ ≤ C


@[simp]
theorem IsHermitian.sub {A B : Matrix n n α} (hA : A.IsHermitian) (hB : B.IsHermitian) :
    (A - B).IsHermitian

{α : Type u_1}
{n : Type u_4}
[AddGroup α]
[StarAddMonoid α]
{A B : Matrix n n α}
(hA : A.IsHermitian)
(hB : B.IsHermitian)


theorem eq_of_dvd_of_natDegree_le_of_leadingCoeff {p q : R[X]} (hpq : p ∣ q)
    (h₁ : q.natDegree ≤ p.natDegree) (h₂ : p.leadingCoeff = q.leadingCoeff) :
    p = q

{R : Type u}
[CommRing R]
[IsDomain R]
{p q : R[X]}
(hpq : p ∣ q)
(h₁ : q.natDegree ≤ p.natDegree)
(h₂ : p.leadingCoeff = q.leadingCoeff)


@[to_additive]
lemma _root_.MeasurableSet.mul_closure_one_eq {s : Set G} (hs : MeasurableSet s) :
    s * (closure {1} : Set G) = s

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
[Group G]
[TopologicalGroup G]
{s : Set G}
(hs : MeasurableSet s)


/-- Given an orthogonal basis with respect to a bilinear map, the bilinear map is left-separating if
the basis has no elements which are self-orthogonal. -/
theorem IsOrthoᵢ.separatingLeft_of_not_isOrtho_basis_self [NoZeroSMulDivisors R M₁]
    {B : M →ₗ[R] M →ₗ[R] M₁} (v : Basis n R M) (hO : B.IsOrthoᵢ v)
    (h : ∀ i, ¬B.IsOrtho (v i) (v i)) : B.SeparatingLeft

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
{n : Type u_19}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
[NoZeroSMulDivisors R M₁]
{B : M →ₗ[R] M →ₗ[R] M₁}
(v : Basis n R M)
(hO : B.IsOrthoᵢ ⇑v)
(h : ∀ (i : n), ¬B.IsOrtho (v i) (v i))


/-- If we (perhaps unintentionally) perform equational rewriting on
the source object of a morphism,
we can replace the resulting `_.mpr f` term by a composition with an `eqToHom`.

It may be advisable to introduce any necessary `eqToHom` morphisms manually,
rather than relying on this lemma firing.
-/
theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟶ Z) :
    (congrArg (fun W : C => W ⟶ Z) p).mpr q = eqToHom p ≫ q

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

⋯.mpr q = CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom p) q


protected theorem covBy_iff_succ_eq {m n : ℕ} : m ⋖ n ↔ m + 1 = n


/-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `L` is
    naturally isomorphic to the identity functor. -/
@[simps!]
def mapLeftId : mapLeft R (𝟙 L) ≅ 𝟭 _

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

((CategoryTheory.Comma.mapLeftId L R).hom.app X).left = CategoryTheory.CategoryStruct.id X.left