/-- Product of two continuous homomorphisms on different spaces. -/
@[to_additive (attr := simps!) "Product of two continuous homomorphisms on different spaces."]
def prod_map (f : ContinuousMonoidHom A C) (g : ContinuousMonoidHom B D) :
    ContinuousMonoidHom (A × B) (C × D)

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
{D : Type u_5}
[Monoid A]
[Monoid B]
[Monoid C]
[Monoid D]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
[TopologicalSpace D]
(f : ContinuousMonoidHom A C)
(g : ContinuousMonoidHom B D)
(i : A × B)

(f.prod_map g) i = (f.toMonoidHom i.1, g.toMonoidHom i.2)


@[to_additive (attr := simp)]
theorem OneHom.coe_coe [OneHomClass F M N] (f : F) :
    ((f : OneHom M N) : M → N) = f

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[One M]
[One N]
[FunLike F M N]
[OneHomClass F M N]
(f : F)


theorem map {H : Subgroup G} (hH : IsPGroup p H) {K : Type*} [Group K] (ϕ : G →* K) :
    IsPGroup p (H.map ϕ)

{p : ℕ}
{G : Type u_1}
[Group G]
{H : Subgroup G}
(hH : IsPGroup p ↥H)
{K : Type u_2}
[Group K]
(ϕ : G →* K)


/-- An analytic set is a set which is the continuous image of some Polish space. There are several
equivalent characterizations of this definition. For the definition, we pick one that avoids
universe issues: a set is analytic if and only if it is a continuous image of `ℕ → ℕ` (or if it
is empty). The above more usual characterization is given
in `analyticSet_iff_exists_polishSpace_range`.

Warning: these are analytic sets in the context of descriptive set theory (which is why they are
registered in the namespace `MeasureTheory`). They have nothing to do with analytic sets in the
context of complex analysis. -/
irreducible_def AnalyticSet (s : Set α) : Prop

{α : Type u_3}
[TopologicalSpace α]
(s : Set α)

MeasureTheory.AnalyticSet s = (s = ∅ ∨ ∃ f, Continuous f ∧ Set.range f = s)


@[simp] theorem ofNat_zero : ofNat 0 = 0


/-- The isomorphism `S₁.sc _ i ≅ S₂.sc _ i` induced by an isomorphism `S₁ ≅ S₂`
in `ComposableArrows C n`. -/
@[simps]
def scMapIso {S₁ S₂ : ComposableArrows C n} (e : S₁ ≅ S₂)
    (h₁ : S₁.IsComplex) (h₂ : S₂.IsComplex)
    (i : ℕ) (hi : i + 2 ≤ n := by omega) :
    S₁.sc h₁ i ≅ S₂.sc h₂ i

{S₁ S₂ : CategoryTheory.ComposableArrows C n}

(CategoryTheory.ComposableArrows.scMapIso e h₁ h₂ i hi).hom = CategoryTheory.ComposableArrows.scMap e.hom h₁ h₂ i ⋯


lemma trace_eq_sum_trace_restrict' (hN : {i | N i ≠ ⊥}.Finite)
    {f : M →ₗ[R] M} (hf : ∀ i, MapsTo f (N i) (N i)) :
    trace R M f = ∑ i ∈ hN.toFinset, trace R (N i) (f.restrict (hf i))

(hf : ∀ (i : ι), Set.MapsTo ⇑f ↑(N i) ↑(N i))

(LinearMap.trace R M) f = ∑ i ∈ hN.toFinset, (LinearMap.trace R ↥(N i)) (f.restrict ⋯)


/-- The trace of the identity endomorphism is the dimension of the free module -/
@[simp]
theorem trace_id : trace R M id = (finrank R M : R)

(R : Type u_1)
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]

(LinearMap.trace R M) LinearMap.id = ↑(FiniteDimensional.finrank R M)


/--
If `a₀ -r→ a₁ -r→ ... -r→ aₙ` and `b₀ -r→ b₁ -r→ ... -r→ bₘ` are two strict series
such that `r aₙ b₀`, then there is a chain of length `n + m + 1` given by
`a₀ -r→ a₁ -r→ ... -r→ aₙ -r→ b₀ -r→ b₁ -r→ ... -r→ bₘ`.
-/
@[simps length]
def append (p q : RelSeries r) (connect : r p.last q.head) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(p q : RelSeries r)
(connect : r p.last q.head)

(p.append q connect).length = p.length + q.length + 1


theorem rotate_rotate : rotate (rotate v j) k = rotate v (j + k)

(v : ↑(Equiv.Perm.vectorsProdEqOne G n))

Equiv.Perm.VectorsProdEqOne.rotate (Equiv.Perm.VectorsProdEqOne.rotate v j) k =
  Equiv.Perm.VectorsProdEqOne.rotate v (j + k)


@[simp]
theorem toFinset_diff [Fintype (s \ t : Set _)] : (s \ t).toFinset = s.toFinset \ t.toFinset

{α : Type u_1}
(s t : Set α)
[DecidableEq α]
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(s \ t)]


@[simp]
theorem bihimp_bihimp_cancel_right : b ⇔ a ⇔ a = b

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


theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil


@[simp]
theorem totalSpaceMk_preimage_source (b : B) :
    .mk b ⁻¹' (a.pretrivializationAt b).source = univ

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
{E : B → Type u_4}
[NontriviallyNormedField R]
[(x : B) → AddCommMonoid (E x)]
[(x : B) → Module R (E x)]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
[(x : B) → TopologicalSpace (E x)]
(a : VectorPrebundle R F E)
(b : B)

Bundle.TotalSpace.mk b ⁻¹' (a.pretrivializationAt b).source = Set.univ


theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞

{η : ProbabilityTheory.Kernel (α × β) γ}

∀ᵐ (b : β) ∂κ a, (η (a, b)) (Prod.mk b ⁻¹' s) < ⊤


theorem term_neg {α} [AddCommGroup α] (n x a n' a')
    (h₁ : -n = n') (h₂ : -a = a') : -@termg α _ n x a = termg n' x a'

{α : Type u_1}
[AddCommGroup α]
(n : ℤ)
(x a : α)
(n' : ℤ)
(a' : α)
(h₁ : -n = n')
(h₂ : -a = a')

-Mathlib.Tactic.Abel.termg n x a = Mathlib.Tactic.Abel.termg n' x a'


theorem of_hasFiniteLimits [HasFiniteLimits C] : IsCofiltered C


lemma map_toTriangle_disjoint [ExplicitDisjoint t] :
    (t.map toTriangle : Set (Finset (α ⊕ β ⊕ γ))).Pairwise
      fun x y ↦ (x ∩ y : Set (α ⊕ β ⊕ γ)).Subsingleton

(↑(Finset.map SimpleGraph.TripartiteFromTriangles.toTriangle t)).Pairwise fun x y => (↑x ∩ ↑y).Subsingleton


@[simp]
theorem roots_monomial (ha : a ≠ 0) (n : ℕ) : (monomial n a).roots = n • ({0} : Multiset R)

{R : Type u}
{a : R}
[CommRing R]
[IsDomain R]
(ha : a ≠ 0)
(n : ℕ)

((Polynomial.monomial n) a).roots = n • {0}


lemma nmem_nonZeroDivisors_iff {r : M} : r ∉ M⁰ ↔ {s | s * r = 0 ∧ s ≠ 0}.Nonempty

{M : Type u_2}
[MonoidWithZero M]
{r : M}


/-- An L¹-bounded submartingale converges almost everywhere. -/
theorem Submartingale.exists_ae_tendsto_of_bdd [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hbdd : ∀ n, eLpNorm (f n) 1 μ ≤ R) : ∀ᵐ ω ∂μ, ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c)

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ (n : ℕ), MeasureTheory.eLpNorm (f n) 1 μ ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, ∃ c, Filter.Tendsto (fun n => f n ω) Filter.atTop (𝓝 c)


theorem essSup_map_measure_of_measurable (hg : Measurable g) (hf : AEMeasurable f μ) :
    essSup g (Measure.map f μ) = essSup (g ∘ f) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[CompleteLattice β]
{γ : Type u_3}
{mγ : MeasurableSpace γ}
{f : α → γ}
{g : γ → β}
[MeasurableSpace β]
[TopologicalSpace β]
[SecondCountableTopology β]
[OrderClosedTopology β]
[OpensMeasurableSpace β]
(hg : Measurable g)
(hf : AEMeasurable f μ)

essSup g (MeasureTheory.Measure.map f μ) = essSup (g ∘ f) μ


@[simp]
theorem comap_apply (f : V ↪ W) (G : SimpleGraph W) (v : V) :
    SimpleGraph.Embedding.comap f G v = f v

{V : Type u_1}
{W : Type u_2}
(f : V ↪ W)
(G : SimpleGraph W)
(v : V)

(SimpleGraph.Embedding.comap f G) v = f v


theorem sUnion_iUnion (s : ι → Set (Set α)) : ⋃₀⋃ i, s i = ⋃ i, ⋃₀s i

{α : Type u_1}
{ι : Sort u_4}
(s : ι → Set (Set α))


/-- If the order of a formal power series is finite,
then the coefficient indexed by the order is nonzero. -/
theorem coeff_order (h : (order φ).Dom) : coeff R (φ.order.get h) φ ≠ 0

{R : Type u_1}
[Semiring R]
{φ : PowerSeries R}
(h : φ.order.Dom)

(PowerSeries.coeff R (φ.order.get h)) φ ≠ 0


/-- `HeytingHomClass F α β` states that `F` is a type of Heyting homomorphisms.

You should extend this class when you extend `HeytingHom`. -/
class HeytingHomClass (F α β : Type*) [HeytingAlgebra α] [HeytingAlgebra β] [FunLike F α β]
  extends LatticeHomClass F α β : Prop where
  /-- The proposition that a Heyting homomorphism preserves the bottom element. -/
  map_bot (f : F) : f ⊥ = ⊥
  /-- The proposition that a Heyting homomorphism preserves the Heyting implication. -/
  map_himp (f : F) : ∀ a b, f (a ⇨ b) = f a ⇨ f b

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[HeytingAlgebra α]
[HeytingAlgebra β]
[FunLike F α β]
[self : HeytingHomClass F α β]
(f : F)
(a b : α)


theorem inv_le_one (ha : 1 ≤ a) : a⁻¹ ≤ 1

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(ha : 1 ≤ a)


@[simp]
theorem toDFinsupp_lt_toDFinsupp : toDFinsupp s < toDFinsupp t ↔ s < t

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

Multiset.toDFinsupp s < Multiset.toDFinsupp t ↔ s < t


@[simp] theorem ofInt_natCast (w n : Nat) :
  BitVec.ofInt w (n : Int) = BitVec.ofNat w n


/-- Note that the identity satisfies `IsCycleOn` for any subsingleton set, but not `IsCycle`. -/
theorem IsCycleOn.isCycle_subtypePerm (hf : f.IsCycleOn s) (hs : s.Nontrivial) :
    (f.subtypePerm fun _ => hf.apply_mem_iff.symm : Perm s).IsCycle

{α : Type u_2}
{f : Equiv.Perm α}
{s : Set α}
(hf : f.IsCycleOn s)
(hs : s.Nontrivial)


theorem isOpen_support : IsOpen (support f)

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)


/-- A subsemigroup is closed under multiplication. -/
@[to_additive "An `AddSubsemigroup` is closed under addition."]
protected theorem mul_mem {x y : M} : x ∈ S → y ∈ S → x * y ∈ S

{M : Type u_1}
[Mul M]
(S : Subsemigroup M)
{x y : M}


@[to_additive]
theorem closure_eq_image_prod (s : Set M) :
    (closure s : Set M) = List.prod '' { l : List M | ∀ x ∈ l, x ∈ s }

{M : Type u_1}
[AddMonoid M]
(s : Set M)

↑(AddSubmonoid.closure s) = List.sum '' {l | ∀ x ∈ l, x ∈ s}


theorem natAbs_inj_of_nonpos_of_nonneg {a b : ℤ} (ha : a ≤ 0) (hb : 0 ≤ b) :
    natAbs a = natAbs b ↔ -a = b


private lemma isCoprime_x_y : IsCoprime S.x S.y

(S : FermatLastTheoremForThreeGen.Solution hζ)

IsCoprime (FermatLastTheoremForThreeGen.Solution.x S) (FermatLastTheoremForThreeGen.Solution.y S)


protected theorem gen_mem_nhds (f : α →ᵤ[𝔖] β) (hs : s ∈ 𝔖) {V : Set (β × β)} (hV : V ∈ 𝓤 β) :
    {g | ∀ x ∈ s, (toFun 𝔖 f x, toFun 𝔖 g x) ∈ V} ∈ 𝓝 f

{α : Type u_1}
(β : Type u_2)
{s : Set α}
[UniformSpace β]
(𝔖 : Set (Set α))
(f : α →ᵤ[𝔖] β)
(hs : s ∈ 𝔖)
{V : Set (β × β)}
(hV : V ∈ 𝓤 β)

{g | ∀ x ∈ s, ((UniformOnFun.toFun 𝔖) f x, (UniformOnFun.toFun 𝔖) g x) ∈ V} ∈ 𝓝 f


/--
If `k` is omitted from the set, its Schnirelmann density is upper bounded by `1 - k⁻¹`.
-/
lemma schnirelmannDensity_le_of_not_mem {k : ℕ} (hk : k ∉ A) :
    schnirelmannDensity A ≤ 1 - (k⁻¹ : ℝ)

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
{k : ℕ}
(hk : k ∉ A)


theorem extract_empty_of_stop_le_start (as : Array α) {start stop : Nat} (h : stop ≤ start) :
    as.extract start stop = #[]

{α : Type u_1}
(as : Array α)
{start stop : Nat}
(h : stop ≤ start)


theorem memℒp_top_const (c : E) : Memℒp (fun _ : α => c) ∞ μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(c : E)


/-- If a function is polynomial on a set `s`, so is its derivative. -/
protected theorem CPolynomialOn.deriv (h : CPolynomialOn 𝕜 f s) : CPolynomialOn 𝕜 (deriv f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{s : Set 𝕜}
(h : CPolynomialOn 𝕜 f s)


@[to_additive]
theorem CancelMonoid.toLeftCancelMonoid_injective {M : Type u} :
    Function.Injective (@CancelMonoid.toLeftCancelMonoid M)


@[simp]
theorem limLax_ε :
    (@limLax J _ C _ _ _).ε =
      limit.lift _
        { pt := _
          π := { app := fun j => 𝟙 _ } }

CategoryTheory.Limits.limLax.ε =
  CategoryTheory.Limits.limit.lift ((CategoryTheory.Functor.const J).obj (𝟙_ C))
    { pt := 𝟙_ C, π := { app := fun j => 𝟙 (((CategoryTheory.Functor.const J).obj (𝟙_ C)).obj j), naturality := ⋯ } }


/-- A side of a right-angled triangle divided by the sine of the opposite angle equals the
hypotenuse. -/
theorem dist_div_sin_oangle_right_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P}
    (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) : dist p₁ p₂ / Real.Angle.sin (∡ p₂ p₃ p₁) = dist p₁ p₃

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

dist p₁ p₂ / (∡ p₂ p₃ p₁).sin = dist p₁ p₃


theorem Squarefree.of_mul_left [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) : Squarefree m

{R : Type u_1}
[CommMonoid R]
{m n : R}
(hmn : Squarefree (m * n))


@[simp]
theorem getElem?_scanl_zero : (scanl f b l)[0]? = some b

{α : Type u}
{β : Type v}
{f : β → α → β}
{b : β}
{l : List α}


@[simp]
theorem eval_one_cyclotomic_prime {R : Type*} [CommRing R] {p : ℕ} [hn : Fact p.Prime] :
    eval 1 (cyclotomic p R) = p

{R : Type u_1}
[CommRing R]
{p : ℕ}
[hn : Fact (Nat.Prime p)]

Polynomial.eval 1 (Polynomial.cyclotomic p R) = ↑p


/-- The `IndepMatroid` whose independent sets are the independent subsets of `R`. -/
@[simps] def restrictIndepMatroid (M : Matroid α) (R : Set α) : IndepMatroid α

{α : Type u_1}
(M : Matroid α)
(R I : Set α)

(M.restrictIndepMatroid R).Indep I = (M.Indep I ∧ I ⊆ R)


theorem Nonempty.smul_zero (hs : s.Nonempty) : s • (0 : Finset β) = 0

{α : Type u_2}
{β : Type u_3}
[Zero β]
[SMulZeroClass α β]
[DecidableEq β]
{s : Finset α}
(hs : s.Nonempty)


/-- The distance between two points given with `affineCombination`,
in terms of the pairwise distances between the points in that
combination. -/
theorem dist_affineCombination {ι : Type*} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P)
    (h₁ : ∑ i ∈ s, w₁ i = 1) (h₂ : ∑ i ∈ s, w₂ i = 1) : by
      have a₁ := s.affineCombination ℝ p w₁
      have a₂ := s.affineCombination ℝ p w₂
      exact dist a₁ a₂ * dist a₁ a₂ = (-∑ i₁ ∈ s, ∑ i₂ ∈ s,
        (w₁ - w₂) i₁ * (w₁ - w₂) i₂ * (dist (p i₁) (p i₂) * dist (p i₁) (p i₂))) / 2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{ι : Type u_3}
{s : Finset ι}
{w₁ w₂ : ι → ℝ}
(p : ι → P)
(h₁ : ∑ i ∈ s, w₁ i = 1)
(h₂ : ∑ i ∈ s, w₂ i = 1)

let_fun a₁ := (Finset.affineCombination ℝ s p) w₁;
let_fun a₂ := (Finset.affineCombination ℝ s p) w₂;
dist a₁ a₂ * dist a₁ a₂ =
  (-∑ i₁ ∈ s, ∑ i₂ ∈ s, (w₁ - w₂) i₁ * (w₁ - w₂) i₂ * (dist (p i₁) (p i₂) * dist (p i₁) (p i₂))) / 2


@[simp]
theorem find_eq_one : PNat.find h = 1 ↔ p 1

{p : ℕ+ → Prop}
[DecidablePred p]
(h : ∃ n, p n)


theorem HasDerivWithinAt.comp_hasFDerivWithinAt {f : E → 𝕜'} {f' : E →L[𝕜] 𝕜'} {s t} (x)
    (hh : HasDerivWithinAt h₂ h₂' t (f x)) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t) :
    HasFDerivWithinAt (h₂ ∘ f) (h₂' • f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h₂ : 𝕜' → 𝕜'}
{h₂' : 𝕜'}
{f : E → 𝕜'}
{f' : E →L[𝕜] 𝕜'}
{s : Set E}
{t : Set 𝕜'}
(x : E)
(hh : HasDerivWithinAt h₂ h₂' t (f x))
(hf : HasFDerivWithinAt f f' s x)
(hst : Set.MapsTo f s t)


theorem sin_add_int_mul_pi (x : ℝ) (n : ℤ) : sin (x + n * π) = (-1) ^ n * sin x

Real.sin (x + ↑n * Real.pi) = (-1) ^ n * Real.sin x


/-- The Fourier transform satisfies `∫ 𝓕 f * g = ∫ f * 𝓕 g`, i.e., it is self-adjoint.
Version where the multiplication is replaced by a general bilinear form `M`. -/
theorem integral_bilin_fourierIntegral_eq_flip
    {f : V → E} {g : W → F} (M : E →L[ℂ] F →L[ℂ] G) (he : Continuous e)
    (hL : Continuous fun p : V × W ↦ L p.1 p.2) (hf : Integrable f μ) (hg : Integrable g ν) :
    ∫ ξ, M (fourierIntegral e μ L f ξ) (g ξ) ∂ν =
      ∫ x, M (f x) (fourierIntegral e ν L.flip g x) ∂μ

{𝕜 : Type u_1}
[CommRing 𝕜]
{V : Type u_2}
[AddCommGroup V]
[Module 𝕜 V]
[MeasurableSpace V]
{W : Type u_3}
[AddCommGroup W]
[Module 𝕜 W]
{E : Type u_4}
{F : Type u_5}
{G : Type u_6}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[NormedAddCommGroup F]
[NormedSpace ℂ F]
[NormedAddCommGroup G]
[NormedSpace ℂ G]
[TopologicalSpace 𝕜]
[TopologicalRing 𝕜]
[TopologicalSpace V]
[BorelSpace V]
[TopologicalSpace W]
[MeasurableSpace W]
[BorelSpace W]
{e : AddChar 𝕜 ↥𝕊}
{μ : MeasureTheory.Measure V}
{L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜}
{ν : MeasureTheory.Measure W}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
[SecondCountableTopology V]
[CompleteSpace E]
[CompleteSpace F]
{f : V → E}
{g : W → F}
(M : E →L[ℂ] F →L[ℂ] G)
(he : Continuous ⇑e)
(hL : Continuous fun p => (L p.1) p.2)
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g ν)

∫ (ξ : W), (M (VectorFourier.fourierIntegral e μ L f ξ)) (g ξ) ∂ν =
  ∫ (x : V), (M (f x)) (VectorFourier.fourierIntegral e ν L.flip g x) ∂μ


lemma mk_point {P : PointClass R} (h : W'.NonsingularLift P) : (mk h).point = P

{P : WeierstrassCurve.Jacobian.PointClass R}

(WeierstrassCurve.Jacobian.Point.mk h).point = P


/-- Given `F : SingleFunctors C D A`, and a functor `G : D ⥤ E` which commutes
with the shift by `A`, this is the "composition" of `F` and `G` in `SingleFunctors C E A`. -/
@[simps! functor shiftIso_hom_app shiftIso_inv_app]
def postcomp (G : D ⥤ E) [G.CommShift A] :
    SingleFunctors C E A

(F : CategoryTheory.SingleFunctors C D A)

(F.postcomp G).functor a = F.functor a ⋙ G


/-- If `I` is initial, then `I ⨯ X` is isomorphic to it. -/
@[simps! hom]
noncomputable def isInitialMul (X : C) [HasBinaryProduct I X] (hI : IsInitial I) : I ⨯ X ≅ I

(hI : CategoryTheory.Limits.IsInitial I)

(CategoryTheory.Limits.isInitialMul X hI).hom = CategoryTheory.Limits.prod.fst


@[simp]
theorem inf_inf_sdiff (x y : α) : x ⊓ y ⊓ x \ y = ⊥

{α : Type u}
[GeneralizedBooleanAlgebra α]
(x y : α)


@[simp, norm_cast]
theorem coe_pow (r : ℝ≥0) (n : ℕ) : ((r ^ n : ℝ≥0) : ℝ) = (r : ℝ) ^ n


lemma exists_fin' [Finite R M] : ∃ (n : ℕ) (f : (Fin n → R) →ₗ[R] M), Surjective f

(R : Type u_1)
(M : Type u_4)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Module.Finite R M]


theorem ConcaveOn.right_le_of_le_left (hf : ConcaveOn 𝕜 s f) {x y z : E} (hx : x ∈ s) (hy : y ∈ s)
    (hz : z ∈ openSegment 𝕜 x y) (hxz : f z ≤ f x) : f y ≤ f z

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
{x y z : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hz : z ∈ openSegment 𝕜 x y)
(hxz : f z ≤ f x)


theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k ℓ μ) :
    (G.neighborFinset v ∪ G.neighborFinset w).card =
      2 * k - Fintype.card (G.commonNeighbors v w)

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

(G.neighborFinset v ∪ G.neighborFinset w).card = 2 * k - Fintype.card ↑(G.commonNeighbors v w)


@[to_additive]
theorem inv_subset : s⁻¹ ⊆ t ↔ s ⊆ t⁻¹

{α : Type u_2}
[InvolutiveInv α]
{s t : Set α}

s⁻¹ ⊆ t ↔ s ⊆ t⁻¹


theorem _root_.Order.Ideal.PrimePair.F_isPrime (IF : Ideal.PrimePair P) : IsPrime IF.F

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


/-- The identity morphism of a snake input. -/
@[simps]
def id : Hom S S

(S : CategoryTheory.ShortComplex.SnakeInput C)

(CategoryTheory.ShortComplex.SnakeInput.Hom.id S).f₃ = CategoryTheory.CategoryStruct.id S.L₃


/-- The adjoint is maximal in the sense that it contains every formal adjoint. -/
theorem IsFormalAdjoint.le_adjoint (h : T.IsFormalAdjoint S) : S ≤ T†

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
{T : E →ₗ.[𝕜] F}
{S : F →ₗ.[𝕜] E}
(hT : Dense ↑T.domain)
[CompleteSpace E]
(h : T.IsFormalAdjoint S)


theorem mul_add_left_left_iff {x y z : R} : IsRelPrime (y * z + x) y ↔ IsRelPrime x y


lemma W_iff_isLocallyBijective :
    J.W f ↔ Presheaf.IsLocallyInjective J f ∧ Presheaf.IsLocallySurjective J f

(J : CategoryTheory.GrothendieckTopology C)

J.W f ↔ CategoryTheory.Presheaf.IsLocallyInjective J f ∧ CategoryTheory.Presheaf.IsLocallySurjective J f


theorem le_smul_dedup [DecidableEq α] (s : Multiset α) : ∃ n : ℕ, s ≤ n • dedup s

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


@[simp] lemma mem_product : ∀ {p : α × β}, p ∈ @product α β s t ↔ p.1 ∈ s ∧ p.2 ∈ t

{α : Type u_1}
{β : Type v}
{s : Multiset α}
{t : Multiset β}
{p : α × β}


theorem Rat.normalize.den_nz {num : Int} {den g : Nat} (den_nz : den ≠ 0)
    (e : g = num.natAbs.gcd den) : den / g ≠ 0


@[simp]
theorem lTensorOne_symm_apply (n : N) : N.lTensorOne.symm n = 1 ⊗ₜ[R] n

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{N : Submodule R S}
(n : ↥N)


theorem image_update_segment (i : ι) (x₁ x₂ : π i) (y : ∀ i, π i) :
    update y i '' [x₁ -[𝕜] x₂] = [update y i x₁ -[𝕜] update y i x₂]

{𝕜 : Type u_1}
{ι : Type u_5}
{π : ι → Type u_6}
[OrderedSemiring 𝕜]
[(i : ι) → AddCommMonoid (π i)]
[(i : ι) → Module 𝕜 (π i)]
[DecidableEq ι]
(i : ι)
(x₁ x₂ : π i)
(y : (i : ι) → π i)

Function.update y i '' [x₁-[𝕜]x₂] = [Function.update y i x₁-[𝕜]Function.update y i x₂]


theorem leftUnitor_naturality {X Y : Dial C} (f : X ⟶ Y) :
    (𝟙 (𝟙_ (Dial C)) ⊗ f) ≫ (λ_ Y).hom = (λ_ X).hom ≫ f

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id (𝟙_ (CategoryTheory.Dial C))) f)
    (CategoryTheory.MonoidalCategory.leftUnitor Y).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor X).hom f


/-- Construct a pseudofunctor from a lax functor whose `mapId` and `mapComp` are isomorphisms. -/
@[simps!]
noncomputable def mkOfLax' (F : LaxFunctor B C) [∀ a, IsIso (F.mapId a)]
    [∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : Pseudofunctor B C

[∀ (a : B), CategoryTheory.IsIso (F.mapId a)]

[∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), CategoryTheory.IsIso (F.mapComp f g)]

(CategoryTheory.Pseudofunctor.mkOfLax' F).toPrelaxFunctor = F.toPrelaxFunctor


/-- The type of continuous maps which map zero to zero.

Note that one should never use the structure projection `ContinuousMapZero.toContinuousMap` and
instead favor the coercion `(↑) : C(X, R)₀ → C(X, R)` available from the instance of
`ContinuousMapClass`. All the instances on `C(X, R)₀` from `C(X, R)` passes through this coercion,
not the structure projection. Of course, the two are definitionally equal, but not reducibly so. -/
structure ContinuousMapZero (X R : Type*) [Zero X] [Zero R] [TopologicalSpace X]
    [TopologicalSpace R] extends C(X, R) where
  map_zero' : toContinuousMap 0 = 0

{X : Type u_1}
{R : Type u_2}
[Zero X]
[Zero R]
[TopologicalSpace X]
[TopologicalSpace R]
(self : ContinuousMapZero X R)


/-- The convolution is continuous if one function is integrable and the other is bounded and
continuous. -/
theorem _root_.BddAbove.continuous_convolution_right_of_integrable
    [FirstCountableTopology G] [SecondCountableTopologyEither G E']
    (hbg : BddAbove (range fun x => ‖g x‖)) (hf : Integrable f μ) (hg : Continuous g) :
    Continuous (f ⋆[L, μ] g)

(hbg : BddAbove (Set.range fun x => ‖g x‖))

Continuous (MeasureTheory.convolution f g L μ)


@[to_additive (attr := simp)]
lemma continuousOn_inv_iff : ContinuousOn f⁻¹ s ↔ ContinuousOn f s

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[InvolutiveNeg G]
[ContinuousNeg G]
[TopologicalSpace α]
{f : α → G}
{s : Set α}


protected theorem bijective (e : α ≃ β) : Bijective e


/-- Continuous functions are dense in `MeasureTheory.Lp`, `1 ≤ p < ∞`. This theorem assumes that
the domain is a compact space because otherwise `ContinuousMap.toLp` is undefined. Use
`BoundedContinuousFunction.toLp_denseRange` if the domain is not a compact space.  -/
theorem toLp_denseRange [CompactSpace α] [μ.WeaklyRegular] [IsFiniteMeasure μ] :
    DenseRange (toLp p μ 𝕜 : C(α, E) →L[𝕜] Lp E p μ)

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[MeasurableSpace α]
[BorelSpace α]
(E : Type u_2)
[NormedAddCommGroup E]
(μ : MeasureTheory.Measure α)
{p : ℝ≥0∞}
[SecondCountableTopologyEither α E]
[_i : Fact (1 ≤ p)]
(hp : p ≠ ⊤)
(𝕜 : Type u_3)
[NormedField 𝕜]
[NormedAlgebra ℝ 𝕜]
[NormedSpace 𝕜 E]
[CompactSpace α]
[μ.WeaklyRegular]
[MeasureTheory.IsFiniteMeasure μ]


theorem fast_fib_eq (n : ℕ) : fastFib n = fib n


@[simp]
theorem filter_sub [∀ i, AddGroup (β i)] (p : ι → Prop) [DecidablePred p] (f g : Π₀ i, β i) :
    (f - g).filter p = f.filter p - g.filter p

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddGroup (β i)]
(p : ι → Prop)
[DecidablePred p]
(f g : Π₀ (i : ι), β i)

DFinsupp.filter p (f - g) = DFinsupp.filter p f - DFinsupp.filter p g


/-- A vector is in the same ray as a positive multiple of itself. -/
lemma sameRay_pos_smul_right (v : M) (ha : 0 < a) : SameRay R v (a • v)

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{S : Type u_5}
[OrderedCommSemiring S]
[Algebra S R]
[Module S M]
[SMulPosMono S R]
[IsScalarTower S R M]
{a : S}
(v : M)
(ha : 0 < a)


theorem InjOn.comp (hg : InjOn g t) (hf : InjOn f s) (h : MapsTo f s t) : InjOn (g ∘ f) s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{f : α → β}
{g : β → γ}
(hg : Set.InjOn g t)
(hf : Set.InjOn f s)
(h : Set.MapsTo f s t)


theorem bitwise_diff : (bitwise fun a b => a && not b) = ldiff

(Int.bitwise fun a b => a && !b) = Int.ldiff


@[simp]
theorem Ioc_union_Ioo_eq_Ioo (h₁ : a ≤ b) (h₂ : b < c) : Ioc a b ∪ Ioo b c = Ioo a c

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(h₁ : a ≤ b)
(h₂ : b < c)


theorem succ_mul_succ_eq (a b : Nat) : succ a * succ b = a * b + a + b + 1


theorem eq_div_of_mul_eq_right {a b c : R} (ha : a ≠ 0) (h : a * b = c) : b = c / a

{R : Type u}
[EuclideanDomain R]
{a b c : R}
(ha : a ≠ 0)
(h : a * b = c)


theorem measurableSet_image (hf : MeasurableEmbedding f) :
    MeasurableSet (f '' s) ↔ MeasurableSet s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{mα : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
(hf : MeasurableEmbedding f)


theorem set_biUnion_coe (s : Finset α) (t : α → Set β) : ⋃ x ∈ (↑s : Set α), t x = ⋃ x ∈ s, t x

{α : Type u_2}
{β : Type u_3}
(s : Finset α)
(t : α → Set β)


theorem disjoint_atTop_principal_Iic [Preorder α] [NoMaxOrder α] (x : α) :
    Disjoint atTop (𝓟 (Iic x))

{α : Type u_3}
[Preorder α]
[NoMaxOrder α]
(x : α)


theorem exists_measurable_superset_iff_measure_eq_zero :
    (∃ t, s ⊆ t ∧ MeasurableSet t ∧ μ t = 0) ↔ μ s = 0

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


@[simp]
theorem adjugate_fin_one (A : Matrix (Fin 1) (Fin 1) α) : adjugate A = 1

{α : Type w}
[CommRing α]
(A : Matrix (Fin 1) (Fin 1) α)


@[higher_order snd_id]
theorem id_snd : ∀ {α β} (x : F α β), snd id x = x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[LawfulBifunctor F]
{α : Type u₀}
{β : Type u₁}


protected lemma existsUnique_congr' (h : ∀ b, p (e.symm b) ↔ q b) : (∃! a, p a) ↔ ∃! b, q b

{α : Sort u}
{β : Sort v}
{p : α → Prop}
{q : β → Prop}
(e : α ≃ β)
(h : ∀ (b : β), p (e.symm b) ↔ q b)


/-- The `DFinsupp` version of `Finsupp.comp_liftAddHom`,-/
theorem comp_liftAddHom {δ : Type*} [∀ i, AddZeroClass (β i)] [AddCommMonoid γ] [AddCommMonoid δ]
    (g : γ →+ δ) (f : ∀ i, β i →+ γ) :
    g.comp (liftAddHom (β := β) f) = liftAddHom (β := β) fun a => g.comp (f a)

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
{δ : Type u_1}
[(i : ι) → AddZeroClass (β i)]
[AddCommMonoid γ]
[AddCommMonoid δ]
(g : γ →+ δ)
(f : (i : ι) → β i →+ γ)

g.comp (DFinsupp.liftAddHom f) = DFinsupp.liftAddHom fun a => g.comp (f a)


lemma continuous_iff_from_nat {Y : Type*} [TopologicalSpace Y] (f : OnePoint ℕ → Y) :
    Continuous f ↔ Tendsto (fun x : ℕ ↦ f x) atTop (𝓝 (f ∞))

{Y : Type u_2}
[TopologicalSpace Y]
(f : OnePoint ℕ → Y)

Continuous f ↔ Filter.Tendsto (fun x => f ↑x) Filter.atTop (𝓝 (f OnePoint.infty))


theorem ball_inter_right (x : β) (V W : Set (β × β)) : ball x (V ∩ W) ⊆ ball x W

{β : Type ub}
(x : β)
(V W : Set (β × β))

UniformSpace.ball x (V ∩ W) ⊆ UniformSpace.ball x W


lemma isEquivalent_smoothingFn_sub_self (i : α) :
    (fun (n : ℕ) => ε (b i * n) - ε n) ~[atTop] fun n => -log (b i) / (log n)^2

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)
(i : α)

(fun n => AkraBazziRecurrence.smoothingFn (b i * ↑n) - AkraBazziRecurrence.smoothingFn ↑n) ~[Filter.atTop] fun n =>
  -Real.log (b i) / Real.log ↑n ^ 2


protected theorem wellFoundedLT [Preorder N] [WellFoundedLT N] (hbot : ∀ n : N, ¬n < 0) :
    WellFoundedLT (α →₀ N)

{α : Type u_1}
{N : Type u_2}
[Zero N]
[Preorder N]
[WellFoundedLT N]
(hbot : ∀ (n : N), ¬n < 0)


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.one_lt_mul_of_le_of_lt`. -/
@[to_additive Right.add_pos_of_nonneg_of_pos
"Assumes right covariance.
The lemma assuming left covariance is `Left.add_pos_of_nonneg_of_pos`."]
theorem Right.one_lt_mul_of_le_of_lt [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (ha : 1 ≤ a) (hb : 1 < b) :
    1 < a * b

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


theorem lift'_comp_uniformity : ((𝓤 α).lift' fun s : Set (α × α) => s ○ s) = 𝓤 α


theorem isBounded_image_subtype_val {p : α → Prop} {s : Set { x // p x }} :
    IsBounded (Subtype.val '' s) ↔ IsBounded s

{α : Type u_1}
[Bornology α]
{p : α → Prop}
{s : Set { x // p x }}

Bornology.IsBounded (Subtype.val '' s) ↔ Bornology.IsBounded s


theorem tsupport_subset_symm_image_closedBall :
    tsupport f ⊆ (extChartAt I c).symm '' (closedBall (extChartAt I c c) f.rOut ∩ range I)

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
[T2Space M]

tsupport ↑f ⊆ ↑(extChartAt I c).symm '' (Metric.closedBall (↑(extChartAt I c) c) f.rOut ∩ Set.range ↑I)


theorem cast_sub_one {R : Type*} [Ring R] {n : ℕ} (k : ZMod n) :
    (cast (k - 1 : ZMod n) : R) = (if k = 0 then (n : R) else cast k) - 1

{R : Type u_1}
[Ring R]
{n : ℕ}
(k : ZMod n)

(k - 1).cast = (if k = 0 then ↑n else k.cast) - 1


theorem squarefree_pow_iff {n k : ℕ} (hn : n ≠ 1) (hk : k ≠ 0) :
    Squarefree (n ^ k) ↔ Squarefree n ∧ k = 1


theorem dZero_ker_eq_invariants : LinearMap.ker (dZero A) = invariants A.ρ

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

LinearMap.ker (groupCohomology.dZero A) = A.ρ.invariants


theorem count_map {α β : Type*} (f : α → β) (s : Multiset α) [DecidableEq β] (b : β) :
    count b (map f s) = card (s.filter fun a => b = f a)

{α : Type u_3}
{β : Type u_4}
(f : α → β)
(s : Multiset α)
[DecidableEq β]
(b : β)

Multiset.count b (Multiset.map f s) = Multiset.card (Multiset.filter (fun a => b = f a) s)


theorem nodup_sublistsLen (n : ℕ) {l : List α} (h : Nodup l) : (sublistsLen n l).Nodup

{α : Type u}
(n : ℕ)
{l : List α}
(h : l.Nodup)


theorem mem_find (x : X) : x ∈ K (K.find x)

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(x : X)


/-- The torsion submodule is always a torsion module. -/
theorem torsion_isTorsion : Module.IsTorsion R (torsion R M)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]

Module.IsTorsion R ↥(Submodule.torsion R M)


lemma Monovary.pow_right₀ (hg : 0 ≤ g) (hfg : Monovary f g) (n : ℕ) : Monovary f (g ^ n)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
{f : ι → α}
{g : ι → β}
(hg : 0 ≤ g)
(hfg : Monovary f g)
(n : ℕ)


@[simp]
theorem normSq_neg : normSq (-a) = normSq a

Quaternion.normSq (-a) = Quaternion.normSq a


theorem lengthParity_simple (i : B) :
    cs.lengthParity (s i) = Multiplicative.ofAdd 1

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i : B)

cs.lengthParity (cs.simple i) = Multiplicative.ofAdd 1


@[simp]
theorem isCobounded_iInter [Finite ι] {f : ι → Set α} :
    IsCobounded (⋂ i, f i) ↔ ∀ i, IsCobounded (f i)

{ι : Type u_1}
{α : Type u_2}
[Bornology α]
[Finite ι]
{f : ι → Set α}

Bornology.IsCobounded (⋂ i, f i) ↔ ∀ (i : ι), Bornology.IsCobounded (f i)


theorem iterateFrobeniusEquiv_eq_pow : iterateFrobeniusEquiv R p n = frobeniusEquiv R p ^ n

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


@[elab_as_elim]
protected theorem casesOn {P : PartENat → Prop} : ∀ a : PartENat, P ⊤ → (∀ n : ℕ, P n) → P a


lemma homologyMap_comm :
    homologyMap φ ≫ h₂.homologyIso.hom = h₁.homologyIso.hom ≫ γ.φH

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.homologyMap φ) h₂.homologyIso.hom =
  CategoryTheory.CategoryStruct.comp h₁.homologyIso.hom γ.φH


theorem div2_bit1 (n) : div2 (2 * n + 1) = n


@[to_additive norm_le_norm_add_const_of_dist_le]
theorem norm_le_norm_add_const_of_dist_le' : dist a b ≤ r → ‖a‖ ≤ ‖b‖ + r

{E : Type u_6}
[SeminormedGroup E]
{a b : E}
{r : ℝ}


@[simp]
theorem zero_eval (v) : zero.eval v = pure [0]

Turing.ToPartrec.Code.zero.eval v = pure [0]


private theorem aux2 {a b c : A} :
    ⁅L a, L (a * a)⁆ + ⁅L a, L (b * b)⁆ + ⁅L a, L (c * c)⁆ +
    ⁅L a, 2 • L (a * b)⁆ + ⁅L a, 2 • L (c * a)⁆ + ⁅L a, 2 • L (b * c)⁆ +
    (⁅L b, L (a * a)⁆ + ⁅L b, L (b * b)⁆ + ⁅L b, L (c * c)⁆ +
    ⁅L b, 2 • L (a * b)⁆ + ⁅L b, 2 • L (c * a)⁆ + ⁅L b, 2 • L (b * c)⁆) +
    (⁅L c, L (a * a)⁆ + ⁅L c, L (b * b)⁆ + ⁅L c, L (c * c)⁆ +
    ⁅L c, 2 • L (a * b)⁆ + ⁅L c, 2 • L (c * a)⁆ + ⁅L c, 2 • L (b * c)⁆)
    =
    ⁅L a, L (b * b)⁆ + ⁅L b, L (a * a)⁆ + 2 • (⁅L a, L (a * b)⁆ + ⁅L b, L (a * b)⁆) +
    (⁅L a, L (c * c)⁆ + ⁅L c, L (a * a)⁆ + 2 • (⁅L a, L (c * a)⁆ + ⁅L c, L (c * a)⁆)) +
    (⁅L b, L (c * c)⁆ + ⁅L c, L (b * b)⁆ + 2 • (⁅L b, L (b * c)⁆ + ⁅L c, L (b * c)⁆)) +
    (2 • ⁅L a, L (b * c)⁆ + 2 • ⁅L b, L (c * a)⁆ + 2 • ⁅L c, L (a * b)⁆)

{A : Type u_1}
[NonUnitalNonAssocCommRing A]
[IsCommJordan A]
{a b c : A}


theorem setFinite [Module.Finite R M] {b : Set M}
    (h : LinearIndependent R fun x : b => (x : M)) : b.Finite

(h : LinearIndependent R fun (x : ↑b) => ↑x)


@[to_additive (attr := simp)]
theorem coe_bot : ((⊥ : Subsemigroup M) : Set M) = ∅


theorem gcd_dvd_right (n m : ℕ+) : gcd n m ∣ m


/-- The product of `f i` over `i ∈ {a}` equals `f a`. -/
@[to_additive "The sum of `f i` over `i ∈ {a}` equals `f a`."]
theorem finprod_mem_singleton : (∏ᶠ i ∈ ({a} : Set α), f i) = f a

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{a : α}


@[simp (high)]
theorem coe_id (V : SemiNormedGrp₁) : ⇑(𝟙 V) = id


@[simp]
theorem integral_const_mul (a : ℂ) (f : ℂ → ℂ) (c : ℂ) (R : ℝ) :
    (∮ z in C(c, R), a * f z) = a * ∮ z in C(c, R), f z

(∮ (z : ℂ) in C(c, R), a * f z) = a * ∮ (z : ℂ) in C(c, R), f z


@[to_additive]
theorem div_union : s / (t₁ ∪ t₂) = s / t₁ ∪ s / t₂

{α : Type u_2}
[DecidableEq α]
[Div α]
{s t₁ t₂ : Finset α}


@[to_additive (attr := simp)]
theorem smul_ball (c : G) (x : X) (r : ℝ) : c • ball x r = ball (c • x) r

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[AddGroup G]
[AddAction G X]
[IsometricVAdd G X]
(c : G)
(x : X)
(r : ℝ)

c +ᵥ Metric.ball x r = Metric.ball (c +ᵥ x) r


theorem isClosedMap_toDual : IsClosedMap (toDual : X → Xᵒᵈ)


theorem darts_takeUntil_subset {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).darts ⊆ p.darts

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v w : V}
(p : G.Walk v w)
(h : u ∈ p.support)


@[simp, norm_cast]
theorem edist_lt_coe {x y : α} {c : ℝ≥0} : edist x y < c ↔ nndist x y < c

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{c : ℝ≥0}


@[to_additive]
theorem ThreeGPFree.mono (h : t ⊆ s) (hs : ThreeGPFree s) : ThreeGPFree t

{α : Type u_2}
[Monoid α]
{s t : Set α}
(h : t ⊆ s)
(hs : ThreeGPFree s)


@[to_additive]
theorem smul_lt_smul_of_le_of_lt [LE G] [Preorder P] [SMul G P] [IsOrderedCancelSMul G P]
    {a b : G} {c d : P} (h₁ : a ≤ b) (h₂ : c < d) :
  a • c < b • d

{G : Type u_1}
{P : Type u_2}
[LE G]
[Preorder P]
[SMul G P]
[IsOrderedCancelSMul G P]
{a b : G}
{c d : P}
(h₁ : a ≤ b)
(h₂ : c < d)


@[simp]
theorem snd_vsub (p₁ p₂ : P × P') : (p₁ -ᵥ p₂ : G × G').2 = p₁.2 -ᵥ p₂.2

{G : Type u_1}
{G' : Type u_2}
{P : Type u_3}
{P' : Type u_4}
[AddGroup G]
[AddGroup G']
[AddTorsor G P]
[AddTorsor G' P']
(p₁ p₂ : P × P')


theorem derivedSeries_def (k : ℕ) : derivedSeries R L k = derivedSeriesOfIdeal R L k ⊤

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(k : ℕ)

LieAlgebra.derivedSeries R L k = LieAlgebra.derivedSeriesOfIdeal R L k ⊤


theorem FinitaryExtensive.isVanKampen_finiteCoproducts_Fin [FinitaryExtensive C] {n : ℕ}
    {F : Discrete (Fin n) ⥤ C} {c : Cocone F} (hc : IsColimit c) : IsVanKampenColimit c

{F : CategoryTheory.Functor (CategoryTheory.Discrete (Fin n)) C}

(hc : CategoryTheory.Limits.IsColimit c)


@[simp]
theorem continuum_add_nat (n : ℕ) : 𝔠 + n = 𝔠

Cardinal.continuum + ↑n = Cardinal.continuum


@[simp]
theorem forall_bool {p : Bool → Prop} : (∀ b, p b) ↔ p false ∧ p true


/-- The determinant of a unit matrix is itself a unit. -/
@[simps]
def det : GL n R →* Rˣ

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : GL n R)

↑(Matrix.GeneralLinearGroup.det A) = (↑A).det


/-- If `i : D ⥤ C` is reflective, the inverse functor of `i ≌ F.essImage` can be explicitly
defined by the reflector. -/
@[simps]
def equivEssImageOfReflective [Reflective i] : D ≌ i.EssImageSubcategory

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{i : CategoryTheory.Functor D C}
[CategoryTheory.Reflective i]

CategoryTheory.equivEssImageOfReflective.unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun X => (CategoryTheory.asIso ((CategoryTheory.reflectorAdjunction i).counit.app X)).symm) ⋯


theorem image_iUnion₂ (f : α → β) (s : ∀ i, κ i → Set α) :
    (f '' ⋃ (i) (j), s i j) = ⋃ (i) (j), f '' s i j

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(f : α → β)
(s : (i : ι) → κ i → Set α)

f '' ⋃ i, ⋃ j, s i j = ⋃ i, ⋃ j, f '' s i j


/-- Integrating against the Dirac measure is equal to the delta distribution. -/
@[simp]
theorem integralCLM_dirac_eq_delta (x : E) : integralCLM 𝕜 (dirac x) = delta 𝕜 F x

(𝕜 : Type u_1)
{E : Type u_4}
(F : Type u_5)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[RCLike 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
[MeasurableSpace E]
[BorelSpace E]
[SecondCountableTopology E]
[CompleteSpace F]
(x : E)

SchwartzMap.integralCLM 𝕜 (MeasureTheory.Measure.dirac x) = SchwartzMap.delta 𝕜 F x


theorem le_smul_caratheodory (a : ℝ≥0∞) (m : OuterMeasure α) :
    m.caratheodory ≤ (a • m).caratheodory

{α : Type u_1}
(a : ℝ≥0∞)
(m : MeasureTheory.OuterMeasure α)


@[simp]
theorem derivative_X_pow (n : ℕ) : derivative (X ^ n : R[X]) = C (n : R) * X ^ (n - 1)

Polynomial.derivative (Polynomial.X ^ n) = Polynomial.C ↑n * Polynomial.X ^ (n - 1)


/--
An isomorphism of groups gives an order isomorphism between the lattices of subgroups,
defined by sending subgroups to their inverse images.

See also `MulEquiv.mapSubgroup` which maps subgroups to their forward images.
-/
@[simps]
def comapSubgroup (f : G ≃* H) : Subgroup H ≃o Subgroup G

{G : Type u_1}
[Group G]
{H : Type u_5}
[Group H]
(f : G ≃* H)

∀ (H_1 : Subgroup H), f.comapSubgroup H_1 = Subgroup.comap (↑f) H_1


theorem Commute.invOf_left [Monoid α] {a b : α} [Invertible b] (h : Commute b a) :
    Commute (⅟ b) a

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


/-- Unicity of `liftHom`: a map that agrees on `h.root` agrees with `liftHom` everywhere. -/
theorem eq_liftHom (h : IsAdjoinRoot S f) (g : S →ₐ[R] T) (hroot : g h.root = x) :
    g = h.liftHom x hx'

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{x : T}
[Algebra R T]
(hx' : (Polynomial.aeval x) f = 0)
(h : IsAdjoinRoot S f)
(g : S →ₐ[R] T)
(hroot : g h.root = x)


theorem prod_span_singleton {ι : Type*} (s : Finset ι) (I : ι → R) :
    (∏ i ∈ s, Ideal.span ({I i} : Set R)) = Ideal.span {∏ i ∈ s, I i}

{R : Type u}
[CommSemiring R]
{ι : Type u_2}
(s : Finset ι)
(I : ι → R)

∏ i ∈ s, Ideal.span {I i} = Ideal.span {∏ i ∈ s, I i}


/-- The functor `ComposableArrows C (n + 1) ⥤ ComposableArrows C n` which forgets
the last arrow. -/
@[simps!]
def δlastFunctor : ComposableArrows C (n + 1) ⥤ ComposableArrows C n

(F : CategoryTheory.ComposableArrows C (n + 1))

(CategoryTheory.ComposableArrows.δlastFunctor.obj F).obj X = F.obj X.castSucc


/-- A `QuaternionAlgebra.Basis` implies an `AlgHom` from the quaternions. -/
@[simps!]
def liftHom : ℍ[R,c₁,c₂] →ₐ[R] A

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)
(a : ℍ[R,c₁,c₂])


/-- Expressing uniform convergence using `edist`. -/
theorem tendstoUniformly_iff {ι : Type*} {F : ι → β → α} {f : β → α} {p : Filter ι} :
    TendstoUniformly F f p ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x, edist (f x) (F n x) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
{ι : Type u_2}
{F : ι → β → α}
{f : β → α}
{p : Filter ι}

TendstoUniformly F f p ↔ ∀ ε > 0, ∀ᶠ (n : ι) in p, ∀ (x : β), edist (f x) (F n x) < ε


/-- Note that the name is to match `CanonicallyOrderedCommSemiring.mul_pos`. -/
@[simp] lemma _root_.CanonicallyOrderedCommSemiring.prod_pos [Nontrivial R] :
    0 < ∏ i ∈ s, f i ↔ (∀ i ∈ s, (0 : R) < f i)

{ι : Type u_1}
{R : Type u_2}
[CanonicallyOrderedCommSemiring R]
{f : ι → R}
{s : Finset ι}
[Nontrivial R]


theorem not_lt_top {x : ℝ≥0∞} : ¬x < ∞ ↔ x = ∞

¬x < ⊤ ↔ x = ⊤


lemma coeff_det_one_add_X_smul_one (M : Matrix n n R) :
    (det (1 + (X : R[X]) • M.map C)).coeff 1 = trace M

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

(1 + Polynomial.X • M.map ⇑Polynomial.C).det.coeff 1 = M.trace


@[simp]
protected theorem mul_inv_cancel (φ : k⟦X⟧) (h : constantCoeff k φ ≠ 0) : φ * φ⁻¹ = 1

(h : (PowerSeries.constantCoeff k) φ ≠ 0)


/-- The map `ComposableArrows C m → ComposableArrows C n` obtained by precomposition with
a functor `Fin (n + 1) ⥤ Fin (m + 1)`. -/
@[simps!]
def whiskerLeft (F : ComposableArrows C m) (Φ : Fin (n + 1) ⥤ Fin (m + 1)) :
    ComposableArrows C n

(F : CategoryTheory.ComposableArrows C m)

(Φ : CategoryTheory.Functor (Fin (n + 1)) (Fin (m + 1)))

∀ {X Y : Fin (n + 1)} (f : X ⟶ Y), (F.whiskerLeft Φ).map f = F.map (Φ.map f)


@[simp]
theorem units_mul_self (u : ℤˣ) : u * u = 1


@[to_additive] -- Porting note (#10618): `simp` can prove it
theorem mem_ball_one_iff : a ∈ ball (1 : E) r ↔ ‖a‖ < r

{E : Type u_6}
[SeminormedGroup E]
{a : E}
{r : ℝ}


@[simp] theorem snd_natCast (n : ℕ) : (n : X q).snd = (0 : ZMod q)


@[simp]
theorem preimage_mul_const_uIcc (ha : a ≠ 0) (b c : α) :
    (· * a) ⁻¹' [[b, c]] = [[b / a, c / a]]

{α : Type u_1}
[LinearOrderedField α]
{a : α}
(ha : a ≠ 0)
(b c : α)


theorem Bounded.to_lt : ∀ {t : Ordnode α} {x y : α}, Bounded t x y → x < y

{α : Type u_1}
[Preorder α]
{t : Ordnode α}
{x y : α}


@[simp]
theorem smul_mem_pointwise_smul_iff {a : M} {S : Subsemiring R} {x : R} : a • x ∈ a • S ↔ x ∈ S

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


@[to_additive IsAddUnit.exists_neg']
lemma IsUnit.exists_left_inv {a : M} (h : IsUnit a) : ∃ b, b * a = 1

{M : Type u_1}
[Monoid M]
{a : M}
(h : IsUnit a)


theorem smoothWithinAt_id : SmoothWithinAt I I (id : M → M) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
{x : M}


theorem ContMDiffAt.continuousAt (hf : ContMDiffAt I I' n f x) : ContinuousAt f x

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


@[simp] theorem swap_swap_eq : swap ∘ swap = @id (α ⊕ β)


theorem multiequalizer_ext {I : MulticospanIndex.{w} C} [HasMultiequalizer I]
    [PreservesLimit I.multicospan (forget C)] (x y : ↑(multiequalizer I))
    (h : ∀ t : I.L, Multiequalizer.ι I t x = Multiequalizer.ι I t y) : x = y

{I : CategoryTheory.Limits.MulticospanIndex C}

[CategoryTheory.Limits.PreservesLimit I.multicospan (CategoryTheory.forget C)]

(x y : (CategoryTheory.forget C).obj (CategoryTheory.Limits.multiequalizer I))

(h : ∀ (t : I.L), (CategoryTheory.Limits.Multiequalizer.ι I t) x = (CategoryTheory.Limits.Multiequalizer.ι I t) y)


/-- The complex shape where only differentials from each `X.i` to itself are allowed.

This is mostly only useful so we can describe the relation of "related in `k` steps" below.
-/
@[simps]
def refl (ι : Type*) : ComplexShape ι


@[simp]
theorem ContinuousMultilinearMap.curryRight_norm (f : ContinuousMultilinearMap 𝕜 Ei G) :
    ‖f.curryRight‖ = ‖f‖

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]


theorem isPrincipal_inv (I : FractionalIdeal R₁⁰ K) [Submodule.IsPrincipal (I : Submodule R₁ K)]
    (h : I ≠ 0) : Submodule.IsPrincipal I⁻¹.1

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
(I : FractionalIdeal R₁⁰ K)
[(↑I).IsPrincipal]
(h : I ≠ 0)


theorem ofSet_eq_some_self_iff {s : Set α} {_ : DecidablePred (· ∈ s)} {a : α} :
    ofSet s a = some a ↔ a ∈ s

∀ {x : DecidablePred fun x => x ∈ s} {a : α}, (PEquiv.ofSet s) a = some a ↔ a ∈ s


@[simp]
theorem diagram_l : D.diagram.L = (D.J × D.J)

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


theorem le_compl_iff_disjoint_right : a ≤ bᶜ ↔ Disjoint a b

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}


theorem unary_relation_sInf_iff {α : Type*} (s : Set (α → Prop)) {a : α} :
    sInf s a ↔ ∀ r : α → Prop, r ∈ s → r a

{α : Type u_9}
(s : Set (α → Prop))
{a : α}


@[to_additive]
theorem measure_mul_measure_eq (s t : Set G) (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞) :
    μ' s * ν' t = ν' s * μ' t

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
[MeasurableInv G]
(μ' ν' : MeasureTheory.Measure G)
[MeasureTheory.SigmaFinite μ']
[MeasureTheory.SigmaFinite ν']
[μ'.IsMulLeftInvariant]
[ν'.IsMulLeftInvariant]
(s t : Set G)
(h2s : ν' s ≠ 0)
(h3s : ν' s ≠ ⊤)


/-- **Gershgorin's circle theorem**: for any eigenvalue `μ` of a square matrix `A`, there exists an
index `k` such that `μ` lies in the closed ball of center the diagonal term `A k k` and of
radius the sum of the norms `∑ j ≠ k, ‖A k j‖. -/
theorem eigenvalue_mem_ball {μ : K} (hμ : Module.End.HasEigenvalue (Matrix.toLin' A) μ) :
    ∃ k, μ ∈ Metric.closedBall (A k k) (∑ j ∈ Finset.univ.erase k, ‖A k j‖)


@[simp]
theorem circulant_inj [AddGroup n] {v w : n → α} : circulant v = circulant w ↔ v = w

{α : Type u_1}
{n : Type u_4}
[AddGroup n]
{v w : n → α}

Matrix.circulant v = Matrix.circulant w ↔ v = w


@[simp]
theorem eps_mul_eps [Semiring R] : (ε * ε : R[ε]) = 0


theorem IsQF.castLE {h : l ≤ n} (hφ : IsQF φ) : (φ.castLE h).IsQF

{L : FirstOrder.Language}
{α : Type u'}
{n l : ℕ}
{φ : L.BoundedFormula α l}
{h : l ≤ n}
(hφ : φ.IsQF)


protected theorem HasGradientAt.continuousOn {f' : F → F} (h : ∀ x ∈ s, HasGradientAt f (f' x) x) :
    ContinuousOn f s

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{s : Set F}
{f' : F → F}
(h : ∀ x ∈ s, HasGradientAt f (f' x) x)


@[to_additive]
theorem Nonempty.of_mul_right : (s * t).Nonempty → t.Nonempty


@[simp, mfld_simps]
theorem localTriv_continuousLinearMapAt {b : B} (hb : b ∈ Z.baseSet i) :
    (Z.localTriv i).continuousLinearMapAt R b = Z.coordChange (Z.indexAt b) i b

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
{i : ι}
{b : B}
(hb : b ∈ Z.baseSet i)

Trivialization.continuousLinearMapAt R (Z.localTriv i) b = Z.coordChange (Z.indexAt b) i b


lemma RightResolution.mk_surjective (R : Φ.RightResolution X₂) :
    ∃ (X₁ : C₁) (w : X₂ ⟶ Φ.functor.obj X₁) (hw : W₂ w), R = RightResolution.mk w hw

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}

∃ X₁ w, ∃ (hw : W₂ w), R = CategoryTheory.LocalizerMorphism.RightResolution.mk w hw


lemma isSimple_of_isAtom (I : LieIdeal R L) (hI : IsAtom I) : IsSimple R I

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsSemisimple R L]
(I : LieIdeal R L)
(hI : IsAtom I)


/-- A disjoint union of complete metric spaces is complete. -/
protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σi, E i)

{ι : Type u_1}
{E : ι → Type u_2}
[(i : ι) → MetricSpace (E i)]
[∀ (i : ι), CompleteSpace (E i)]


/-- The short complex `T.obj₁ ⟶ T.obj₂ ⟶ T.obj₃` attached to a distinguished triangle. -/
@[simps]
def shortComplexOfDistTriangle (T : Triangle C) (hT : T ∈ distTriang C) : ShortComplex C

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T hT).X₃ = T.obj₃


theorem factors_iff {X Y : C} (P : Subobject Y) (f : X ⟶ Y) :
    P.Factors f ↔ (representative.obj P).Factors f

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

P.Factors f ↔ (CategoryTheory.Subobject.representative.obj P).Factors f


theorem HasFDerivAtFilter.sub_const (hf : HasFDerivAtFilter f f' x L) (c : F) :
    HasFDerivAtFilter (fun x => f x - c) f' x L

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


theorem isOpen_Ico_zero : IsOpen (Ico 0 b)


theorem reverse_eq {l : List α} (p : Palindrome l) : reverse l = l

{α : Type u_1}
{l : List α}
(p : l.Palindrome)


/-- Only assumes left strict covariance. -/
@[to_additive "Only assumes left strict covariance"]
theorem Left.mul_lt_mul [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c d : α} (h₁ : a < b) (h₂ : c < d) :
    a * c < b * d

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

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


@[mono]
theorem ae_mono (h : μ ≤ ν) : ae μ ≤ ae ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ ≤ ν)


@[simp]
theorem map_id : map id = (id : Germ l β → Germ l β)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}


theorem IsTerminal.strict_hom_ext (hI : IsTerminal I) {A : C} (f g : I ⟶ A) : f = g

(hI : CategoryTheory.Limits.IsTerminal I)


theorem sub_eq_sInf {a b : ℝ≥0∞} : a - b = sInf { d | a ≤ d + b }


theorem Heap.WF.tail (hwf : (s : Heap α).WF le n) : (s.tail le).WF le 0

(hwf : Batteries.BinomialHeap.Imp.Heap.WF le n s)

Batteries.BinomialHeap.Imp.Heap.WF le 0 (Batteries.BinomialHeap.Imp.Heap.tail le s)


theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
    (hd : HasDerivWithinAt d d' s x) :
    HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : 𝕜}
{s : Set 𝕜}
{G : Type u_2}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{c : 𝕜 → F →L[𝕜] G}
{c' : F →L[𝕜] G}
{d : 𝕜 → E →L[𝕜] F}
{d' : E →L[𝕜] F}
(hc : HasDerivWithinAt c c' s x)
(hd : HasDerivWithinAt d d' s x)


/-- Negating a rotation by -π / 2 is equivalent to rotation by π / 2. -/
@[simp]
theorem neg_rotation_neg_pi_div_two (x : V) :
    -o.rotation (-π / 2 : ℝ) x = o.rotation (π / 2 : ℝ) x

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

-(o.rotation ↑(-π / 2)) x = (o.rotation ↑(π / 2)) x


@[to_additive]
theorem hasProd_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 1 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasProd f a₁)
    (hg : HasProd g a₂) : a₁ ≤ a₂

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a₁ a₂ : α}
{g : κ → α}
(e : ι → κ)
(he : Function.Injective e)
(hs : ∀ c ∉ Set.range e, 1 ≤ g c)
(h : ∀ (i : ι), f i ≤ g (e i))
(hf : HasProd f a₁)
(hg : HasProd g a₂)


@[simp]
theorem coe_toEquiv (h : M ≃ₘ^n⟮I, I'⟯ M') : ⇑h.toEquiv = h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, I'⟯ M')


theorem coeff_invOfUnit [DecidableEq σ] (n : σ →₀ ℕ) (φ : MvPowerSeries σ R) (u : Rˣ) :
    coeff R n (invOfUnit φ u) =
      if n = 0 then ↑u⁻¹
      else
        -↑u⁻¹ *
          ∑ x ∈ antidiagonal n,
            if x.2 < n then coeff R x.1 φ * coeff R x.2 (invOfUnit φ u) else 0

{σ : Type u_1}
{R : Type u_2}
[Ring R]
[DecidableEq σ]
(n : σ →₀ ℕ)
(φ : MvPowerSeries σ R)
(u : Rˣ)

(MvPowerSeries.coeff R n) (φ.invOfUnit u) =
  if n = 0 then ↑u⁻¹
  else
    -↑u⁻¹ *
      ∑ x ∈ Finset.antidiagonal n,
        if x.2 < n then (MvPowerSeries.coeff R x.1) φ * (MvPowerSeries.coeff R x.2) (φ.invOfUnit u) else 0


@[simps]
def StarAlgEquiv.restrictScalars (f : A ≃⋆ₐ[S] B) : A ≃⋆ₐ[R] B

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
[Star A]
[Star B]
(f : A ≃⋆ₐ[S] B)

∀ (a : B), (StarAlgEquiv.restrictScalars R f).symm a = f.invFun a


theorem head {n : ℕ} : @Primrec' n.succ head


@[to_additive]
theorem invRev_involutive : Function.Involutive (@invRev α)


theorem coe_stream_nth_rat_eq :
    ((IntFractPair.stream q n).map (mapFr (↑)) : Option <| IntFractPair K) =
      IntFractPair.stream v n

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
{q : ℚ}
(v_eq_q : v = ↑q)
(n : ℕ)

Option.map (GenContFract.IntFractPair.mapFr Rat.cast) (GenContFract.IntFractPair.stream q n) =
  GenContFract.IntFractPair.stream v n


theorem updateRow_apply [DecidableEq m] {i' : m} :
    updateRow M i b i' j = if i' = i then b j else M i' j

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{i : m}
{j : n}
{b : n → α}
[DecidableEq m]
{i' : m}

M.updateRow i b i' j = if i' = i then b j else M i' j


lemma norm_natCast_cpow_le_norm_natCast_cpow_iff {n : ℕ} (hn : 1 < n) {w z : ℂ} :
    ‖(n : ℂ) ^ w‖ ≤ ‖(n : ℂ) ^ z‖ ↔ w.re ≤ z.re


theorem base_smul_def' (h : H) (w : NormalWord d) :
    h • w = { w with head := h * w.head }

{d : Monoid.PushoutI.NormalWord.Transversal φ}

h • w = { toWord := w.toWord, head := h * w.head, normalized := ⋯ }


/-- For rewriting in the reverse direction, see `Fin.cast_addNat_left`. -/
theorem addNat_cast {n n' m : Nat} (i : Fin n') (h : n' = n) :
    addNat (cast h i) m = cast (congrArg (. + m) h) (addNat i m)

(Fin.cast h i).addNat m = Fin.cast ⋯ (i.addNat m)


@[simp]
theorem length_nil {a : V} : (nil : Path a a).length = 0


theorem tanh_half_dist (z w : ℍ) :
    tanh (dist z w / 2) = dist (z : ℂ) w / dist (z : ℂ) (conj ↑w)

Real.tanh (dist z w / 2) = dist ↑z ↑w / dist (↑z) ((starRingEnd ℂ) ↑w)


@[simp]
theorem highestWeight_apply {μ : YoungDiagram} {i j : ℕ} :
    highestWeight μ i j = if (i, j) ∈ μ then i else 0

(SemistandardYoungTableau.highestWeight μ) i j = if (i, j) ∈ μ then i else 0


@[to_additive]
theorem smul_oreDiv (r : R) (x : X) (s : S) :
    r • (x /ₒ s) = oreNum (r • 1) s • x /ₒ oreDenom (r • 1) s

{R : Type u_1}
{M : Type u_3}
{X : Type u_4}
[AddMonoid M]
{S : AddSubmonoid M}
[AddOreLocalization.AddOreSet S]
[AddAction M X]
[VAdd R X]
[VAdd R M]
[VAddAssocClass R M M]
[VAddAssocClass R M X]
(r : R)
(x : X)
(s : ↥S)

r +ᵥ (x -ₒ s) = AddOreLocalization.oreMin (r +ᵥ 0) s +ᵥ x -ₒ AddOreLocalization.oreSubtra (r +ᵥ 0) s


theorem bex_ne_none {p : Option α → Prop} : (∃ x, ∃ (_ : x ≠ none), p x) ↔ ∃ x, p (some x)


@[to_additive]
theorem mulTSupport_extend_one (inj : g.Injective) :
    mulTSupport (g.extend f 1) = g '' mulTSupport f

{α : Type u_2}
{α' : Type u_3}
{β : Type u_4}
[TopologicalSpace α]
[TopologicalSpace α']
[One β]
{f : α → β}
[T2Space α']
(hf : HasCompactMulSupport f)
{g : α → α'}
(cont : Continuous g)
(inj : Function.Injective g)

mulTSupport (Function.extend g f 1) = g '' mulTSupport f


@[simp 1100]
theorem continuous_sigma_map {f₁ : ι → κ} {f₂ : ∀ i, σ i → τ (f₁ i)} :
    Continuous (Sigma.map f₁ f₂) ↔ ∀ i, Continuous (f₂ i)

{ι : Type u_5}
{κ : Type u_6}
{σ : ι → Type u_7}
{τ : κ → Type u_8}
[(i : ι) → TopologicalSpace (σ i)]
[(k : κ) → TopologicalSpace (τ k)]
{f₁ : ι → κ}
{f₂ : (i : ι) → σ i → τ (f₁ i)}

Continuous (Sigma.map f₁ f₂) ↔ ∀ (i : ι), Continuous (f₂ i)


theorem cokernel_not_mono_of_nonzero (w : f ≠ 0) : ¬Mono (cokernel.π f)


/-- An alternative version of `Subtype.exists`. This one is useful if Lean cannot figure out `q`
  when using `Subtype.exists` from right to left. -/
protected theorem exists' {q : ∀ x, p x → Prop} : (∃ x h, q x h) ↔ ∃ x : { a // p a }, q x x.2

{α : Sort u_1}
{p : α → Prop}
{q : (x : α) → p x → Prop}


private theorem le_def' {x y : ℝ} : x ≤ y ↔ x < y ∨ x = y


@[simp]
theorem dual_id : SupHom.dual (SupHom.id α) = InfHom.id _

SupHom.dual (SupHom.id α) = InfHom.id αᵒᵈ


theorem rat_mul (h : LiouvilleWith p x) (hr : r ≠ 0) : LiouvilleWith p (r * x)

{p x : ℝ}
{r : ℚ}
(h : LiouvilleWith p x)
(hr : r ≠ 0)


theorem closedEmbedding_coe_ennreal : ClosedEmbedding ((↑) : ℝ≥0∞ → EReal)


theorem mem_carrier_mk {a : α} : a ∈ carrier (ConjClasses.mk a)


@[simp]
theorem total_embDomain (f : α ↪ α') (l : α →₀ R) :
    (Finsupp.total α' M' R v') (embDomain f l) = (Finsupp.total α M' R (v' ∘ f)) l

{α : Type u_1}
(R : Type u_5)
[Semiring R]
{α' : Type u_7}
{M' : Type u_8}
[AddCommMonoid M']
[Module R M']
{v' : α' → M'}
(f : α ↪ α')
(l : α →₀ R)

(Finsupp.total α' M' R v') (Finsupp.embDomain f l) = (Finsupp.total α M' R (v' ∘ ⇑f)) l


@[simp] theorem toCoalgebraCatIso_refl :
    toCoalgebraCatIso (CoalgEquiv.refl R X) = .refl _

{R : Type u}
[CommRing R]
{X : Type v}
[AddCommGroup X]
[Module R X]
[Coalgebra R X]

(CoalgEquiv.refl R X).toCoalgebraCatIso = CategoryTheory.Iso.refl (CoalgebraCat.of R X)


lemma mem_distinguishedTriangles_iff (T : Triangle Cᵒᵖ) :
    T ∈ distinguishedTriangles C ↔
      ((triangleOpEquivalence C).inverse.obj T).unop ∈ distTriang C

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

(T : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

T ∈ CategoryTheory.Pretriangulated.Opposite.distinguishedTriangles C ↔
  Opposite.unop ((CategoryTheory.Pretriangulated.triangleOpEquivalence C).inverse.obj T) ∈
    CategoryTheory.Pretriangulated.distinguishedTriangles


@[simp]
theorem single_subsingleton_eq_refl [Subsingleton α] (a b : α) : single a b = PEquiv.refl α

{α : Type u}
[DecidableEq α]
[Subsingleton α]
(a b : α)


theorem indicator_one_preimage [Zero M] (U : Set α) (s : Set M) :
    U.indicator 1 ⁻¹' s ∈ ({Set.univ, U, Uᶜ, ∅} : Set (Set α))

{α : Type u_1}
{M : Type u_4}
[One M]
[Zero M]
(U : Set α)
(s : Set M)

U.indicator 1 ⁻¹' s ∈ {Set.univ, U, Uᶜ, ∅}


@[simp] theorem imp_false : (a → False) ↔ ¬a


theorem toDual_le_iff {a : WithBot α} {b : WithTop αᵒᵈ} :
    WithBot.toDual a ≤ b ↔ WithTop.ofDual b ≤ a

{α : Type u_1}
[LE α]
{a : WithBot α}
{b : WithTop αᵒᵈ}


/-- A decomposition is an equivalence between an additive monoid `M` and a direct sum of additive
submonoids `ℳ i` of that `M`, such that the "recomposition" is canonical. This definition also
works for additive groups and modules.

This is a version of `DirectSum.IsInternal` which comes with a constructive inverse to the
canonical "recomposition" rather than just a proof that the "recomposition" is bijective.

Often it is easier to construct a term of this type via `Decomposition.ofAddHom` or
`Decomposition.ofLinearMap`. -/
class Decomposition where
  decompose' : M → ⨁ i, ℳ i
  left_inv : Function.LeftInverse (DirectSum.coeAddMonoidHom ℳ) decompose'
  right_inv : Function.RightInverse (DirectSum.coeAddMonoidHom ℳ) decompose'

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
{ℳ : ι → σ}
[self : DirectSum.Decomposition ℳ]

Function.LeftInverse (⇑(DirectSum.coeAddMonoidHom ℳ)) DirectSum.Decomposition.decompose'


lemma lift_injective [Nonempty ι] [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift G f P g Hg)

(Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x)

(injective : ∀ (i : ι), Function.Injective ⇑(g i))

Function.Injective ⇑(Ring.DirectLimit.lift G f P g Hg)


theorem forall₂_comp_perm_eq_perm_comp_forall₂ : Forall₂ r ∘r Perm = Perm ∘r Forall₂ r

{α : Type u_1}
{β : Type u_2}
{r : α → β → Prop}

Relation.Comp (List.Forall₂ r) List.Perm = Relation.Comp List.Perm (List.Forall₂ r)


/-- The algebra isomorphism `adjoin ℤ {ζ} ≃ₐ[ℤ] (𝓞 K)`, where `ζ` is a primitive `p ^ k`-th root of
unity and `K` is a `p ^ k`-th cyclotomic extension of `ℚ`. -/
@[simps!]
noncomputable def _root_.IsPrimitiveRoot.adjoinEquivRingOfIntegers
    [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) :
    adjoin ℤ ({ζ} : Set K) ≃ₐ[ℤ] 𝓞 K

{p : ℕ+}
{k : ℕ}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[IsCyclotomicExtension {p ^ k} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑(p ^ k))
(a : 𝓞 K)

hζ.adjoinEquivRingOfIntegers.symm a = (IsIntegralClosure.lift ℤ (↥(Algebra.adjoin ℤ {ζ})) K) a


@[simp]
theorem rpow_lt_rpow_left_iff_of_base_lt_one (hx0 : 0 < x) (hx1 : x < 1) :
    x ^ y < x ^ z ↔ z < y


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

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


theorem sq_le (h : 0 ≤ y) : x ^ 2 ≤ y ↔ -√y ≤ x ∧ x ≤ √y


@[simp]
theorem pos_real_im : (x • z).im = x * z.im


theorem norm_subtypeL_le (K : Submodule 𝕜 E) : ‖K.subtypeL‖ ≤ 1

{𝕜 : Type u_1}
{E : Type u_4}
[SeminormedAddCommGroup E]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
(K : Submodule 𝕜 E)


/-- The linear equivalence `Cochain K L n ≃+ Cochain K L⟦a⟧ n'` when `n' + a = n` and
the category is `R`-linear. -/
@[simps!]
def rightShiftLinearEquiv (n a n' : ℤ) (hn' : n' + a = n) :
    Cochain K L n ≃ₗ[R] Cochain K (L⟦a⟧) n'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(R : Type u_1)
[Ring R]
[CategoryTheory.Linear R C]
(K L : CochainComplex C ℤ)
(n a n' : ℤ)
(hn' : n' + a = n)

∀ (a_1 : CochainComplex.HomComplex.Cochain K L n),
  (CochainComplex.HomComplex.Cochain.rightShiftLinearEquiv R K L n a n' hn') a_1 = a_1.rightShift a n' hn'


@[simp] lemma mod_mul_mod (a b c : ℕ) : (a % c * b) % c = a * b % c


/-- A semigroup homomorphism `f : M →ₙ* N` such that `f x` commutes with `f y` for all `x, y`
defines a semigroup homomorphism from `Mᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn))
      "An additive semigroup homomorphism `f : AddHom M N` such that `f x` additively
      commutes with `f y` for all `x`, `y` defines an additive semigroup homomorphism from `Mᵃᵒᵖ`."]
def MulHom.fromOpposite {M N : Type*} [Mul M] [Mul N] (f : M →ₙ* N)
    (hf : ∀ x y, Commute (f x) (f y)) : Mᵐᵒᵖ →ₙ* N

{M : Type u_2}
{N : Type u_3}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(hf : ∀ (x y : M), Commute (f x) (f y))

⇑(f.fromOpposite hf) = ⇑f ∘ MulOpposite.unop


theorem hom_comp_eq_id (g : X ⟶ Y) [IsIso g] {f : Y ⟶ X} : g ≫ f = 𝟙 X ↔ f = inv g

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

CategoryTheory.CategoryStruct.comp g f = CategoryTheory.CategoryStruct.id X ↔ f = CategoryTheory.inv g


@[simp, mfld_simps]
protected theorem right_inv {x : E} (hx : x ∈ range I) : I (I.symm x) = x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{x : E}
(hx : x ∈ Set.range ↑I)


@[simp]
theorem Ioc_insert_left (h : a ≤ b) : insert a (Ioc a b) = Icc a b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
{a b : α}
[DecidableEq α]
(h : a ≤ b)

insert a (Finset.Ioc a b) = Finset.Icc a b


theorem dualCopairing_eq (W : Submodule R M) :
    W.dualCopairing = (dualQuotEquivDualAnnihilator W).symm.toLinearMap

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


theorem add_one_le_of_lt {x y : PartENat} (h : x < y) : x + 1 ≤ y


/-- Sometimes, one may want to construct a charted space structure on a space which does not yet
have a topological structure, where the topology would come from the charts. For this, one needs
charts that are only partial equivalences, and continuity properties for their composition.
This is formalised in `ChartedSpaceCore`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure ChartedSpaceCore (H : Type*) [TopologicalSpace H] (M : Type*) where
  /-- An atlas of charts, which are only `PartialEquiv`s -/
  atlas : Set (PartialEquiv M H)
  /-- The preferred chart at each point -/
  chartAt : M → PartialEquiv M H
  mem_chart_source : ∀ x, x ∈ (chartAt x).source
  chart_mem_atlas : ∀ x, chartAt x ∈ atlas
  open_source : ∀ e e' : PartialEquiv M H, e ∈ atlas → e' ∈ atlas → IsOpen (e.symm.trans e').source
  continuousOn_toFun : ∀ e e' : PartialEquiv M H, e ∈ atlas → e' ∈ atlas →
    ContinuousOn (e.symm.trans e') (e.symm.trans e').source

{H : Type u_5}
[TopologicalSpace H]
{M : Type u_6}
(self : ChartedSpaceCore H M)
(x : M)


@[simp] theorem cast_ofNat {n m : Nat} (h : n = m) (x : Nat) :
    cast h (BitVec.ofNat n x) = BitVec.ofNat m x

BitVec.cast h (BitVec.ofNat n x) = BitVec.ofNat m x


@[to_additive]
theorem le_of_le_mul_of_le_one_left [CovariantClass α α (· * ·) (· ≤ ·)] {a b c : α} (h : a ≤ b * c)
    (hle : c ≤ 1) :
    a ≤ b

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


@[fun_prop]
theorem DifferentiableWithinAt.const_sub (hf : DifferentiableWithinAt 𝕜 f s x) (c : F) :
    DifferentiableWithinAt 𝕜 (fun y => c - f y) s x

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


/-- Analog of `Polynomial.induction_on'`.
To prove something about mv_polynomials,
it suffices to show the condition is closed under taking sums,
and it holds for monomials. -/
@[elab_as_elim]
theorem induction_on' {P : MvPolynomial σ R → Prop} (p : MvPolynomial σ R)
    (h1 : ∀ (u : σ →₀ ℕ) (a : R), P (monomial u a))
    (h2 : ∀ p q : MvPolynomial σ R, P p → P q → P (p + q)) : P p

(h1 : ∀ (u : σ →₀ ℕ) (a : R), P ((MvPolynomial.monomial u) a))

(h2 : ∀ (p q : MvPolynomial σ R), P p → P q → P (p + q))


lemma Base.eq_union_image_of_disjointSum {h B} (hB : (disjointSum M N h).Base B) :
    ∃ BM BN, M.Base BM ∧ N.Base BN ∧ Disjoint BM BN ∧ B = BM ∪ BN

{α : Type u_1}
{M N : Matroid α}
{h : Disjoint M.E N.E}
{B : Set α}
(hB : (M.disjointSum N h).Base B)


theorem div_le_of_le_mul (h : a ≤ b * c) : a / c ≤ b


theorem pullback_singleton [HasPullbacks C] (g : Z ⟶ X) :
    pullbackArrows f (singleton g) = singleton (pullback.snd g f)

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

CategoryTheory.Presieve.pullbackArrows f (CategoryTheory.Presieve.singleton g) =
  CategoryTheory.Presieve.singleton (CategoryTheory.Limits.pullback.snd g f)


/-- Given a localization functor `L : C ⥤ D` for `W : MorphismProperty C`,
if `(F₁' F₂' : D ⥤ E)` are functors which lifts functors `(F₁ F₂ : C ⥤ E)`,
a natural isomorphism `τ : F₁ ⟶ F₂` lifts to a natural isomorphism `F₁' ⟶ F₂'`. -/
@[simps]
def liftNatIso (F₁ F₂ : C ⥤ E) (F₁' F₂' : D ⥤ E) [h₁ : Lifting L W F₁ F₁'] [h₂ : Lifting L W F₂ F₂']
    (e : F₁ ≅ F₂) : F₁' ≅ F₂'

[h₁ : CategoryTheory.Localization.Lifting L W F₁ F₁']

[h₂ : CategoryTheory.Localization.Lifting L W F₂ F₂']

(CategoryTheory.Localization.liftNatIso L W F₁ F₂ F₁' F₂' e).inv =
  CategoryTheory.Localization.liftNatTrans L W F₂ F₁ F₂' F₁' e.inv


@[to_additive]
theorem smul_diff_smul (g : G) : diff ϕ (g • S) (g • T) = diff ϕ S T

(S T : ↑(AddSubgroup.leftTransversals ↑H))

AddSubgroup.leftTransversals.diff ϕ (g +ᵥ S) (g +ᵥ T) = AddSubgroup.leftTransversals.diff ϕ S T


/-- If `0 < n`, then `i : ZMod n` has order `n / gcd n i`.
-/
theorem orderOf_r [NeZero n] (i : ZMod n) : orderOf (r i) = n / Nat.gcd n i.val

orderOf (DihedralGroup.r i) = n / n.gcd i.val


@[simp]
theorem refl_apply [Module R M] (x : M) : refl R M x = x

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)


@[simp]
theorem sup_cons {b : β} (h : b ∉ s) : (cons b s h).sup f = f b ⊔ s.sup f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s : Finset β}
{f : β → α}
{b : β}
(h : b ∉ s)

(Finset.cons b s h).sup f = f b ⊔ s.sup f


theorem union_def [Union α] (a b : Part α) : a ∪ b = bind a fun y => map (y ∪ ·) b

a ∪ b = do
  let y ← a
  Part.map (fun x => y ∪ x) b


theorem subtype_val {p : α → Prop} [DecidablePred p] {hp : PrimrecPred p} :
    haveI := Primcodable.subtype hp
    Primrec (@Subtype.val α p)

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


theorem doubleFactorial_two_mul : ∀ n : ℕ, (2 * n)‼ = 2 ^ n * n !


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

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

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


@[to_additive]
theorem eq_iff_eq (g : LocalizationMap S P) {x y} : f.toMap x = f.toMap y ↔ g.toMap x = g.toMap y

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


@[simp 1100]
theorem norm_rat (r : ℚ) : ‖(r : ℂ)‖ = |(r : ℝ)|


theorem card_support_eq_one : f.support.card = 1 ↔
    ∃ (k : ℕ) (x : R) (hx : x ≠ 0), f = C x * X ^ k

f.support.card = 1 ↔ ∃ k x, ∃ (_ : x ≠ 0), f = Polynomial.C x * Polynomial.X ^ k


protected theorem sub_eq_iff_eq_add {c : Nat} (h : b ≤ a) : a - b = c ↔ a = c + b


@[simp] lemma locallyLinear_bot : (⊥ : SimpleGraph α).LocallyLinear


/-- The sine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem sin_oangle_sub_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.sin (o.oangle (x - y) x) = ‖y‖ / ‖x - y‖

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

(o.oangle (x - y) x).sin = ‖y‖ / ‖x - y‖


lemma setIntegral_stieltjesOfMeasurableRat_rat (hf : IsRatCondKernelCDF f κ ν) (a : α) (q : ℚ)
    {s : Set β} (hs : MeasurableSet s) :
    ∫ b in s, stieltjesOfMeasurableRat f hf.measurable (a, b) q ∂(ν a)
      = (κ a (s ×ˢ Iic (q : ℝ))).toReal

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDF f κ ν)

∫ (b : β) in s, ↑(ProbabilityTheory.stieltjesOfMeasurableRat f ⋯ (a, b)) ↑q ∂ν a = ((κ a) (s ×ˢ Set.Iic ↑q)).toReal


@[simp]
theorem embDomain_notin_range (h : b ∉ Set.range f) : s.embDomain f b = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{β : Type u_4}
(s : HahnSeries.SummableFamily Γ R α)
(f : α ↪ β)
{b : β}
(h : b ∉ Set.range ⇑f)


theorem ae_le_set_union {s' t' : Set α} (h : s ≤ᵐ[μ] t) (h' : s' ≤ᵐ[μ] t') :
    (s ∪ s' : Set α) ≤ᵐ[μ] (t ∪ t' : Set α)

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t s' t' : Set α}
(h : s ≤ᵐ[μ] t)
(h' : s' ≤ᵐ[μ] t')


@[to_additive]
theorem Normal.subgroupOf {H : Subgroup G} (hH : H.Normal) (K : Subgroup G) :
    (H.subgroupOf K).Normal

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(hH : H.Normal)
(K : AddSubgroup G)


@[to_additive]
theorem prod_sum_index [AddCommMonoid M] [AddCommMonoid N] [CommMonoid P] {f : α →₀ M}
    {g : α → M → β →₀ N} {h : β → N → P} (h_zero : ∀ a, h a 0 = 1)
    (h_add : ∀ a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) :
    (f.sum g).prod h = f.prod fun a b => (g a b).prod h

{g : α → M → β →₀ N}

(h_add : ∀ (a : β) (b₁ b₂ : N), h a (b₁ + b₂) = h a b₁ + h a b₂)

(f.sum g).sum h = f.sum fun a b => (g a b).sum h


theorem exp_neg_of_mem_ball [CharZero 𝕂] [CompleteSpace 𝔸] {x : 𝔸}
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) : exp 𝕂 (-x) = (exp 𝕂 x)⁻¹

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

NormedSpace.exp 𝕂 (-x) = (NormedSpace.exp 𝕂 x)⁻¹


theorem val_mul {n : Nat} : ∀ a b : Fin n, (a * b).val = a.val * b.val % n


@[simp]
theorem restrictScalars_add (f g : M →ₗ[S] N) :
    (f + g).restrictScalars R = f.restrictScalars R + g.restrictScalars R

{R : Type u_17}
{S : Type u_18}
{M : Type u_19}
{N : Type u_20}
[Semiring R]
[Semiring S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Module S M]
[Module S N]
[LinearMap.CompatibleSMul M N R S]
(f g : M →ₗ[S] N)


@[to_additive]
theorem prod_range [CommMonoid β] {n : ℕ} (f : ℕ → β) :
    ∏ i ∈ Finset.range n, f i = ∏ i : Fin n, f i

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

∏ i ∈ Finset.range n, f i = ∏ i : Fin n, f ↑i


/-- Transfer `Nontrivial` across an `Equiv` -/
protected theorem nontrivial [Nontrivial β] : Nontrivial α

{α : Type u}
{β : Type v}
(e : α ≃ β)
[Nontrivial β]


@[simp]
theorem sumInv_apply (x : AdicCompletion I (⨁ j, M j)) (j : ι) :
    (sumInv I M x) j = map I (component R ι _ j) x

(x : AdicCompletion I (DirectSum ι fun j => M j))

((AdicCompletion.sumInv I M) x) j = (AdicCompletion.map I (DirectSum.component R ι M j)) x


lemma Equiv.isSMulRegular_congr {R S M M'} [SMul R M] [SMul S M'] {e : M ≃ M'}
    {r : R} {s : S} (h : ∀ x, e (r • x) = s • e x) :
    IsSMulRegular M r ↔ IsSMulRegular M' s

{R : Type u_4}
{S : Type u_5}
{M : Type u_6}
{M' : Type u_7}
[SMul R M]
[SMul S M']
{e : M ≃ M'}
{r : R}
{s : S}
(h : ∀ (x : M), e (r • x) = s • e x)


@[to_additive (attr := simp)]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [FunLike G β γ] [MonoidHomClass G β γ]
    (g : G) (f : α → β) (s : Finset α) : g (∏ x ∈ s, f x) = ∏ x ∈ s, g (f x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid β]
[AddCommMonoid γ]
{G : Type u_6}
[FunLike G β γ]
[AddMonoidHomClass G β γ]
(g : G)
(f : α → β)
(s : Finset α)


@[simp]
theorem mem_inf : x ∈ s ⊓ t ↔ x ∈ s ∧ x ∈ t

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A : Set M}
{α : Type u₁}
{s t : L.DefinableSet A α}
{x : α → M}


/-- A `HomRel` is a congruence when it's an equivalence on every hom-set, and it can be composed
from left and right. -/
class Congruence : Prop where
  /-- `r` is an equivalence on every hom-set. -/
  equivalence : ∀ {X Y}, _root_.Equivalence (@r X Y)
  /-- Precomposition with an arrow respects `r`. -/
  compLeft : ∀ {X Y Z} (f : X ⟶ Y) {g g' : Y ⟶ Z}, r g g' → r (f ≫ g) (f ≫ g')
  /-- Postcomposition with an arrow respects `r`. -/
  compRight : ∀ {X Y Z} {f f' : X ⟶ Y} (g : Y ⟶ Z), r f f' → r (f ≫ g) (f' ≫ g)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{r : HomRel C}
[self : CategoryTheory.Congruence r]
{X Y : C}


@[simp]
protected theorem comp_val {x y z : ActionCategory M X} (f : x ⟶ y) (g : y ⟶ z) :
    (f ≫ g).val = g.val * f.val

{x y z : CategoryTheory.ActionCategory M X}

↑(CategoryTheory.CategoryStruct.comp f g) = ↑g * ↑f


@[simp]
lemma dualCoannihilator_range_eq_ker_flip (B : M →ₗ[R] M' →ₗ[R] R) :
    (range B).dualCoannihilator = LinearMap.ker B.flip

{R : Type u_1}
{M : Type u_2}
{M' : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
(B : M →ₗ[R] M' →ₗ[R] R)

(LinearMap.range B).dualCoannihilator = LinearMap.ker B.flip


@[simp]
theorem preimage_mul_const_Ioi (a : α) {c : α} (h : 0 < c) :
    (fun x => x * c) ⁻¹' Ioi a = Ioi (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a : α)
{c : α}
(h : 0 < c)

(fun x => x * c) ⁻¹' Set.Ioi a = Set.Ioi (a / c)


theorem image_coe_Ioc : (some : α → WithTop α) '' Ioc a b = Ioc (a : WithTop α) b

WithTop.some '' Set.Ioc a b = Set.Ioc ↑a ↑b


theorem summable_of_ratio_test_tendsto_lt_one {α : Type*} [NormedAddCommGroup α] [CompleteSpace α]
    {f : ℕ → α} {l : ℝ} (hl₁ : l < 1) (hf : ∀ᶠ n in atTop, f n ≠ 0)
    (h : Tendsto (fun n ↦ ‖f (n + 1)‖ / ‖f n‖) atTop (𝓝 l)) : Summable f

(hf : ∀ᶠ (n : ℕ) in Filter.atTop, f n ≠ 0)

(h : Filter.Tendsto (fun n => ‖f (n + 1)‖ / ‖f n‖) Filter.atTop (𝓝 l))


theorem isClosed_range_toBCF : IsClosed (range (toBCF : C₀(α, β) → α →ᵇ β))

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]


theorem map₂_mono (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) : map₂ m f₁ g₁ ≤ map₂ m f₂ g₂

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{f₁ f₂ : Filter α}
{g₁ g₂ : Filter β}
(hf : f₁ ≤ f₂)
(hg : g₁ ≤ g₂)

Filter.map₂ m f₁ g₁ ≤ Filter.map₂ m f₂ g₂


/-- We can also build a morphism in the arrow category out of any commutative square in `T`. -/
@[simps]
def homMk' {X Y : T} {f : X ⟶ Y} {P Q : T} {g : P ⟶ Q} {u : X ⟶ P} {v : Y ⟶ Q} (w : u ≫ g = f ≫ v) :
    Arrow.mk f ⟶ Arrow.mk g

(w : CategoryTheory.CategoryStruct.comp u g = CategoryTheory.CategoryStruct.comp f v)

(CategoryTheory.Arrow.homMk' w).left = u


theorem totient_eq_card_coprime (n : ℕ) : φ n = ((range n).filter n.Coprime).card

n.totient = (Finset.filter n.Coprime (Finset.range n)).card


@[to_additive subset_addCentralizer_addCentralizer]
lemma subset_centralizer_centralizer : S ⊆ S.centralizer.centralizer


theorem rel_of_quot_rel (x y : Σ j, F.obj j) :
    Quot.Rel F x y → FilteredColimit.Rel.{v, u} F x y

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
(x y : (j : J) × F.obj j)

CategoryTheory.Limits.Types.Quot.Rel F x y → CategoryTheory.Limits.Types.FilteredColimit.Rel F x y


/-- **Maximum principle** for convex functions on an interval. If a function `f` is convex on the
interval `[x, y]`, then the eventual maximum of `f` on `[x, y]` is at `x` or `y`. -/
lemma ConvexOn.le_max_of_mem_Icc {f : 𝕜 → β} {x y z : 𝕜} (hf : ConvexOn 𝕜 (Icc x y) f)
    (hz : z ∈ Icc x y) : f z ≤ max (f x) (f y)

{𝕜 : Type u_1}
{β : Type u_4}
[LinearOrderedField 𝕜]
[LinearOrderedAddCommGroup β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{f : 𝕜 → β}
{x y z : 𝕜}
(hf : ConvexOn 𝕜 (Set.Icc x y) f)
(hz : z ∈ Set.Icc x y)


theorem neg_sub {X Y : C} (a b : X ⟶ Y) : -a - b = -b - a


/-- Projecting and then lifting a quotient recovers the original quotient, because there is at most
    one morphism making the projected quotient into a costructured arrow. -/
theorem lift_projectQuotient [HasColimits C] [PreservesColimits S] {A : CostructuredArrow S T} :
    ∀ (P : Subobject (op A)) {q} (hq : S.map (projectQuotient P).arrow.unop ≫ q = A.hom),
      liftQuotient (projectQuotient P) hq = P

{A : CategoryTheory.CostructuredArrow S T}

(P : CategoryTheory.Subobject (Opposite.op A))

{q :
  S.obj (Opposite.unop (CategoryTheory.Subobject.underlying.obj (CategoryTheory.CostructuredArrow.projectQuotient P))) ⟶
    (CategoryTheory.Functor.fromPUnit T).obj A.right}

(hq :
  CategoryTheory.CategoryStruct.comp (S.map (CategoryTheory.CostructuredArrow.projectQuotient P).arrow.unop) q = A.hom)

CategoryTheory.CostructuredArrow.liftQuotient (CategoryTheory.CostructuredArrow.projectQuotient P) hq = P


theorem StarConvex.neg (hs : StarConvex 𝕜 x s) : StarConvex 𝕜 (-x) (-s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x : E}
{s : Set E}
(hs : StarConvex 𝕜 x s)


@[simp] protected lemma bot : EventuallyConst f ⊥

{α : Type u_1}
{β : Type u_2}
{f : α → β}


theorem edist_efixedPoint_le (hf : ContractingWith K f) {x : α} (hx : edist x (f x) ≠ ∞) :
    edist x (efixedPoint f hf x hx) ≤ edist x (f x) / (1 - K)

{α : Type u_1}
[EMetricSpace α]
[cs : CompleteSpace α]
{K : ℝ≥0}
{f : α → α}
(hf : ContractingWith K f)
{x : α}
(hx : edist x (f x) ≠ ⊤)

edist x (ContractingWith.efixedPoint f hf x hx) ≤ edist x (f x) / (1 - ↑K)


lemma indicator_smul_apply_left (s : Set α) (r : α → R) (f : α → M) (a : α) :
    indicator s (fun a ↦ r a • f a) a = indicator s r a • f a

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Zero R]
[Zero M]
[SMulWithZero R M]
(s : Set α)
(r : α → R)
(f : α → M)
(a : α)

s.indicator (fun a => r a • f a) a = s.indicator r a • f a


theorem inducedMap_nonneg (ha : 0 ≤ a) : 0 ≤ inducedMap α β a


theorem integralSum_biUnionTagged (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : Prepartition I)
    (πi : ∀ J, TaggedPrepartition J) :
    integralSum f vol (π.biUnionTagged πi) = ∑ J ∈ π.boxes, integralSum f vol (πi J)

(πi : (J : BoxIntegral.Box ι) → BoxIntegral.TaggedPrepartition J)

BoxIntegral.integralSum f vol (π.biUnionTagged πi) = ∑ J ∈ π.boxes, BoxIntegral.integralSum f vol (πi J)


@[ext]
theorem ext {f g : A₁ ≃ₐ[R] A₂} (h : ∀ a, f a = g a) : f = g

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{f g : A₁ ≃ₐ[R] A₂}
(h : ∀ (a : A₁), f a = g a)


theorem upperBounds_l_image (gc : GaloisConnection l u) (s : Set α) :
    upperBounds (l '' s) = u ⁻¹' upperBounds s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
(s : Set α)


@[simp]
theorem lift.tmul (x y) : lift f (x ⊗ₜ y) = f x y

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N →ₗ[R] P}
(x : M)
(y : N)

(TensorProduct.lift f) (x ⊗ₜ[R] y) = (f x) y


theorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{r : Rˣ}
{a : Aˣ}

↑r ∈ spectrum R ↑a ↔ ↑r⁻¹ ∈ spectrum R ↑a⁻¹


/-- A subset of `ℕ` containing `k : ℕ` and closed under `Nat.succ` contains every `n ≥ k`. -/
lemma set_induction_bounded {S : Set ℕ} (hk : k ∈ S) (h_ind : ∀ k : ℕ, k ∈ S → k + 1 ∈ S)
    (hnk : k ≤ n) : n ∈ S

{n k : ℕ}
{S : Set ℕ}
(hk : k ∈ S)
(h_ind : ∀ (k : ℕ), k ∈ S → k + 1 ∈ S)
(hnk : k ≤ n)


theorem Ideal.minimalPrimes_eq_subsingleton_self [I.IsPrime] : I.minimalPrimes = {I}

{R : Type u_1}
[CommRing R]
{I : Ideal R}
[I.IsPrime]


/-- A `ModuleFilterBasis` on a module is a `FilterBasis` satisfying some additional axioms.
  Example : if `M` is a topological module then the neighbourhoods of zero are a
  `ModuleFilterBasis`. Conversely given a `ModuleFilterBasis` one can define a topology
  compatible with the module structure on `M`. -/
structure ModuleFilterBasis (R M : Type*) [CommRing R] [TopologicalSpace R] [AddCommGroup M]
  [Module R M] extends AddGroupFilterBasis M where
  smul' : ∀ {U}, U ∈ sets → ∃ V ∈ 𝓝 (0 : R), ∃ W ∈ sets, V • W ⊆ U
  smul_left' : ∀ (x₀ : R) {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x₀ • x) ⁻¹' U
  smul_right' : ∀ (m₀ : M) {U}, U ∈ sets → ∀ᶠ x in 𝓝 (0 : R), x • m₀ ∈ U

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[TopologicalSpace R]
[AddCommGroup M]
[Module R M]
(self : ModuleFilterBasis R M)
{U : Set M}

U ∈ AddGroupFilterBasis.toFilterBasis.sets → ∃ V ∈ 𝓝 0, ∃ W ∈ AddGroupFilterBasis.toFilterBasis.sets, V • W ⊆ U


theorem isCycle_finRotate {n : ℕ} : IsCycle (finRotate (n + 2))


/-- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
where the connected assumption is used.
-/
@[simps]
def raiseCone [IsConnected J] {B : C} {F : J ⥤ Over B} (c : Cone (F ⋙ forget B)) :
    Cone F

(c : CategoryTheory.Limits.Cone (F ⋙ CategoryTheory.Over.forget B))

(CategoryTheory.Over.CreatesConnected.raiseCone c).π.app j = CategoryTheory.Over.homMk (c.π.app j) ⋯


/-- Note the `AddSubmonoid` version of this lemma is called `AddSubmonoid.coe_finset_sum`. -/
-- Porting note: removing the `@[simp]` attribute since it's literally `AddSubmonoid.coe_finset_sum`
theorem coe_sum (x : ι → p) (s : Finset ι) : ↑(∑ i ∈ s, x i) = ∑ i ∈ s, (x i : M)

{R : Type u}
{M : Type v}
{ι : Type w}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
(x : ι → ↥p)
(s : Finset ι)


theorem realize_equivSentence_symm (φ : L[[α]].Sentence) (v : α → M) :
    (equivSentence.symm φ).Realize v ↔
      @Sentence.Realize _ M (@Language.withConstantsStructure L M _ α (constantsOn.structure v))
        φ

{L : FirstOrder.Language}
(M : Type w)
[L.Structure M]
{α : Type u'}
(φ : (L.withConstants α).Sentence)
(v : α → M)

(FirstOrder.Language.Formula.equivSentence.symm φ).Realize v ↔ M ⊨ φ


@[to_additive (attr := simp)]
theorem mulRight_symm (a : G) : (Equiv.mulRight a).symm = Equiv.mulRight a⁻¹

Equiv.symm (Equiv.addRight a) = Equiv.addRight (-a)


@[to_additive]
theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x ∈ s, f x ^ n = (∏ x ∈ s, f x) ^ n

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
(s : Finset α)
(n : ℕ)
(f : α → β)


@[simp]
theorem count_false_add_count_true (l : List Bool) : count false l + count true l = length l

List.count false l + List.count true l = l.length


@[simp]
lemma forget₂_module_map {X Y : AlgebraCat.{v} R} (f : X ⟶ Y) :
    (forget₂ (AlgebraCat.{v} R) (ModuleCat.{v} R)).map f = ModuleCat.ofHom f.toLinearMap

(R : Type u)
[CommRing R]
{X Y : AlgebraCat R}
(f : X ⟶ Y)

(CategoryTheory.forget₂ (AlgebraCat R) (ModuleCat R)).map f = ModuleCat.ofHom (AlgHom.toLinearMap f)


@[to_additive]
theorem iff_card_le_one [DecidableEq G] (ha0 : a0 ∈ A) (hb0 : b0 ∈ B) :
    UniqueMul A B a0 b0 ↔ ((A ×ˢ B).filter (fun p ↦ p.1 * p.2 = a0 * b0)).card ≤ 1

{G : Type u_1}
[Mul G]
{A B : Finset G}
{a0 b0 : G}
[DecidableEq G]
(ha0 : a0 ∈ A)
(hb0 : b0 ∈ B)

UniqueMul A B a0 b0 ↔ (Finset.filter (fun p => p.1 * p.2 = a0 * b0) (A ×ˢ B)).card ≤ 1


theorem of_null_left (h : μ s = 0) : AEDisjoint μ s t

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(h : μ s = 0)


@[simp]
lemma comp_units_smul {X Y Z : C} (f : X ⟶ Y) (r : Rˣ) (g : Y ⟶ Z) :
    f ≫ (r • g) = r • f ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{R : Type w}
[Semiring R]
[CategoryTheory.Linear R C]
{X Y Z : C}
(f : X ⟶ Y)
(r : Rˣ)
(g : Y ⟶ Z)


lemma pow_eq_pow_iff_cases : a ^ n = b ^ n ↔ n = 0 ∨ a = b ∨ a = -b ∧ Even n

{R : Type u_2}
[LinearOrderedRing R]
{a b : R}
{n : ℕ}


/-- Bijection between a subalgebra `S` and its opposite. -/
@[simps!]
def linearEquivOp (S : Subalgebra R A) : S ≃ₗ[R] S.op

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)

∀ (a : ↥S.toSubsemiring), ↑(S.linearEquivOp a) = MulOpposite.op ↑a


protected lemma ge_of_eq (hab : a = b) : b ≤ a


theorem eq_nilFun {α β : TypeVec 0} (f : α ⟹ β) : f = nilFun

{α : TypeVec.{u_1} 0}
{β : TypeVec.{u_2} 0}
(f : α.Arrow β)


@[simp] theorem unzip_replicate {n : Nat} {a : α} {b : β} :
    unzip (replicate n (a, b)) = (replicate n a, replicate n b)

{α : Type u_1}
{β : Type u_2}
{n : Nat}
{a : α}
{b : β}

(List.replicate n (a, b)).unzip = (List.replicate n a, List.replicate n b)


lemma Fin.addRothNumber_le_rothNumberNat (k n : ℕ) (hkn : k ≤ n) :
    addRothNumber (Iio k : Finset (Fin n.succ)) ≤ rothNumberNat k

addRothNumber (Finset.Iio ↑k) ≤ rothNumberNat k


@[deprecated (since := "2024-04-02")]
theorem Set.restrictPreimage_isClosedMap (s : Set β) (H : IsClosedMap f) :
    IsClosedMap (s.restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(s : Set β)
(H : IsClosedMap f)


theorem eq_one_div_of_mul_eq_one_right (I J : FractionalIdeal R₁⁰ K) (h : I * J = 1) :
    J = 1 / I

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
(I J : FractionalIdeal R₁⁰ K)
(h : I * J = 1)


/-- Two points are concyclic. -/
theorem concyclic_pair (p₁ p₂ : P) : Concyclic ({p₁, p₂} : Set P)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p₁ p₂ : P)


@[simp]
theorem codeSupp_comp (f g k) :
    codeSupp (Code.comp f g) k =
      trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k)

(f g : Turing.ToPartrec.Code)
(k : Turing.PartrecToTM2.Cont')

Turing.PartrecToTM2.codeSupp (f.comp g) k =
  Turing.PartrecToTM2.trStmts₁ (Turing.PartrecToTM2.trNormal (f.comp g) k) ∪
    Turing.PartrecToTM2.codeSupp g (Turing.PartrecToTM2.Cont'.comp f k)


theorem Ideal.le_mul_of_no_prime_factors {I J K : Ideal R}
    (coprime : ∀ P, J ≤ P → K ≤ P → ¬IsPrime P) (hJ : I ≤ J) (hK : I ≤ K) : I ≤ J * K

(coprime : ∀ (P : Ideal R), J ≤ P → K ≤ P → ¬P.IsPrime)


/-- The unit for the equivalence `Comon_ (C ⥤ D) ≌ C ⥤ Comon_ D`.
-/
@[simps!]
private def unitIso : 𝟭 (Comon_ (C ⥤ D)) ≅ functor ⋙ inverse

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

∀ (x : C), (CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.unitIso.inv.app X).hom.app x = 𝟙 (X.X.obj x)


@[reassoc (attr := simp)]
lemma pOpcycles_opcyclesToCycles :
    K.pOpcycles i ≫ K.opcyclesToCycles i j = K.toCycles i j


theorem insert_neg [DecidableEq α] {x : α} {l : List α} (h : x ∉ l) :
    Insert.insert x l = x :: l

{α : Type u}
[DecidableEq α]
{x : α}
{l : List α}
(h : ¬x ∈ l)


/-- The map constructed using the universal property gives back the original maps when
restricted to each component. -/
@[simp]
theorem toModule_lof (i) (x : M i) : toModule R ι N φ (lof R ι M i x) = φ i x

(R : Type u)
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
{N : Type u₁}
[AddCommMonoid N]
[Module R N]
{φ : (i : ι) → M i →ₗ[R] N}
(i : ι)
(x : M i)

(DirectSum.toModule R ι N φ) ((DirectSum.lof R ι M i) x) = (φ i) x


theorem mk_subtype_mono {p q : α → Prop} (h : ∀ x, p x → q x) :
    #{ x // p x } ≤ #{ x // q x }

{α : Type u}
{p q : α → Prop}
(h : ∀ (x : α), p x → q x)

Cardinal.mk { x // p x } ≤ Cardinal.mk { x // q x }


/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : Kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x

{α : Type u_1}
{Ω : Type u_3}
{mα : MeasurableSpace α}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{ρ : MeasureTheory.Measure (α × Ω)}
[MeasureTheory.IsFiniteMeasure ρ]
(κ : ProbabilityTheory.Kernel α Ω)
[ProbabilityTheory.IsFiniteKernel κ]
(hκ : ρ = ρ.fst ⊗ₘ κ)


/-- Coproduct of two `MulHom`s with the same codomain with `Commute` assumption:
  `f.noncommCoprod g _ (p : M × N) = f p.1 * g p.2`.
  (For the commutative case, use `MulHom.coprod`) -/
@[to_additive (attr := simps)
    "Coproduct of two `AddHom`s with the same codomain with `AddCommute` assumption:
    `f.noncommCoprod g _ (p : M × N) = f p.1 + g p.2`.
    (For the commutative case, use `AddHom.coprod`)"]
def noncommCoprod (comm : ∀ m n, Commute (f m) (g n)) : M × N →ₙ* P

(comm : ∀ (m : M) (n : N), Commute (f m) (g n))

(f.noncommCoprod g comm) mn = f mn.1 * g mn.2


@[simp]
theorem coe_eq_zero : (q : ℚ) = 0 ↔ q = 0


theorem SatisfiesM_foldlM [Monad m] [LawfulMonad m]
    {as : Array α} (motive : Nat → β → Prop) {init : β} (h0 : motive 0 init) {f : β → α → m β}
    (hf : ∀ i : Fin as.size, ∀ b, motive i.1 b → SatisfiesM (motive (i.1 + 1)) (f b as[i])) :
    SatisfiesM (motive as.size) (as.foldlM f init)

{f : β → α → m β}

(hf : ∀ (i : Fin as.size) (b : β), motive (↑i) b → SatisfiesM (motive (↑i + 1)) (f b as[i]))

SatisfiesM (motive as.size) (Array.foldlM.loop f as as.size ⋯ i j b)


lemma Set.Iic.isCompl_inf_inf_of_isCompl_of_le [Lattice α] [BoundedOrder α] [IsModularLattice α]
    {a b c : α} (h₁ : IsCompl b c) (h₂ : b ≤ a) :
    IsCompl (⟨a ⊓ b, inf_le_left⟩ : Iic a) (⟨a ⊓ c, inf_le_left⟩ : Iic a)

{α : Type u_1}
[Lattice α]
[BoundedOrder α]
[IsModularLattice α]
{a b c : α}
(h₁ : IsCompl b c)
(h₂ : b ≤ a)


/-- See note [fact non-instances]. -/
theorem fact_irreducible_factor (f : K[X]) : Fact (Irreducible (factor f))


theorem associated_of_dvd_dvd [CancelMonoidWithZero α] {a b : α} (hab : a ∣ b) (hba : b ∣ a) :
    a ~ᵤ b

{α : Type u_1}
[CancelMonoidWithZero α]
{a b : α}
(hab : a ∣ b)
(hba : b ∣ a)


/-- A prelaxfunctor `F` sends 2-isomorphisms `η : f ≅ f` to 2-isomorphisms `F.map f ≅ F.map g`. -/
@[simps!]
abbrev map₂Iso {f g : a ⟶ b} (η : f ≅ g) : F.map f ≅ F.map g

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.PrelaxFunctor B C)
{a b : B}
{f g : a ⟶ b}
(η : f ≅ g)


@[simp] lemma rpow_inv_rpow {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0) : (x ^ y⁻¹) ^ y = x


theorem image_map_comp_imageSubobjectIso_inv {W X Y Z : C} {f : W ⟶ X} [HasImage f] {g : Y ⟶ Z}
    [HasImage g] (sq : Arrow.mk f ⟶ Arrow.mk g) [HasImageMap sq] :
    image.map sq ≫ (imageSubobjectIso _).inv =
      (imageSubobjectIso _).inv ≫ imageSubobjectMap sq

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

CategoryTheory.Limits.image.map sq ≫ (CategoryTheory.Limits.imageSubobjectIso (CategoryTheory.Arrow.mk g).hom).inv =
  (CategoryTheory.Limits.imageSubobjectIso f).inv ≫ CategoryTheory.Limits.imageSubobjectMap sq


/-- Composition by a fixed right argument as an `R`-linear map. -/
@[simps]
def rightComp (X : C) {Y Z : C} (g : Y ⟶ Z) : (X ⟶ Y) →ₗ[R] X ⟶ Z

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(R : Type w)
[Semiring R]
[CategoryTheory.Linear R C]
(X : C)
{Y Z : C}
(g : Y ⟶ Z)
(f : X ⟶ Y)

(CategoryTheory.Linear.rightComp R X g) f = f ≫ g


@[simp]
theorem isDiag_conjTranspose_iff [Semiring α] [StarRing α] {A : Matrix n n α} :
    Aᴴ.IsDiag ↔ A.IsDiag

{α : Type u_1}
{n : Type u_4}
[Semiring α]
[StarRing α]
{A : Matrix n n α}


@[simp]
theorem _root_.AddSubgroup.toSubgroup_comap {A A₂ : Type*} [AddGroup A] [AddGroup A₂]
    (f : A →+ A₂)  (s : AddSubgroup A₂) :
    s.toSubgroup.comap (AddMonoidHom.toMultiplicative f) = AddSubgroup.toSubgroup (s.comap f)

{A : Type u_7}
{A₂ : Type u_8}
[AddGroup A]
[AddGroup A₂]
(f : A →+ A₂)
(s : AddSubgroup A₂)

Subgroup.comap (AddMonoidHom.toMultiplicative f) (AddSubgroup.toSubgroup s) =
  AddSubgroup.toSubgroup (AddSubgroup.comap f s)


theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y ∈ cylinder x n

{E : ℕ → Type u_1}
(x : (n : ℕ) → E n)
(n : ℕ)
(y : E n)

Function.update x n y ∈ PiNat.cylinder x n


@[to_additive (attr := simp)]
theorem toTopologicalSpace_inf (x y : GroupTopology α) :
    (x ⊓ y).toTopologicalSpace = x.toTopologicalSpace ⊓ y.toTopologicalSpace

{α : Type u}
[AddGroup α]
(x y : AddGroupTopology α)


theorem Iio_union_right : Iio a ∪ {a} = Iic a


theorem destutter'_is_chain : ∀ l : List α, ∀ {a b}, R a b → (l.destutter' R b).Chain R a

{α : Type u_1}
(R : α → α → Prop)
[DecidableRel R]
(l : List α)
{a b : α}

R a b → List.Chain R a (List.destutter' R b l)


theorem contravariant_lt_of_contravariant_le [PartialOrder N] :
    Contravariant M N μ (· ≤ ·) → Contravariant M N μ (· < ·)

(M : Type u_1)
(N : Type u_2)
(μ : M → N → N)
[PartialOrder N]

(Contravariant M N μ fun x x_1 => x ≤ x_1) → Contravariant M N μ fun x x_1 => x < x_1


@[simp]
theorem lift_apply (g : M →ₗ[R] M'') (h) (x) :
    lift S f g h (f x) = g x

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

(IsLocalizedModule.lift S f g h) (f x) = g x


@[simp] lemma map_ground (M : Matroid α) (f : α → β) (hf) : (M.map f hf).E = f '' M.E

{α : Type u_1}
{β : Type u_2}
(M : Matroid α)
(f : α → β)
(hf : Set.InjOn f M.E)


lemma piecewise_apply {β : Type*} {f : ι → α → β} (x : α) : hs.piecewise f x = f (hs.index x) x

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
{β : Type u_3}
{f : ι → α → β}
(x : α)


@[to_additive (attr := simp)]
theorem Prime.prod_divisors {α : Type*} [CommMonoid α] {p : ℕ} {f : ℕ → α} (h : p.Prime) :
    ∏ x ∈ p.divisors, f x = f p * f 1

{α : Type u_1}
[AddCommMonoid α]
{p : ℕ}
{f : ℕ → α}
(h : Nat.Prime p)


theorem injective_of_mono {X Y : Type u} (f : X ⟶ Y) [hf : Mono f] : Function.Injective f

{X Y : Type u}
(f : X ⟶ Y)
[hf : CategoryTheory.Mono f]


theorem eventually_prod_iff {p : α × β → Prop} :
    (∀ᶠ x in f ×ˢ g, p x) ↔
      ∃ pa : α → Prop, (∀ᶠ x in f, pa x) ∧ ∃ pb : β → Prop, (∀ᶠ y in g, pb y) ∧
        ∀ {x}, pa x → ∀ {y}, pb y → p (x, y)

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}
{p : α × β → Prop}

(∀ᶠ (x : α × β) in f ×ˢ g, p x) ↔
  ∃ pa, (∀ᶠ (x : α) in f, pa x) ∧ ∃ pb, (∀ᶠ (y : β) in g, pb y) ∧ ∀ {x : α}, pa x → ∀ {y : β}, pb y → p (x, y)


@[simp]
theorem closure_union_closure_right (x y : α) : l (x ∪ l y) = l (x ∪ y)

{α : Type u_1}
{β : Type u_4}
[SetLike α β]
(l : LowerAdjoint SetLike.coe)
(x y : α)

l.toFun (↑x ∪ ↑(l.toFun ↑y)) = l.toFun (↑x ∪ ↑y)


@[simp]
theorem nnnorm_natCast (n : ℕ) : ‖(n : ℝ)‖₊ = n


/-- Let `L/E/K` be a tower of fields with `E/K` finite. Then `Gal(L/E)` is an open subgroup of
  `L ≃ₐ[K] L`. -/
theorem IntermediateField.fixingSubgroup_isOpen {K L : Type*} [Field K] [Field L] [Algebra K L]
    (E : IntermediateField K L) [FiniteDimensional K E] :
    IsOpen (E.fixingSubgroup : Set (L ≃ₐ[K] L))

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


lemma strictMono_pred_comp (hf : ∀ a, f a ≠ 0) (hf₂ : StrictMono f) :
    StrictMono (fun a => pred (f a) (hf a))

{n : ℕ}
{α : Type u_1}
[Preorder α]
{f : α → Fin (n + 1)}
(hf : ∀ (a : α), f a ≠ 0)
(hf₂ : StrictMono f)


theorem cos_sq : cos x ^ 2 = 1 / 2 + cos (2 * x) / 2

Complex.cos x ^ 2 = 1 / 2 + Complex.cos (2 * x) / 2


theorem isLittleO_const_iff {c : F''} (hc : c ≠ 0) :
    (f'' =o[l] fun _x => c) ↔ Tendsto f'' l (𝓝 0)

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{l : Filter α}
{c : F''}
(hc : c ≠ 0)

(f'' =o[l] fun _x => c) ↔ Filter.Tendsto f'' l (𝓝 0)


@[simp]
theorem toLinearMap_eq_coe (f : A →ₗc[R] B) : f.toLinearMap = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₗc[R] B)


theorem IsCompactOperator.isCompact_closure_image_of_bounded [ContinuousConstSMul 𝕜₂ M₂]
    [T2Space M₂] {f : M₁ →ₛₗ[σ₁₂] M₂} (hf : IsCompactOperator f) {S : Set M₁}
    (hS : Bornology.IsBounded S) : IsCompact (closure <| f '' S)

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[SeminormedRing 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
{M₁ : Type u_3}
{M₂ : Type u_4}
[SeminormedAddCommGroup M₁]
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[NormedSpace 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[ContinuousConstSMul 𝕜₂ M₂]
[T2Space M₂]
{f : M₁ →ₛₗ[σ₁₂] M₂}
(hf : IsCompactOperator ⇑f)
{S : Set M₁}
(hS : Bornology.IsBounded S)