/-- A Type `R` is a `CompatibleRing` if it is a structure for the language of rings and this
structure is the same as the structure already given on `R` by the classes `Add`, `Mul` etc.

It is recommended to use this type class as a hypothesis to any theorem whose statement
requires a type to have be both a `Ring` (or `Field` etc.) and a
`Language.ring.Structure`  -/
/- This class does not extend `Add` etc, because this way it can be used in
combination with a `Ring`, or `Field` instance without having multiple different
`Add` structures on the Type. -/
class CompatibleRing (R : Type*) [Add R] [Mul R] [Neg R] [One R] [Zero R]
    extends Language.ring.Structure R where
  /-- Addition in the `Language.ring.Structure` is the same as the addition given by the
    `Add` instance -/
  funMap_add : ∀ x, funMap addFunc x = x 0 + x 1
  /-- Multiplication in the `Language.ring.Structure` is the same as the multiplication given by the
    `Mul` instance -/
  funMap_mul : ∀ x, funMap mulFunc x = x 0 * x 1
  /-- Negation in the `Language.ring.Structure` is the same as the negation given by the
    `Neg` instance -/
  funMap_neg : ∀ x, funMap negFunc x = -x 0
  /-- The constant `0` in the `Language.ring.Structure` is the same as the constant given by the
    `Zero` instance -/
  funMap_zero : ∀ x, funMap (zeroFunc : Language.ring.Constants) x = 0
  /-- The constant `1` in the `Language.ring.Structure` is the same as the constant given by the
    `One` instance -/
  funMap_one : ∀ x, funMap (oneFunc : Language.ring.Constants) x = 1

[self : FirstOrder.Ring.CompatibleRing R]

FirstOrder.Language.Structure.funMap FirstOrder.Ring.oneFunc x = 1


theorem nhds_coe {r : ℝ} : 𝓝 (r : EReal) = (𝓝 r).map (↑)


theorem le_iff : v ≤ w ↔ ∀ i, MeasurableSet i → v i ≤ w i

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[TopologicalSpace M]
[AddCommMonoid M]
[PartialOrder M]
{v w : MeasureTheory.VectorMeasure α M}

v ≤ w ↔ ∀ (i : Set α), MeasurableSet i → ↑v i ≤ ↑w i


theorem span_singleton_mul_left_injective [IsDomain R] {x : R} (hx : x ≠ 0) :
    Function.Injective fun I : Ideal R => I * span {x}

{R : Type u}
[CommSemiring R]
[IsDomain R]
{x : R}
(hx : x ≠ 0)

Function.Injective fun I => I * Ideal.span {x}


@[to_additive exists_addOrderOf_eq_pow_padic_val_nat_add_exponent]
theorem _root_.Nat.Prime.exists_orderOf_eq_pow_factorization_exponent {p : ℕ} (hp : p.Prime) :
    ∃ g : G, orderOf g = p ^ (exponent G).factorization p

(G : Type u)
[Monoid G]
{p : ℕ}
(hp : Nat.Prime p)

∃ g, orderOf g = p ^ (Monoid.exponent G).factorization p


theorem inner_neg_right (x y : F) : ⟪x, -y⟫ = -⟪x, y⟫

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y : F)


theorem qp_eq (hr : u.r = 0) : u.q = u.qp + 1


/-- `HasLiftingProperty i p` means that `i` has the left lifting
property with respect to `p`, or equivalently that `p` has
the right lifting property with respect to `i`. -/
class HasLiftingProperty : Prop where
  /-- Unique field expressing that any commutative square built from `f` and `g` has a lift -/
  sq_hasLift : ∀ {f : A ⟶ X} {g : B ⟶ Y} (sq : CommSq f i p g), sq.HasLift

[self : CategoryTheory.HasLiftingProperty i p]


@[to_additive (attr := simp 1100, norm_cast)]
theorem val_list_prod (l : List H) : (l.prod : G) = (l.map Subtype.val).prod

{G : Type u_1}
[Group G]
(H : Subgroup G)
(l : List ↥H)


@[to_additive (attr := simp) prod_eq_bot_iff]
theorem prod_eq_bot_iff {H : Subgroup G} {K : Subgroup N} : H.prod K = ⊥ ↔ H = ⊥ ∧ K = ⊥

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{H : Subgroup G}
{K : Subgroup N}


theorem vsub_ne_zero {p q : P} : p -ᵥ q ≠ (0 : G) ↔ p ≠ q

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
{p q : P}


lemma succ_neg_natCast_succ (n : ℕ) : succ (-Nat.succ n) = -n


theorem smul_Ioi : r • Ioi a = Ioi (r • a)

{K : Type u_2}
[LinearOrderedField K]
{a r : K}
(hr : 0 < r)


/-- The space of constant maps is equivalent to the space of maps that are multilinear with respect
to an empty family. -/
@[simps]
def constLinearEquivOfIsEmpty [IsEmpty ι] : M₂ ≃ₗ[S] MultilinearMap R M₁ M₂

(R : Type uR)
(S : Type uS)
{ι : Type uι}
(M₁ : ι → Type v₁)
(M₂ : Type v₂)
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[(i : ι) → Module R (M₁ i)]
[AddCommMonoid M₂]
[Module R M₂]
[Semiring S]
[Module S M₂]
[SMulCommClass R S M₂]
[IsEmpty ι]
(f : MultilinearMap R M₁ M₂)

(MultilinearMap.constLinearEquivOfIsEmpty R S M₁ M₂).symm f = f 0


theorem Codisjoint.himp_inf_cancel_left (h : Codisjoint a b) : b ⇨ a ⊓ b = a

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b : α}
(h : Codisjoint a b)


/-- In a semigroup, the product of right-regular elements is right-regular. -/
@[to_additive "In an additive semigroup, the sum of add-right-regular elements is
add-right-regular."]
theorem IsRightRegular.mul (rra : IsRightRegular a) (rrb : IsRightRegular b) :
    IsRightRegular (a * b)

{R : Type u_1}
[AddSemigroup R]
{a b : R}
(rra : IsAddRightRegular a)
(rrb : IsAddRightRegular b)


@[simp]
theorem coe_comp : (f.compDer D : A → N) = (f : M →ₗ[R] N).comp (D : A →ₗ[R] M)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
{N : Type u_5}
[AddCommMonoid N]
[Module A N]
[Module R N]
[IsScalarTower R A M]
[IsScalarTower R A N]
(f : M →ₗ[A] N)


theorem let_congr {α : Sort u} {β : Sort v} {a a' : α} {b b' : α → β}
    (h₁ : a = a') (h₂ : ∀ x, b x = b' x) : (let x := a; b x) = (let x := a'; b' x)

{α : Sort u}
{β : Sort v}
{a a' : α}
{b b' : α → β}
(h₁ : a = a')
(h₂ : ∀ (x : α), b x = b' x)

(let x := a;
  b x) =
  let x := a';
  b' x


/-- The equivalence between `RingHom` and `ℚ`-algebra homomorphisms. -/
@[simps]
def RingHom.equivRatAlgHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] :
    (R →+* S) ≃ (R →ₐ[ℚ] S)

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
[Algebra ℚ R]
[Algebra ℚ S]
(self : R →ₐ[ℚ] S)

RingHom.equivRatAlgHom.symm self = self.toRingHom


@[simp]
theorem toOuterMeasure_toMeasure {μ : Measure α} :
    μ.toOuterMeasure.toMeasure (le_toOuterMeasure_caratheodory _) = μ

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


@[simp]
theorem sInf_toNonUnitalSubsemiring (S : Set (NonUnitalSubalgebra R A)) :
    (sInf S).toNonUnitalSubsemiring = sInf (NonUnitalSubalgebra.toNonUnitalSubsemiring '' S)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(S : Set (NonUnitalSubalgebra R A))


@[simp]
theorem rotate_zero (l : List α) : l.rotate 0 = l


@[simp]
nonrec theorem compl_compl (s : LowerSet α) : s.compl.compl = s


@[simp]
theorem nodup_sublists {l : List α} : Nodup (sublists l) ↔ Nodup l


@[deprecated StronglyMeasurable.of_finite (since := "2024-02-06")]
theorem stronglyMeasurable_of_isEmpty [IsEmpty α] {_ : MeasurableSpace α} [TopologicalSpace β]
    (f : α → β) : StronglyMeasurable f

{α : Type u_1}
{β : Type u_2}
[IsEmpty α]

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] (f : α → β), MeasureTheory.StronglyMeasurable f


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


/-- The obvious functor `(J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)`. -/
@[simps]
def inverse : (J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)

(F : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

((CategoryTheory.ShortComplex.FunctorEquivalence.inverse J C).obj F).X₁ = F.comp CategoryTheory.ShortComplex.π₁


/--
Proof that the equality of a compare function corresponds
to propositional equality.
-/
class EqOfCmp (α : Type u) (cmp : α → α → Ordering) where
  eq_of_cmp {a a' : α} : cmp a a' = .eq → a = a'

{α : Type u}
{cmp : α → α → Ordering}
[self : Lake.EqOfCmp α cmp]
{a a' : α}


@[simp] lemma piAntidiag_empty_of_ne_zero (hn : n ≠ 0) : piAntidiag (∅ : Finset ι) n = ∅

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[AddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
{n : μ}
(hn : n ≠ 0)


theorem degreeLT_succ_eq_degreeLE {n : ℕ} : degreeLT R (n + 1) = degreeLE R n

Polynomial.degreeLT R (n + 1) = Polynomial.degreeLE R ↑n


@[simp]
theorem map_add (f : α → β) (s t) : map f (s + t) = map f s + map f t

{α : Type u_1}
{β : Type v}
(f : α → β)
(s t : Multiset α)

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


@[simp]
theorem empty_not_mem (f : Filter α) [NeBot f] : ¬∅ ∈ f


theorem SuperpolynomialDecay.trans_eventually_abs_le (hf : SuperpolynomialDecay l k f)
    (hfg : abs ∘ g ≤ᶠ[l] abs ∘ f) : SuperpolynomialDecay l k g

(hf : Asymptotics.SuperpolynomialDecay l k f)


theorem tensor_id (M N : ModuleCat R) : tensorHom (𝟙 M) (𝟙 N) = 𝟙 (ModuleCat.of R (M ⊗ N))

{R : Type u}
[CommRing R]
(M : ModuleCat R)
(N : ModuleCat R)

ModuleCat.MonoidalCategory.tensorHom (𝟙 M) (𝟙 N) = 𝟙 (ModuleCat.of R (TensorProduct R ↑M ↑N))


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

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


@[simp]
theorem liftMonoid_coe_addMonoidHom (f : α →* R) : ↑(liftMonoid f) = lift f

{α : Type u}
{R : Type u_1}
[Monoid α]
[Ring R]
(f : α →* R)

↑(FreeAbelianGroup.liftMonoid f) = FreeAbelianGroup.lift ⇑f


theorem choose_spec (hp : ∃! a, a ∈ l ∧ p a) : choose p l hp ∈ l ∧ p (choose p l hp)

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(l : Multiset α)
(hp : ∃! a, a ∈ l ∧ p a)

Multiset.choose p l hp ∈ l ∧ p (Multiset.choose p l hp)


theorem sup_union [DecidableEq β] : (s₁ ∪ s₂).sup f = s₁.sup f ⊔ s₂.sup f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s₁ s₂ : Finset β}
{f : β → α}
[DecidableEq β]


/-- Up to isomorphism an element of the fiber of `X` only lies in one connected component. -/
lemma connected_component_unique {X A B : C} [IsConnected A] [IsConnected B] (a : F.obj A)
    (b : F.obj B) (i : A ⟶ X) (j : B ⟶ X) (h : F.map i a = F.map j b) [Mono i] [Mono j] :
    ∃ (f : A ≅ B), F.map f.hom a = b

(F : CategoryTheory.Functor C FintypeCat)


/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then
it is analytic at every point of this ball. -/
theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r)
    (h : y ∈ EMetric.ball x r) : AnalyticAt 𝕜 f y

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x y : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(h : y ∈ EMetric.ball x r)


theorem padicValInt_self : padicValInt p p = 1


@[simp]
theorem disjUnion_empty (s : Finset α) (h : Disjoint s ∅ := disjoint_bot_right) :
    disjUnion s ∅ h = s

{α : Type u_1}
(s : Finset α)
(h : Disjoint s ∅ := ⋯)


@[fun_prop]
nonrec theorem ContinuousAt.sqrt (h : ContinuousAt f x) : ContinuousAt (fun x => √(f x)) x

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
{x : α}
(h : ContinuousAt f x)


theorem abs_arg_le_pi (z : ℂ) : |arg z| ≤ π


@[reassoc (attr := simp)]
theorem preservesColimitsIso_inv_comp_desc (t : Cocone F) :
    (preservesColimitIso G F).inv ≫ G.map (colimit.desc _ t) =
    colimit.desc _ (G.mapCocone t)

CategoryTheory.CategoryStruct.comp (CategoryTheory.preservesColimitIso G F).inv
    (G.map (CategoryTheory.Limits.colimit.desc F t)) =
  CategoryTheory.Limits.colimit.desc (F.comp G) (G.mapCocone t)


/-- To prove something for an arbitrary `Lp` simple function, with `0 < p < ∞`, it suffices to show
that the property holds for (multiples of) characteristic functions of finite-measure measurable
sets and is closed under addition (of functions with disjoint support). -/
@[elab_as_elim]
protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : Lp.simpleFunc E p μ → Prop}
    (h_ind :
      ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
        P (Lp.simpleFunc.indicatorConst p hs hμs.ne c))
    (h_add :
      ∀ ⦃f g : α →ₛ E⦄,
        ∀ hf : Memℒp f p μ,
          ∀ hg : Memℒp g p μ,
            Disjoint (support f) (support g) →
              P (Lp.simpleFunc.toLp f hf) →
                P (Lp.simpleFunc.toLp g hg) → P (Lp.simpleFunc.toLp f hf + Lp.simpleFunc.toLp g hg))
    (f : Lp.simpleFunc E p μ) : P f

{P : ↥(MeasureTheory.Lp.simpleFunc E p μ) → Prop}

(h_ind :
  ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ⊤), P (MeasureTheory.Lp.simpleFunc.indicatorConst p hs ⋯ c))

(h_add :
  ∀ ⦃f g : MeasureTheory.SimpleFunc α E⦄ (hf : MeasureTheory.Memℒp (↑f) p μ) (hg : MeasureTheory.Memℒp (↑g) p μ),
    Disjoint (Function.support ↑f) (Function.support ↑g) →
      P (MeasureTheory.Lp.simpleFunc.toLp f hf) →
        P (MeasureTheory.Lp.simpleFunc.toLp g hg) →
          P (MeasureTheory.Lp.simpleFunc.toLp f hf + MeasureTheory.Lp.simpleFunc.toLp g hg))

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


theorem ge_mem_nhds [OrderTopology α] {a b : α} (h : a < b) : ∀ᶠ x in 𝓝 a, x ≤ b

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{a b : α}
(h : a < b)


{P : Type u_1}
[Preorder P]
(D : Order.Cofinal P)
(x : P)


/-- (Impl). The obvious natural transformation from (X × K -) to X -/
@[simps]
def γ₁ {K : J ⥤ C} (X : C) : K ⋙ prod.functor.obj X ⟶ (Functor.const J).obj X

(CategoryTheory.ProdPreservesConnectedLimits.γ₁ X).app Y = CategoryTheory.Limits.prod.fst


@[simp]
theorem map_vadd (p : P) (v : V) : e (v +ᵥ p) = e.linearIsometryEquiv v +ᵥ e p

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)
(p : P)
(v : V)


theorem compl_sUnion (S : Set (Set α)) : (⋃₀S)ᶜ = ⋂₀ (compl '' S)


theorem notConvergentSeqLTIndex_spec (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
    (hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
    (hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) (n : ℕ) :
    μ (s ∩ notConvergentSeq f g n (notConvergentSeqLTIndex hε hf hg hsm hs hfg n)) ≤
      ENNReal.ofReal (ε * 2⁻¹ ^ n)

{f : ι → α → β}

(hf : ∀ (n : ι), MeasureTheory.StronglyMeasurable (f n))

(hg : MeasureTheory.StronglyMeasurable g)

(hfg : ∀ᵐ (x : α) ∂μ, x ∈ s → Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (g x)))

μ
    (s ∩
      MeasureTheory.Egorov.notConvergentSeq f g n
        (MeasureTheory.Egorov.notConvergentSeqLTIndex hε hf hg hsm hs hfg n)) ≤
  ENNReal.ofReal (ε * 2⁻¹ ^ n)


lemma ofProd_comp_toProd : (ofProd Q₁ Q₂).comp (toProd Q₁ Q₂) = AlgHom.id _ _

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)

(CliffordAlgebra.ofProd Q₁ Q₂).comp (CliffordAlgebra.toProd Q₁ Q₂) =
  AlgHom.id R (CliffordAlgebra.evenOdd Q₁ ᵍ⊗[R] CliffordAlgebra.evenOdd Q₂)


@[simp]
theorem compl_iInf₂ (f : ∀ i, κ i → LowerSet α) :
    (⨅ (i) (j), f i j).compl = ⨅ (i) (j), (f i j).compl

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_5}
[LE α]
(f : (i : ι) → κ i → LowerSet α)

(⨅ i, ⨅ j, f i j).compl = ⨅ i, ⨅ j, (f i j).compl


@[simp]
theorem toFinset_sum_count_nsmul_eq (s : Multiset α) :
    ∑ a ∈ s.toFinset, s.count a • {a} = s

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

∑ a ∈ s.toFinset, Multiset.count a s • {a} = s


theorem gradedMul_algebraMap (x : (⨁ i, 𝒜 i) ⊗[R] (⨁ i, ℬ i)) (r : R) :
    gradedMul R 𝒜 ℬ x (algebraMap R _ r ⊗ₜ 1) = r • x

((TensorProduct.gradedMul R 𝒜 ℬ) x) ((algebraMap R (DirectSum ι 𝒜)) r ⊗ₜ[R] 1) = r • x


theorem map_adj {v w : V} (h : G.Adj v w) : G'.Adj (f v) (f w)

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
{v w : V}
(h : G.Adj v w)


@[to_additive (attr := simp)]
theorem preimage_mul_right_one : preimage 1 (· * b) (mul_left_injective _).injOn = {b⁻¹}

Finset.preimage 1 (fun x => x * b) ⋯ = {b⁻¹}


theorem Embedding.mk' (f : X → Y) (inj : Injective f) (induced : ∀ x, comap f (𝓝 (f x)) = 𝓝 x) :
    Embedding f

(induced : ∀ (x : X), Filter.comap f (𝓝 (f x)) = 𝓝 x)


/-- We say that the action of `M` on `α` has `MeasurableSMul` if for each `c` the map `x ↦ c • x`
is a measurable function and for each `x` the map `c ↦ c • x` is a measurable function. -/
@[to_additive]
class MeasurableSMul (M α : Type*) [SMul M α] [MeasurableSpace M] [MeasurableSpace α] :
    Prop where
  measurable_const_smul : ∀ c : M, Measurable (c • · : α → α)
  measurable_smul_const : ∀ x : α, Measurable (· • x : M → α)

{M : Type u_2}
{α : Type u_3}
[SMul M α]
[MeasurableSpace M]
[MeasurableSpace α]
[self : MeasurableSMul M α]
(c : M)


theorem comap_isPrime [H : IsPrime K] : IsPrime (comap f K)

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(K : Ideal S)
[H : K.IsPrime]


@[simp]
theorem domLCongr_apply {α₁ : Type*} {α₂ : Type*} (e : α₁ ≃ α₂) (v : α₁ →₀ M) :
    (Finsupp.domLCongr e : _ ≃ₗ[R] _) v = Finsupp.domCongr e v

{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α₁ : Type u_7}
{α₂ : Type u_8}
(e : α₁ ≃ α₂)
(v : α₁ →₀ M)

(Finsupp.domLCongr e) v = (Finsupp.domCongr e) v


theorem descFactorial_self : ∀ n : ℕ, n.descFactorial n = n !


private lemma iter_fp_bound (n k : ℕ) :
    let iter_next (n guess : ℕ) := (guess + n / guess) / 2;
    sqrt.iter n k ≤ iter_next n (sqrt.iter n k)

let iter_next := fun n guess => (guess + n / guess) / 2;
Nat.sqrt.iter n k ≤ iter_next n (Nat.sqrt.iter n k)


theorem map_eq_comap_of_inverse {f : Filter α} {m : α → β} {n : β → α} (h₁ : m ∘ n = id)
    (h₂ : n ∘ m = id) : map m f = comap n f

{α : Type u}
{β : Type v}
{f : Filter α}
{m : α → β}
{n : β → α}
(h₁ : m ∘ n = id)
(h₂ : n ∘ m = id)


/-- All n-simplices among cospherical points in an n-dimensional
subspace have the same circumradius. -/
theorem exists_circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P}
    (h : ps ⊆ s) [Nonempty s] {n : ℕ} [FiniteDimensional ℝ s.direction]
    (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
    ∃ r : ℝ, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumradius = r

(hd : FiniteDimensional.finrank ℝ ↥s.direction = n)

∃ r, ∀ (sx : Affine.Simplex ℝ P n), Set.range sx.points ⊆ ps → sx.circumradius = r


/-- The ultrafilter lemma: Any proper filter is contained in an ultrafilter. -/
theorem exists_le (f : Filter α) [h : NeBot f] : ∃ u : Ultrafilter α, ↑u ≤ f

{α : Type u}
(f : Filter α)
[h : f.NeBot]


lemma differentiableAt_hurwitzZeta_sub_one_div (a : UnitAddCircle) :
    DifferentiableAt ℂ (fun s ↦ hurwitzZeta a s - 1 / (s - 1) / Gammaℝ s) 1

DifferentiableAt ℂ (fun s => HurwitzZeta.hurwitzZeta a s - 1 / (s - 1) / s.Gammaℝ) 1


/-- A finite sum of rationals with positive `p`-adic valuation has positive `p`-adic valuation
(if the sum is non-zero). -/
theorem sum_pos_of_pos {n : ℕ} {F : ℕ → ℚ} (hF : ∀ i, i < n → 0 < padicValRat p (F i))
    (hn0 : ∑ i ∈ Finset.range n, F i ≠ 0) : 0 < padicValRat p (∑ i ∈ Finset.range n, F i)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{n : ℕ}
{F : ℕ → ℚ}
(hF : ∀ i < n, 0 < padicValRat p (F i))
(hn0 : ∑ i ∈ Finset.range n, F i ≠ 0)


@[simp] lemma tensorLId_symm_apply (Q₂ : QuadraticForm R M₂) (x : M₂) :
    (tensorLId Q₂).symm x = (TensorProduct.lid R M₂).symm x

{R : Type uR}
{M₂ : Type uM₂}
[CommRing R]
[AddCommGroup M₂]
[Module R M₂]
[Invertible 2]
(Q₂ : QuadraticForm R M₂)
(x : M₂)

Q₂.tensorLId.symm x = (TensorProduct.lid R M₂).symm x


/-- The isomorphism between `F.leftOp.rightOp` and `F`. -/
@[simps!]
def leftOpRightOpIso (F : C ⥤ Dᵒᵖ) : F.leftOp.rightOp ≅ F

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

F.leftOpRightOpIso.inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


@[simp]
theorem algebraMap_inj (x y : R) :
    algebraMap R (FreeAlgebra R X) x = algebraMap R (FreeAlgebra R X) y ↔ x = y

{R : Type u_1}
[CommSemiring R]
{X : Type u_2}
(x y : R)

(algebraMap R (FreeAlgebra R X)) x = (algebraMap R (FreeAlgebra R X)) y ↔ x = y


theorem codisjoint_himp_self_right : Codisjoint x (x ⇨ y)

{α : Type u}
{x y : α}
[BooleanAlgebra α]


theorem condexpL2_indicator_of_measurable (hm : m ≤ m0) (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞)
    (c : E) :
    (condexpL2 E 𝕜 hm (indicatorConstLp 2 (hm s hs) hμs c) : α →₂[μ] E) =
      indicatorConstLp 2 (hm s hs) hμs c

{α : Type u_1}
{E : Type u_2}
{𝕜 : Type u_7}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hm : m ≤ m0)
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(c : E)

↑((MeasureTheory.condexpL2 E 𝕜 hm) (MeasureTheory.indicatorConstLp 2 ⋯ hμs c)) =
  MeasureTheory.indicatorConstLp 2 ⋯ hμs c


theorem IsLittleO.right_isTheta_add {f₁ f₂ : α → E'} (h : f₁ =o[l] f₂) :
    f₂ =Θ[l] (f₁ + f₂)

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{l : Filter α}
{f₁ f₂ : α → E'}
(h : f₁ =o[l] f₂)


theorem isBounded_univ : IsBounded (univ : Set α) ↔ BoundedSpace α

Bornology.IsBounded Set.univ ↔ BoundedSpace α


/--
For a preregular category, any sieve that contains an `EffectiveEpi` is a covering sieve of the
regular topology.
Note: This is one direction of `mem_sieves_iff_hasEffectiveEpi`, but is needed for the proof.
-/
theorem mem_sieves_of_hasEffectiveEpi (S : Sieve X) :
    (∃ (Y : C) (π : Y ⟶ X), EffectiveEpi π ∧ S.arrows π) → (S ∈ (regularTopology C).sieves X)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preregular C]
{X : C}
(S : CategoryTheory.Sieve X)

(∃ Y π, CategoryTheory.EffectiveEpi π ∧ S.arrows π) → S ∈ (CategoryTheory.regularTopology C).sieves X


@[to_additive (attr := simp)]
theorem prod_one_cons : (1 :: l).prod = l.prod

{M : Type u_4}
[AddZeroClass M]
{l : List M}


/-- For `A : Matrix V V α` and `h : IsAdjMatrix A`,
    `h.toGraph` is the simple graph whose adjacency matrix is `A`. -/
@[simps]
def toGraph [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) : SimpleGraph V

{V : Type u_1}
{α : Type u_2}
{A : Matrix V V α}
[MulZeroOneClass α]
[Nontrivial α]
(h : A.IsAdjMatrix)
(i j : V)


lemma ε_succ {p q : I} (hpq : c.Rel p q) : c.ε q = - c.ε p

{I : Type u_4}
[AddMonoid I]
(c : ComplexShape I)
[c.TensorSigns]
{p q : I}
(hpq : c.Rel p q)


theorem dist_self_conj (z : ℂ) : dist z (conj z) = 2 * |z.im|


theorem prod_univ_range_eq {m₂ : β → δ} :
    (univ : Set α) ×ˢ range m₂ = range fun p : α × β => (p.1, m₂ p.2)

{α : Type u_1}
{β : Type u_2}
{δ : Type u_4}
{m₂ : β → δ}

Set.univ ×ˢ Set.range m₂ = Set.range fun p => (p.1, m₂ p.2)


@[simp]
theorem card_Ico : (Ico a b).card = b - a


@[simp]
theorem one_gcd {n : ℕ+} : gcd 1 n = 1


theorem UniqueDiffWithinAt.univ_pi (ι : Type*) [Finite ι] (E : ι → Type*)
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] (s : ∀ i, Set (E i)) (x : ∀ i, E i)
    (h : ∀ i, UniqueDiffWithinAt 𝕜 (s i) (x i)) : UniqueDiffWithinAt 𝕜 (Set.pi univ s) x

(h : ∀ (i : ι), UniqueDiffWithinAt 𝕜 (s i) (x i))


@[simp, norm_cast]
theorem coe_add (x y : R) : (↑(x + y) : c.Quotient) = ↑x + ↑y

{R : Type u_2}
[Add R]
[Mul R]
(c : RingCon R)
(x y : R)


@[to_additive (attr := simp)]
theorem coe_top : ((⊤ : Subsemigroup M) : Set M) = Set.univ


theorem coe_le_iff : ↑r ≤ a ↔ ∀ p : ℝ≥0, a = p → r ≤ p


private theorem natEmbeddingAux_injective (α : Type*) [Infinite α] :
    Function.Injective (natEmbeddingAux α)


@[simp]
theorem ae_restrict_union_eq (s t : Set α) :
    ae (μ.restrict (s ∪ t)) = ae (μ.restrict s) ⊔ ae (μ.restrict t)

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s t : Set α)

MeasureTheory.ae (μ.restrict (s ∪ t)) = MeasureTheory.ae (μ.restrict s) ⊔ MeasureTheory.ae (μ.restrict t)


theorem erase_image_subset_image_erase [DecidableEq α] (f : α → β) (s : Finset α) (a : α) :
    (s.image f).erase (f a) ⊆ (s.erase a).image f

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

(Finset.image f s).erase (f a) ⊆ Finset.image f (s.erase a)


@[simp]
theorem imagePresheaf_id : imagePresheaf (𝟙 F) = ⊤

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : Cᵒᵖ ⥤ Type w}

CategoryTheory.GrothendieckTopology.imagePresheaf (𝟙 F) = ⊤


/--
Complete partial orders are partial orders where every directed set has a least upper bound.
-/
class CompletePartialOrder (α : Type*) extends PartialOrder α, SupSet α where
  /-- For each directed set `d`, `sSup d` is the least upper bound of `d`. -/
  lubOfDirected : ∀ d, DirectedOn (· ≤ ·) d → IsLUB d (sSup d)

{α : Type u_4}
[self : CompletePartialOrder α]
(d : Set α)

DirectedOn (fun x x_1 => x ≤ x_1) d → IsLUB d (sSup d)


@[simp]
theorem removeZero_applyComposition (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ}
    (c : Composition n) : p.removeZero.applyComposition c = p.applyComposition c

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{n : ℕ}
(c : Composition n)


@[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l


@[reassoc]
theorem PreservesPullback.iso_hom_fst :
    (PreservesPullback.iso G f g).hom ≫ pullback.fst _ _ = G.map (pullback.fst f g)

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) G]

[CategoryTheory.Limits.HasPullback (G.map f) (G.map g)]

(CategoryTheory.Limits.PreservesPullback.iso G f g).hom ≫ CategoryTheory.Limits.pullback.fst (G.map f) (G.map g) =
  G.map (CategoryTheory.Limits.pullback.fst f g)


@[simp, norm_cast]
theorem coe_sInf (S : Set (Subring R)) : ((sInf S : Subring R) : Set R) = ⋂ s ∈ S, ↑s

{R : Type u}
[Ring R]
(S : Set (Subring R))


theorem martingale_martingalePart (hf : Adapted ℱ f) (hf_int : ∀ n, Integrable (f n) μ)
    [SigmaFiniteFiltration μ ℱ] : Martingale (martingalePart f ℱ μ) ℱ μ

(hf_int : ∀ (n : ℕ), MeasureTheory.Integrable (f n) μ)

MeasureTheory.Martingale (MeasureTheory.martingalePart f ℱ μ) ℱ μ


theorem _root_.MeasurableEmbedding.integral_map {β} {_ : MeasurableSpace β} {f : α → β}
    (hf : MeasurableEmbedding f) (g : β → G) : ∫ y, g y ∂Measure.map f μ = ∫ x, g (f x) ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_7}

∀ {x : MeasurableSpace β} {f : α → β},
  MeasurableEmbedding f → ∀ (g : β → G), ∫ (y : β), g y ∂MeasureTheory.Measure.map f μ = ∫ (x : α), g (f x) ∂μ


@[simp]
theorem basis_apply [DecidableEq η] (s : ∀ j, Basis (ιs j) R (Ms j)) (ji) :
    Pi.basis s ji = stdBasis R _ ji.1 (s ji.1 ji.2)

{R : Type u_1}
{η : Type u_2}
{ιs : η → Type u_3}
{Ms : η → Type u_4}
[Semiring R]
[(i : η) → AddCommMonoid (Ms i)]
[(i : η) → Module R (Ms i)]
[Fintype η]
[DecidableEq η]
(s : (j : η) → Basis (ιs j) R (Ms j))
(ji : (j : η) × ιs j)

(Pi.basis s) ji = (LinearMap.stdBasis R Ms ji.fst) ((s ji.fst) ji.snd)


@[simp]
theorem length_rotate' : ∀ (l : List α) (n : ℕ), (l.rotate' n).length = l.length


theorem deriv_pow : deriv (fun x : 𝕜 => x ^ n) x = (n : 𝕜) * x ^ (n - 1)

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

deriv (fun x => x ^ n) x = ↑n * x ^ (n - 1)


theorem Preadditive.isCoseparating_iff (𝒢 : Set C) :
    IsCoseparating 𝒢 ↔ ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ G ∈ 𝒢, ∀ (h : Y ⟶ G), f ≫ h = 0) → f = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(𝒢 : Set C)

CategoryTheory.IsCoseparating 𝒢 ↔ ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ G ∈ 𝒢, ∀ (h : Y ⟶ G), f ≫ h = 0) → f = 0


@[nolint simpNF, simp, norm_cast] theorem coe_algebraMap (s : S) :
    ↑(algebraMap _ (A 0) s) = algebraMap _ R s

{ι : Type u_1}
{S : Type u_3}
{R : Type u_4}
[CommSemiring S]
[Semiring R]
[Algebra S R]
[AddMonoid ι]
(A : ι → Submodule S R)
[SetLike.GradedMonoid A]
(s : S)

↑((algebraMap S ↥(A 0)) s) = (algebraMap S R) s


theorem kerase_comm (a₁ a₂) (l : List (Sigma β)) :
    kerase a₂ (kerase a₁ l) = kerase a₁ (kerase a₂ l)

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

List.kerase a₂ (List.kerase a₁ l) = List.kerase a₁ (List.kerase a₂ l)


theorem expSeries_apply_eq_div' (x : 𝔸) :
    (fun n => expSeries 𝕂 𝔸 n fun _ => x) = fun n => x ^ n / n !

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[Field 𝕂]
[DivisionRing 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
(x : 𝔸)

(fun n => (NormedSpace.expSeries 𝕂 𝔸 n) fun x_1 => x) = fun n => x ^ n / ↑n.factorial


/-- The affine open sets of an open subscheme
corresponds to the affine open sets containing in the subset. -/
@[simps! apply_coe_coe]
def _root_.AlgebraicGeometry.affineOpensRestrict {X : Scheme.{u}} (U : X.Opens) :
    U.toScheme.affineOpens ≃ { V : X.affineOpens // V ≤ U }

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

∀ (a : ↑(↑U).affineOpens),
  ↑↑((AlgebraicGeometry.affineOpensRestrict U) a) = (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ↑a


@[to_additive]
theorem norm_div_le (a b : E) : ‖a / b‖ ≤ ‖a‖ + ‖b‖

{E : Type u_6}
[SeminormedGroup E]
(a b : E)

‖a / b‖ ≤ ‖a‖ + ‖b‖


/-- Given three points in strict order on the same line, and a fourth point, the angles at the
fourth point between the second and third or first and third points have the same sign. -/
theorem _root_.Sbtw.oangle_sign_eq_right {p₁ p₂ p₃ : P} (p₄ : P) (h : Sbtw ℝ p₁ p₂ p₃) :
    (∡ p₂ p₄ p₃).sign = (∡ p₁ p₄ p₃).sign

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


theorem nhds_bot_basis : (𝓝 (⊥ : EReal)).HasBasis (fun _ : ℝ ↦ True) (Iio ·)

(𝓝 ⊥).HasBasis (fun x => True) fun x => Set.Iio ↑x


/-- The type of discrete quotients of a topological space. -/
@[ext] -- Porting note: in Lean 4, uses projection to `r` instead of `Setoid`.
structure DiscreteQuotient (X : Type*) [TopologicalSpace X] extends Setoid X where
  /-- For every point `x`, the set `{ y | Rel x y }` is an open set. -/
  protected isOpen_setOf_rel : ∀ x, IsOpen (setOf (toSetoid.Rel x))

{X : Type u_5}
[TopologicalSpace X]
(self : DiscreteQuotient X)
(x : X)


@[simp]
theorem add_one_inj {α β : Cardinal} : α + 1 = β + 1 ↔ α = β


/-- The smallest congruence relation containing a binary relation `r` is contained in any
    congruence relation containing `r`. -/
theorem ringConGen_le {r : R → R → Prop} {c : RingCon R}
    (h : ∀ x y, r x y → c x y) : ringConGen r ≤ c

{R : Type u_2}
[Add R]
[Mul R]
{r : R → R → Prop}
{c : RingCon R}
(h : ∀ (x y : R), r x y → c x y)


/-- If `E / F` is algebraic, then an intermediate field of `E / F` is equal to the separable closure
of `F` in `E` if and only if it is separable over `F`, and `E` is purely inseparable
over it. -/
theorem eq_separableClosure_iff [Algebra.IsAlgebraic F E] (L : IntermediateField F E) :
    L = separableClosure F E ↔ Algebra.IsSeparable F L ∧ IsPurelyInseparable L E

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsAlgebraic F E]
(L : IntermediateField F E)

L = separableClosure F E ↔ Algebra.IsSeparable F ↥L ∧ IsPurelyInseparable (↥L) E


@[simp]
theorem sups_eq_empty : s ⊻ t = ∅ ↔ s = ∅ ∨ t = ∅

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


lemma liminf_const_sub (F : Filter ι) [NeBot F] (f : ι → ℝ≥0∞)
    {c : ℝ≥0∞} (c_ne_top : c ≠ ∞) :
    Filter.liminf (fun i ↦ c - f i) F = c - Filter.limsup f F

{ι : Type u_4}
(F : Filter ι)
[F.NeBot]
(f : ι → ℝ≥0∞)
{c : ℝ≥0∞}
(c_ne_top : c ≠ ⊤)

Filter.liminf (fun i => c - f i) F = c - Filter.limsup f F


theorem coe_mono : Monotone (fun a : α => (a : WithTop α))


theorem comap_le_iff_le_map (hf : Function.Bijective f) {I : Ideal R} {K : Ideal S} :
    comap f K ≤ I ↔ K ≤ map f I

{R : Type u}
{S : Type v}
{F : Type u_1}
[Ring R]
[Ring S]
[FunLike F R S]
[RingHomClass F R S]
(f : F)
(hf : Function.Bijective ⇑f)
{I : Ideal R}
{K : Ideal S}


@[simp]
theorem attach_mk {m : Multiset α} {hc : Multiset.card m = n} :
    attach (mk m hc) = mk m.attach (Multiset.card_attach.trans hc)

{α : Type u_1}
{n : ℕ}
{m : Multiset α}
{hc : Multiset.card m = n}

(Sym.mk m hc).attach = Sym.mk m.attach ⋯


theorem IsRelPrime.of_mul_right_right (H : IsRelPrime x (y * z)) : IsRelPrime x z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(H : IsRelPrime x (y * z))


theorem Pairwise.forall_of_forall (H : Symmetric R) (H₁ : ∀ x ∈ l, R x x) (H₂ : l.Pairwise R) :
    ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y

{α : Type u_1}
{R : α → α → Prop}
{l : List α}
(H : Symmetric R)
(H₁ : ∀ (x : α), x ∈ l → R x x)
(H₂ : List.Pairwise R l)
⦃x : α⦄


/-- The canonical isomorphism
`Triangle.shiftFunctor C n ≅ Triangle.shiftFunctor C a ⋙ Triangle.shiftFunctor C b`
when `a + b = n`. -/
@[simps!]
noncomputable def Triangle.shiftFunctorAdd' (a b n : ℤ) (h : a + b = n) :
    Triangle.shiftFunctor C n ≅ Triangle.shiftFunctor C a ⋙ Triangle.shiftFunctor C b

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

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Pretriangulated.Triangle.shiftFunctorAdd' C a b n h).hom.app X).hom₁ =
  (CategoryTheory.shiftFunctorAdd' C a b n h).hom.app X.obj₁


@[to_additive]
theorem nndist_eq_nnnorm_div (a b : E) : nndist a b = ‖a / b‖₊

{E : Type u_6}
[SeminormedAddGroup E]
(a b : E)


@[simp]
theorem empty_arrow {V : Type u} (a b : Empty V) : (a ⟶ b) = PEmpty


@[simp]
lemma Isometry.snd_comp_inl (Q₂ : QuadraticMap R M₂ P) :
    (snd M₁ Q₂).comp (inl (0 : QuadraticMap R M₁ P) Q₂) = 0

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
(Q₂ : QuadraticMap R M₂ P)

(QuadraticMap.Isometry.snd M₁ Q₂).comp (QuadraticMap.Isometry.inl 0 Q₂) = 0


theorem IsLocalMaxOn.not_nhds_le_map [TopologicalSpace β] (hf : IsLocalMaxOn f s a)
    [NeBot (𝓝[>] f a)] : ¬𝓝 (f a) ≤ map f (𝓝[s] a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
[TopologicalSpace β]
(hf : IsLocalMaxOn f s a)
[(𝓝[>] f a).NeBot]


theorem Ici_succ_of_not_isMax (ha : ¬IsMax a) : Ici (succ a) = Ioi a

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a : α}
(ha : ¬IsMax a)


theorem eq_coe_iff {a b : α} {n : ℕ} :
    multiplicity a b = (n : PartENat) ↔ a ^ n ∣ b ∧ ¬a ^ (n + 1) ∣ b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
{n : ℕ}

multiplicity a b = ↑n ↔ a ^ n ∣ b ∧ ¬a ^ (n + 1) ∣ b


theorem mem_atBot [Preorder α] (a : α) : { b : α | b ≤ a } ∈ @atBot α _


/-- An oriented angle is unchanged by replacing the third point with the midpoint of the segment
between the second point and that point. -/
@[simp]
theorem oangle_midpoint_rev_right (p₁ p₂ p₃ : P) : ∡ p₁ p₂ (midpoint ℝ p₂ p₃) = ∡ p₁ p₂ p₃

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


/-- Lift a monoid homomorphism `f : G →* Function.End α` to a monoid homomorphism
`f : G →* Equiv.Perm α`. -/
@[simps!]
def _root_.MonoidHom.toHomPerm {G : Type*} [Group G] (f : G →* Function.End α) : G →* Perm α

{α : Type u}
{G : Type u_1}
[Group G]
(f : G →* Function.End α)

∀ (a : G), ⇑(Equiv.symm (f.toHomPerm a)) = ↑(f.toHomUnits a)⁻¹


lemma jacobiTheta₂'_neg_left (z τ : ℂ) : jacobiTheta₂' (-z) τ = -jacobiTheta₂' z τ


theorem prod_unique (f : R →ₙ+* S × T) : ((fst S T).comp f).prod ((snd S T).comp f) = f

{R : Type u_3}
{S : Type u_5}
{T : Type u_7}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
[NonUnitalNonAssocSemiring T]
(f : R →ₙ+* S × T)

((NonUnitalRingHom.fst S T).comp f).prod ((NonUnitalRingHom.snd S T).comp f) = f


@[to_additive]
theorem uniformContinuous_of_tendsto_one {hom : Type*} [UniformSpace β] [Group β] [UniformGroup β]
    [FunLike hom α β] [MonoidHomClass hom α β] {f : hom} (h : Tendsto f (𝓝 1) (𝓝 1)) :
    UniformContinuous f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
{hom : Type u_3}
[UniformSpace β]
[Group β]
[UniformGroup β]
[FunLike hom α β]
[MonoidHomClass hom α β]
{f : hom}
(h : Filter.Tendsto (⇑f) (𝓝 1) (𝓝 1))


theorem snd_mem_support_of_mem_edges {t u v w : V} (p : G.Walk v w) (he : s(t, u) ∈ p.edges) :
    u ∈ p.support

{V : Type u}
{G : SimpleGraph V}
{t u v w : V}
(p : G.Walk v w)
(he : s(t, u) ∈ p.edges)


@[simp]
theorem ofDual_max (a b : αᵒᵈ) : ofDual (max a b) = min (ofDual a) (ofDual b)

{α : Type u}
[LinearOrder α]
(a b : αᵒᵈ)

OrderDual.ofDual (max a b) = min (OrderDual.ofDual a) (OrderDual.ofDual b)


@[simp]
theorem mul_apply' (a b : A) : mul R A a b = a * b

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(a b : A)


theorem mk_size (h) : (mk n h : Buckets α β).size = 0

{α : Type u_1}
{β : Type u_2}
{n : Nat}
(h : 0 < n)

(Batteries.HashMap.Imp.Buckets.mk n h).size = 0


theorem exists_seq_strictMono_tendsto' {α : Type*} [LinearOrder α] [TopologicalSpace α]
    [DenselyOrdered α] [OrderTopology α] [FirstCountableTopology α] {x y : α} (hy : y < x) :
    ∃ u : ℕ → α, StrictMono u ∧ (∀ n, u n ∈ Ioo y x) ∧ Tendsto u atTop (𝓝 x)

{α : Type u_4}
[LinearOrder α]
[TopologicalSpace α]
[DenselyOrdered α]
[OrderTopology α]
[FirstCountableTopology α]
{x y : α}
(hy : y < x)

∃ u, StrictMono u ∧ (∀ (n : ℕ), u n ∈ Set.Ioo y x) ∧ Filter.Tendsto u Filter.atTop (𝓝 x)


theorem upperSemicontinuousWithinAt_const : UpperSemicontinuousWithinAt (fun _x => z) s x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{x : α}
{s : Set α}
{z : β}


@[to_additive]
theorem IsOpen.iUnion_preimage_smul [IsMinimal M α] {U : Set α} (hUo : IsOpen U)
    (hne : U.Nonempty) : ⋃ c : M, (c • ·) ⁻¹' U = univ

(M : Type u_1)
{α : Type u_3}
[AddMonoid M]
[TopologicalSpace α]
[AddAction M α]
[AddAction.IsMinimal M α]
{U : Set α}
(hUo : IsOpen U)
(hne : U.Nonempty)


theorem pos {M} (a : M) [CanonicallyOrderedAddCommMonoid M] [NeZero a] : 0 < a

{M : Type u_1}
(a : M)
[CanonicallyOrderedAddCommMonoid M]
[NeZero a]


@[to_additive]
theorem mulEquivOfLocalizations_left_inv_apply {k : N ≃* P} (x) :
    f.mulEquivOfLocalizations (f.ofMulEquivOfLocalizations k) x = k x

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : N ≃* P}
(x : N)

(f.mulEquivOfLocalizations (f.ofMulEquivOfLocalizations k)) x = k x


@[simp]
theorem edist_ofMul (a b : X) : edist (ofMul a) (ofMul b) = edist a b

edist (Additive.ofMul a) (Additive.ofMul b) = edist a b


@[to_additive (attr := simp)]
theorem toFinset_smul_set (a : α) (s : Set β) [Fintype s] [Fintype ↑(a • s)] :
    (a • s).toFinset = a • s.toFinset

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
(a : α)
(s : Set β)
[Fintype ↑s]
[Fintype ↑(a +ᵥ s)]


@[simp]
theorem neLocus_sub_right : neLocus (f₁ - g) (f₂ - g) = neLocus f₁ f₂

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f₁ f₂ g : α →₀ N)

(f₁ - g).neLocus (f₂ - g) = f₁.neLocus f₂


@[simp]
theorem toRightMovesNim_symm_lt {o : Ordinal} (i : (nim o).RightMoves) :
    ↑(toRightMovesNim.symm i) < o

(i : (SetTheory.PGame.nim o).RightMoves)

↑(SetTheory.PGame.toRightMovesNim.symm i) < o


lemma congr_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+ G' i)
    (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G i) :
    congr e he (of G f i g) = of G' f' i (e i g)

(he : ∀ (i j : ι) (h : i ≤ j), (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp ↑(e i))

(AddCommGroup.DirectLimit.congr e he) ((AddCommGroup.DirectLimit.of G f i) g) =
  (AddCommGroup.DirectLimit.of G' f' i) ((e i) g)


@[simp] theorem map_id' (l : List α) : map (fun a => a) l = l


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


/-- The nilpotency class of a nilpotent `G` is equal to the smallest `n` for which the descending
central series reaches `⊥` in its `n`'th term. -/
theorem least_descending_central_series_length_eq_nilpotencyClass :
    Nat.find ((nilpotent_iff_finite_descending_central_series G).mp hG) =
    Group.nilpotencyClass G

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


/-- A totally bounded set is bounded -/
theorem _root_.TotallyBounded.isBounded {s : Set α} (h : TotallyBounded s) : IsBounded s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(h : TotallyBounded s)


theorem hom.inj_on_objects : Function.Injective (hom S).obj

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)


/-- Build an isomorphism in the category `MagmaCat` from a `MulEquiv` between `Mul`s. -/
@[to_additive (attr := simps)
      "Build an isomorphism in the category `AddMagmaCat` from an `AddEquiv` between `Add`s."]
def MulEquiv.toMagmaCatIso (e : X ≃* Y) : MagmaCat.of X ≅ MagmaCat.of Y

{X Y : Type u}
[Add X]
[Add Y]
(e : X ≃+ Y)

∀ (a : Y), e.toAddMagmaCatIso.inv a = e.symm.toFun a


@[simp, norm_cast] lemma coe_toMonoidHomEquiv (ψ : AddChar A M) :
    ⇑(toMonoidHomEquiv ψ) = ψ ∘ Multiplicative.toAdd

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)

⇑(AddChar.toMonoidHomEquiv ψ) = ⇑ψ ∘ ⇑Multiplicative.toAdd


theorem unpair_right_le (n : ℕ) : (unpair n).2 ≤ n


theorem strongRecOn_eq {motive : Nat → Sort _} (ind : ∀ n, (∀ m, m < n → motive m) → motive n)
    (t : Nat) : Nat.strongRecOn t ind = ind t fun m _ => Nat.strongRecOn m ind

(ind : (n : Nat) → ((m : Nat) → m < n → motive m) → motive n)

t.strongRecOn ind = ind t fun m x => m.strongRecOn ind


@[reassoc (attr := simp)]
theorem pentagon_hom_inv_inv_inv_hom :
    (α_ W X (Y ⊗ Z)).hom ≫ W ◁ (α_ X Y Z).inv ≫ (α_ W (X ⊗ Y) Z).inv =
      (α_ (W ⊗ X) Y Z).inv ≫ (α_ W X Y).hom ▷ Z

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{W X Y Z : C}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerLeft W (CategoryTheory.MonoidalCategory.associator X Y Z).inv)
      (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).inv) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).inv
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.associator W X Y).hom Z)


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


lemma OneCocycle.IsCohomologous.class_eq {γ₁ γ₂ : OneCocycle G U} (h : γ₁.IsCohomologous γ₂) :
    γ₁.class = γ₂.class

{γ₁ γ₂ : CategoryTheory.PresheafOfGroups.OneCocycle G U}


/-- A differential object in a category with zero morphisms and a shift is
an object `obj` equipped with
a morphism `d : obj ⟶ obj⟦1⟧`, such that `d^2 = 0`. -/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure DifferentialObject where
  /-- The underlying object of a differential object. -/
  obj : C
  /-- The differential of a differential object. -/
  d : obj ⟶ obj⟦(1 : S)⟧
  /-- The differential `d` satisfies that `d² = 0`. -/
  d_squared : d ≫ d⟦(1 : S)⟧' = 0 := by aesop_cat

(self : CategoryTheory.DifferentialObject S C)

CategoryTheory.CategoryStruct.comp self.d ((CategoryTheory.shiftFunctor C 1).map self.d) = 0


theorem abs_natCast_norm (x : ℤ[i]) : (x.norm.natAbs : ℤ) = x.norm


theorem arcsin_le_iff_le_sin {x y : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) (hy : y ∈ Icc (-(π / 2)) (π / 2)) :
    arcsin x ≤ y ↔ x ≤ sin y


theorem mul_single_apply_aux [Add G] (f : k[G]) (r : k) (x y z : G)
    (H : ∀ a, a + x = z ↔ a = y) : (f * single x r) z = f y * r

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Add G]
(f : AddMonoidAlgebra k G)
(r : k)
(x y z : G)
(H : ∀ (a : G), a + x = z ↔ a = y)

(f * AddMonoidAlgebra.single x r) z = f y * r


theorem lieSpan_eq : lieSpan R L (N : Set M) = N

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


theorem eval₂_rename_prod_mk (g : σ × τ → S) (i : σ) (p : MvPolynomial τ R) :
    (rename (Prod.mk i) p).eval₂ f g = eval₂ f (fun j => g (i, j)) p

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
{S : Type u_5}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(g : σ × τ → S)
(i : σ)
(p : MvPolynomial τ R)

MvPolynomial.eval₂ f g ((MvPolynomial.rename (Prod.mk i)) p) = MvPolynomial.eval₂ f (fun j => g (i, j)) p


/-- Construct an isomorphism in the comma category given isomorphisms of the objects whose forward
directions give a commutative square.
-/
@[simps]
def isoMk {X Y : Comma L₁ R₁} (l : X.left ≅ Y.left) (r : X.right ≅ Y.right)
    (h : L₁.map l.hom ≫ Y.hom = X.hom ≫ R₁.map r.hom := by aesop_cat) : X ≅ Y

(h :
  CategoryTheory.CategoryStruct.comp (L₁.map l.hom) Y.hom =
    CategoryTheory.CategoryStruct.comp X.hom (R₁.map r.hom) := by
  aesop_cat)

(CategoryTheory.Comma.isoMk l r h).inv.left = l.inv


/-- Construct a cocone over a wide span. -/
@[simps]
def mkCocone {F : WidePushoutShape J ⥤ C} {X : C} (f : F.obj none ⟶ X) (ι : ∀ j, F.obj (some j) ⟶ X)
    (w : ∀ j, F.map (Hom.init j) ≫ ι j = f) : Cocone F

{F : CategoryTheory.Limits.WidePushoutShape J ⥤ C}

(w : ∀ (j : J), F.map (CategoryTheory.Limits.WidePushoutShape.Hom.init j) ≫ ι j = f)

(CategoryTheory.Limits.WidePushoutShape.mkCocone f ι w).pt = X


theorem intervalIntegrable_one_div_one_add_sq :
    IntervalIntegrable (fun x : ℝ => 1 / (↑1 + x ^ 2)) μ a b

IntervalIntegrable (fun x => 1 / (1 + x ^ 2)) μ a b


theorem SurjOn.leftInvOn_of_rightInvOn (hf : SurjOn f s t) (hf' : RightInvOn f f' s) :
    LeftInvOn f f' t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
{f' : β → α}
(hf : Set.SurjOn f s t)
(hf' : Set.RightInvOn f f' s)


/-- The functor `C(X, ·)₀` from non-unital topological star algebras (with non-unital continuous
star homomorphisms) to non-unital star algebras. -/
@[simps apply]
def nonUnitalStarAlgHom_postcomp (φ : R →⋆ₙₐ[M] S) (hφ : Continuous φ) :
    C(X, R)₀ →⋆ₙₐ[M] C(X, S)₀

(X : Type u_1)
{M : Type u_3}
{R : Type u_4}
{S : Type u_5}
[Zero X]
[CommSemiring M]
[TopologicalSpace X]
[TopologicalSpace R]
[TopologicalSpace S]
[CommSemiring R]
[StarRing R]
[TopologicalSemiring R]
[ContinuousStar R]
[CommSemiring S]
[StarRing S]
[TopologicalSemiring S]
[ContinuousStar S]
[Module M R]
[Module M S]
[ContinuousConstSMul M R]
[ContinuousConstSMul M S]
(φ : R →⋆ₙₐ[M] S)
(hφ : Continuous ⇑φ)
(f : ContinuousMapZero X R)

(ContinuousMapZero.nonUnitalStarAlgHom_postcomp X φ hφ) f =
  { toFun := ⇑φ, continuous_toFun := hφ, map_zero' := ⋯ }.comp f


theorem coprime_one_left_iff (n : ℕ) : Coprime 1 n ↔ True


theorem multiplicity_le_multiplicity_of_dvd_left {a b c : α} (hdvd : a ∣ b) :
    multiplicity b c ≤ multiplicity a c

{α : Type u_1}
[CommMonoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b c : α}
(hdvd : a ∣ b)


lemma commShiftOfLocalization_iso_hom_app (a : A) (X : C) :
    letI := Functor.commShiftOfLocalization L W A F F'
    (F'.commShiftIso a).hom.app (L.obj X) =
      F'.map ((L.commShiftIso a).inv.app X) ≫ (Lifting.iso L W F F').hom.app (X⟦a⟧) ≫
        (F.commShiftIso a).hom.app X ≫
          (shiftFunctor E a).map ((Lifting.iso L W F F').inv.app X)

[CategoryTheory.Localization.Lifting L W F F']

(F'.commShiftIso a).hom.app (L.obj X) =
  CategoryTheory.CategoryStruct.comp (F'.map ((L.commShiftIso a).inv.app X))
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.Localization.Lifting.iso L W F F').hom.app ((CategoryTheory.shiftFunctor C a).obj X))
      (CategoryTheory.CategoryStruct.comp ((F.commShiftIso a).hom.app X)
        ((CategoryTheory.shiftFunctor E a).map ((CategoryTheory.Localization.Lifting.iso L W F F').inv.app X))))


@[simp]
theorem ofDual_toDual (a : α) : ofDual (toDual a) = a

OrderDual.ofDual (OrderDual.toDual a) = a


@[simp, norm_cast]
theorem toENNReal_pow (x : ℕ∞) (n : ℕ) : (x ^ n : ℕ∞) = (x : ℝ≥0∞) ^ n


@[simp]
theorem disjoint_one_left (f : Perm α) : Disjoint 1 f


@[simp]
theorem ae_completion {_ : MeasurableSpace α} (μ : Measure α) : ae μ.completion = ae μ

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α), MeasureTheory.ae μ.completion = MeasureTheory.ae μ


@[simp]
theorem coeFn_toContinuousLinearEquivOfContinuous_symm (e : E ≃ₛₗ[σ] F) (h : Continuous e) :
    ⇑(e.toContinuousLinearEquivOfContinuous h).symm = e.symm

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
(e : E ≃ₛₗ[σ] F)
(h : Continuous ⇑e)

⇑(e.toContinuousLinearEquivOfContinuous h).symm = ⇑e.symm


theorem subtypeVal_nil {α : TypeVec.{u} 0} (ps : α ⟹ «repeat» 0 Prop) :
    TypeVec.subtypeVal ps = nilFun

{α : TypeVec.{u} 0}
(ps : α.Arrow (TypeVec.repeat 0 Prop))


/-- A weakly lower modular lattice is a lattice where `a` and `b` cover `a ⊓ b` if `a ⊔ b` covers
both `a` and `b`. -/
class IsWeakLowerModularLattice (α : Type*) [Lattice α] : Prop where
/-- `a` and `b` cover `a ⊓ b` if `a ⊔ b` covers both `a` and `b` -/
  inf_covBy_of_covBy_covBy_sup {a b : α} : a ⋖ a ⊔ b → b ⋖ a ⊔ b → a ⊓ b ⋖ a

{α : Type u_2}
[Lattice α]
[self : IsWeakLowerModularLattice α]
{a b : α}


@[to_additive]
theorem orderOf_units {y : Gˣ} : orderOf (y : G) = orderOf y

{G : Type u_1}
[AddMonoid G]
{y : AddUnits G}


theorem bitwise_swap {f : Bool → Bool → Bool} :
    bitwise (Function.swap f) = Function.swap (bitwise f)

Nat.bitwise (Function.swap f) = Function.swap (Nat.bitwise f)


theorem formPerm_apply_mem_of_mem (h : x ∈ l) : formPerm l x ∈ l

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


theorem IsLittleO.const_smul_left (h : f' =o[l] g) (c : R) : (c • f') =o[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
{R : Type u_13}
[Norm F]
[SeminormedAddCommGroup E']
[SeminormedRing R]
{g : α → F}
{f' : α → E'}
{l : Filter α}
[Module R E']
[BoundedSMul R E']
(h : f' =o[l] g)
(c : R)


theorem HasStrictFDerivAt.sqrt (hf : HasStrictFDerivAt f f' x) (hx : f x ≠ 0) :
    HasStrictFDerivAt (fun y => √(f y)) ((1 / (2 * √(f x))) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{f' : E →L[ℝ] ℝ}
(hf : HasStrictFDerivAt f f' x)
(hx : f x ≠ 0)


@[simp]
lemma isClosed_derivedSet [T1Space X] (A : Set X) : IsClosed (derivedSet A)

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
(A : Set X)


/-- An implication of predicates `Z → Z'` induces a functor between full subcategories. -/
@[simps]
def FullSubcategory.map (h : ∀ ⦃X⦄, Z X → Z' X) : FullSubcategory Z ⥤ FullSubcategory Z'

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
{Z Z' : C → Prop}
(h : ∀ ⦃X : C⦄, Z X → Z' X)

∀ {X Y : CategoryTheory.FullSubcategory Z} (f : X ⟶ Y), (CategoryTheory.FullSubcategory.map h).map f = f


protected theorem ediv_mul_cancel {a b : Int} (H : b ∣ a) : a / b * b = a


theorem prod_Ico_reflect (f : ℕ → M) (k : ℕ) {m n : ℕ} (h : m ≤ n + 1) :
    (∏ j ∈ Ico k m, f (n - j)) = ∏ j ∈ Ico (n + 1 - m) (n + 1 - k), f j

{M : Type u_2}
[CommMonoid M]
(f : ℕ → M)
(k : ℕ)
{m n : ℕ}
(h : m ≤ n + 1)

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


@[simp]
theorem levenshtein_nil_nil : levenshtein C [] [] = 0

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}


protected theorem Ordered.fill : ∀ {path : Path α} {t},
    (path.fill t).Ordered cmp ↔ path.Ordered cmp ∧ t.Ordered cmp ∧ t.All (path.RootOrdered cmp)

{α : Type u_1}
{cmp : α → α → Ordering}
{path : Batteries.RBNode.Path α}
{t : Batteries.RBNode α}

Batteries.RBNode.Ordered cmp (path.fill t) ↔
  Batteries.RBNode.Path.Ordered cmp path ∧
    Batteries.RBNode.Ordered cmp t ∧ Batteries.RBNode.All (Batteries.RBNode.Path.RootOrdered cmp path) t


theorem sin_add_pi_div_two (x : ℝ) : sin (x + π / 2) = cos x


theorem setIntegral_le [SigmaFiniteFiltration μ ℱ] {f : ι → Ω → ℝ} (hf : Supermartingale f ℱ μ)
    {i j : ι} (hij : i ≤ j) {s : Set Ω} (hs : MeasurableSet[ℱ i] s) :
    ∫ ω in s, f j ω ∂μ ≤ ∫ ω in s, f i ω ∂μ

{f : ι → Ω → ℝ}

(hf : MeasureTheory.Supermartingale f ℱ μ)

∫ (ω : Ω) in s, f j ω ∂μ ≤ ∫ (ω : Ω) in s, f i ω ∂μ


theorem symmDiff_symmDiff_symmDiff_comm : a ∆ b ∆ (c ∆ d) = a ∆ c ∆ (b ∆ d)

{α : Type u_2}
[GeneralizedBooleanAlgebra α]
(a b c d : α)


lemma uIcc_subset_Icc (ha : a₁ ∈ Icc a₂ b₂) (hb : b₁ ∈ Icc a₂ b₂) :
    [[a₁, b₁]] ⊆ Icc a₂ b₂

{α : Type u_1}
[Lattice α]
{a₁ a₂ b₁ b₂ : α}
(ha : a₁ ∈ Set.Icc a₂ b₂)
(hb : b₁ ∈ Set.Icc a₂ b₂)


@[simp]
theorem mkHom_f_0 : (mkHom P Q zero one one_zero_comm succ).f 0 = zero

(one_zero_comm : zero ≫ Q.d 0 1 = P.d 0 1 ≫ one)

(P.mkHom Q zero one one_zero_comm succ).f 0 = zero


theorem tan_nonpos_of_nonpos_of_neg_pi_div_two_le {x : ℝ} (hx0 : x ≤ 0) (hpx : -(π / 2) ≤ x) :
    tan x ≤ 0

{x : ℝ}
(hx0 : x ≤ 0)
(hpx : -(Real.pi / 2) ≤ x)


@[simp]
theorem range_sublist {m n : Nat} : range m <+ range n ↔ m ≤ n


theorem curry_eq_iff (f : A ⊗ Y ⟶ X) (g : Y ⟶ A ⟶[C] X) : curry f = g ↔ f = uncurry g

(f : CategoryTheory.MonoidalCategory.tensorObj A Y ⟶ X)

CategoryTheory.MonoidalClosed.curry f = g ↔ f = CategoryTheory.MonoidalClosed.uncurry g


@[simp]
theorem mul_monomial_modMonomial (s : σ →₀ ℕ) (x : MvPolynomial σ R) :
    x * monomial s 1 %ᵐᵒⁿᵒᵐⁱᵃˡ s = 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(s : σ →₀ ℕ)
(x : MvPolynomial σ R)

(x * (MvPolynomial.monomial s) 1).modMonomial s = 0


@[ext]
theorem ext ⦃f g : Q₁ →qᵢ Q₂⦄ (h : ∀ x, f x = g x) : f = g

{R : Type u_2}
{M₁ : Type u_4}
{M₂ : Type u_5}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
⦃f g : Q₁ →qᵢ Q₂⦄
(h : ∀ (x : M₁), f x = g x)


/-- A vector is in the same ray as a positive multiple of one it is in the same ray as. -/
theorem pos_smul_right (h : SameRay R x y) (ha : 0 < a) : SameRay R x (a • y)

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


theorem IsLocallyFaithful.ext [G.IsLocallyFaithful K] (ℱ : SheafOfTypes K)
    {X Y : C} (i₁ i₂ : X ⟶ Y) (e : G.map i₁ = G.map i₂)
    {s t : ℱ.val.obj (op (G.obj X))}
    (h : ∀ ⦃Z : C⦄ (j : Z ⟶ X), j ≫ i₁ = j ≫ i₂ →
      ℱ.1.map (G.map j).op s = ℱ.1.map (G.map j).op t) : s = t

{K : CategoryTheory.GrothendieckTopology D}

{s t : ℱ.val.obj (Opposite.op (G.obj X))}

(h :
  ∀ ⦃Z : C⦄ (j : Z ⟶ X),
    CategoryTheory.CategoryStruct.comp j i₁ = CategoryTheory.CategoryStruct.comp j i₂ →
      ℱ.val.map (G.map j).op s = ℱ.val.map (G.map j).op t)


@[simp]
theorem coe_of (R : Type u) [CommSemiring R] : (CommSemiRingCat.of R : Type u) = R


theorem ContinuousOn.if' {s : Set α} {p : α → Prop} {f g : α → β} [∀ a, Decidable (p a)]
    (hpf : ∀ a ∈ s ∩ frontier { a | p a },
      Tendsto f (𝓝[s ∩ { a | p a }] a) (𝓝 <| if p a then f a else g a))
    (hpg :
      ∀ a ∈ s ∩ frontier { a | p a },
        Tendsto g (𝓝[s ∩ { a | ¬p a }] a) (𝓝 <| if p a then f a else g a))
    (hf : ContinuousOn f <| s ∩ { a | p a }) (hg : ContinuousOn g <| s ∩ { a | ¬p a }) :
    ContinuousOn (fun a => if p a then f a else g a) s

(hpf : ∀ a ∈ s ∩ frontier {a | p a}, Filter.Tendsto f (𝓝[s ∩ {a | p a}] a) (𝓝 (if p a then f a else g a)))

(hpg : ∀ a ∈ s ∩ frontier {a | p a}, Filter.Tendsto g (𝓝[s ∩ {a | ¬p a}] a) (𝓝 (if p a then f a else g a)))


theorem factorial_mul_pow_sub_le_factorial {n m : ℕ} (hnm : n ≤ m) : n ! * n ^ (m - n) ≤ m !


@[fun_prop]
theorem differentiableAt_pi'' (hφ : ∀ i, DifferentiableAt 𝕜 (fun x => Φ x i) x) :
    DifferentiableAt 𝕜 Φ x

(hφ : ∀ (i : ι), DifferentiableAt 𝕜 (fun x => Φ x i) x)


@[to_additive bot_prod_bot]
theorem bot_prod_bot : (⊥ : Subsemigroup M).prod (⊥ : Subsemigroup N) = ⊥

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


@[deprecated ext_get (since := "2023-01-05")]
theorem ext_nthLe {l₁ l₂ : List α} (hl : length l₁ = length l₂)
    (h : ∀ n h₁ h₂, nthLe l₁ n h₁ = nthLe l₂ n h₂) : l₁ = l₂

(h : ∀ (n : ℕ) (h₁ : n < l₁.length) (h₂ : n < l₂.length), l₁.nthLe n h₁ = l₂.nthLe n h₂)


lemma natDegree_minpolyDiv_succ [Nontrivial S] :
    natDegree (minpolyDiv R x) + 1 = natDegree (minpoly R x)

{R : Type u_2}
{S : Type u_1}
[CommRing R]
[CommRing S]
[Algebra R S]
{x : S}
(hx : IsIntegral R x)
[Nontrivial S]

(minpolyDiv R x).natDegree + 1 = (minpoly R x).natDegree


@[simp]
theorem unmop_id {X : Cᴹᵒᵖ} : (𝟙 X).unmop = 𝟙 (unmop X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : Cᴹᵒᵖ}


/-- If `F` creates limits, and `D` has all limits, then `C` has all limits. -/
theorem hasLimits_of_hasLimits_createsLimits (F : C ⥤ D) [HasLimitsOfSize.{w, w'} D]
    [CreatesLimitsOfSize.{w, w'} F] : HasLimitsOfSize.{w, w'} C

[CategoryTheory.Limits.HasLimitsOfSize.{w, w', v₂, u₂} D]

[CategoryTheory.CreatesLimitsOfSize.{w, w', v₁, v₂, u₁, u₂} F]

CategoryTheory.Limits.HasLimitsOfSize.{w, w', v₁, u₁} C


@[simp]
theorem unop_functor_op_obj_map (X : Cᵒᵖ) {j₁ j₂ : J} (f : j₁ ⟶ j₂) :
    (unop ((Functor.op (const J)).obj X)).map f = 𝟙 (unop X)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
(X : Cᵒᵖ)
{j₁ j₂ : J}
(f : j₁ ⟶ j₂)

(Opposite.unop ((CategoryTheory.Functor.const J).op.obj X)).map f = 𝟙 (Opposite.unop X)


lemma chooseNatLt_aux {lo hi : Nat} (a : Nat) (h : Nat.succ lo ≤ a ∧ a ≤ hi) :
    lo ≤ Nat.pred a ∧ Nat.pred a < hi

{lo hi : ℕ}
(a : ℕ)
(h : lo.succ ≤ a ∧ a ≤ hi)


@[to_additive]
theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
    (h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α → γ → β} :
    ∏ p ∈ r, f p.1 p.2 = ∏ c ∈ s, ∏ a ∈ t c, f a c

(h : ∀ (p : α × γ), p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2)

{f : α → γ → β}


theorem tendsto_const_nhds {f : Filter α} : Tendsto (fun _ : α => x) f (𝓝 x)

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{f : Filter α}


theorem RingFilterBasis.submodulesBasisIsBasis (BR : RingFilterBasis R) {B : ι → Submodule R M}
    (hB : BR.SubmodulesBasis B) : @_root_.SubmodulesBasis ι R _ M _ _ BR.topology B

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
(BR : RingFilterBasis R)
{B : ι → Submodule R M}
(hB : BR.SubmodulesBasis B)


theorem ball_half_subset (y) (h : y ∈ ball x (ε / 2)) : ball y (ε / 2) ⊆ ball x ε

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}
(y : α)
(h : y ∈ Metric.ball x (ε / 2))


/-- The functor `F` is cartesian closed (ie preserves exponentials) if each natural transformation
`exp_comparison F A` is an isomorphism
-/
class CartesianClosedFunctor : Prop where
  comparison_iso : ∀ A, IsIso (expComparison F A)

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]

[self : CategoryTheory.CartesianClosedFunctor F]

CategoryTheory.IsIso (CategoryTheory.expComparison F A)


@[instance]
theorem nhdsWithin_isUnit_neBot : NeBot (𝓝[{ x : α | IsUnit x }] 0)

{α : Type u_1}
[NontriviallyNormedField α]


@[simp]
theorem powerset_zero : @powerset α 0 = {0}


theorem mul {U : Set R} (hU : U ∈ B) : ∃ V ∈ B, V * V ⊆ U

{R : Type u}
[Ring R]
(B : RingFilterBasis R)
{U : Set R}
(hU : U ∈ B)


/-- Right-regular multiplication on `R` is equivalent to `Rᵐᵒᵖ`-regularity of `R` itself. -/
theorem isRightRegular_iff [Mul R] {a : R} :
    IsRightRegular a ↔ IsSMulRegular R (MulOpposite.op a)


theorem coprime_iff_gcd_eq_one : Coprime m n ↔ gcd m n = 1


theorem epsilon_singleton {α : Sort u} (x : α) : @epsilon α ⟨x⟩ (fun y => y = x) = x


theorem cos_sub_pi_div_two (x : ℂ) : cos (x - π / 2) = sin x

Complex.cos (x - ↑Real.pi / 2) = Complex.sin x


lemma isOpen_preimage_ofLower : IsOpen (ofLower ⁻¹' s) ↔ (lower α).IsOpen s

IsOpen (⇑Topology.WithLower.ofLower ⁻¹' s) ↔ TopologicalSpace.IsOpen s


@[simp]
lemma coe_minimum_of_length_pos (h : 0 < l.length) :
    (l.minimum_of_length_pos h : α) = l.minimum

{α : Type u_1}
[LinearOrder α]
{l : List α}
(h : 0 < l.length)

↑(List.minimum_of_length_pos h) = l.minimum


theorem image_embedding [LE α] [LE β] (hs : IsAntichain (· ≤ ·) s) (φ : α ↪o β) :
    IsAntichain (· ≤ ·) (φ '' s)

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)

(φ : α ↪o β)

IsAntichain (fun x x_1 => x ≤ x_1) (⇑φ '' s)


@[simp, norm_cast]
theorem coe_sInf (S : Set (L.Substructure M)) :
    ((sInf S : L.Substructure M) : Set M) = ⋂ s ∈ S, (s : Set M)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(S : Set (L.Substructure M))


theorem elim_mk : ∀ (l : List ι) (f : ∀ i, α i) {i : ι} (hi : i ∈ l), (TProd.mk l f).elim hi = f i

{ι : Type u}
{α : ι → Type v}
[DecidableEq ι]
(l : List ι)
(f : (i : ι) → α i)
{i : ι}
(hi : i ∈ l)


@[csimp] theorem bind_eq_bindTR : @List.bind = @bindTR


@[simp, norm_cast]
theorem star_val_eq {x : selfAdjoint R} : star (x : R) = x

{R : Type u_1}
[AddGroup R]
[StarAddMonoid R]
{x : ↥(selfAdjoint R)}


lemma invOf_pow (m : α) [Invertible m] (n : ℕ) [Invertible (m ^ n)] : ⅟ (m ^ n) = ⅟ m ^ n

{α : Type u}
[Monoid α]
(m : α)
[Invertible m]
(n : ℕ)
[Invertible (m ^ n)]


theorem pullbackIsoProdSubtype_hom_snd (f : X ⟶ Z) (g : Y ⟶ Z) :
    (pullbackIsoProdSubtype f g).hom ≫ pullbackSnd f g = pullback.snd _ _

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(TopCat.pullbackIsoProdSubtype f g).hom ≫ TopCat.pullbackSnd f g = CategoryTheory.Limits.pullback.snd f g


@[simp]
theorem LieModule.toEnd_module_end :
    LieModule.toEnd R (Module.End R M) M = LieHom.id

(R : Type u)
(M : Type w)
[CommRing R]
[AddCommGroup M]
[Module R M]


/-- Every self-adjoint `LinearPMap` has dense domain.

This is not true by definition since we define the adjoint without the assumption that the
domain is dense, but the choice of the junk value implies that a `LinearPMap` cannot be self-adjoint
if it does not have dense domain. -/
theorem _root_.IsSelfAdjoint.dense_domain (hA : IsSelfAdjoint A) : Dense (A.domain : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{A : E →ₗ.[𝕜] E}
(hA : IsSelfAdjoint A)


/--
Similar to `Perm.recOn`, but the `swap` case is generalized to `Perm.swap'`,
where the tail of the lists are not necessarily the same.
-/
@[elab_as_elim] theorem Perm.recOnSwap'
    {motive : (l₁ : List α) → (l₂ : List α) → l₁ ~ l₂ → Prop} {l₁ l₂ : List α} (p : l₁ ~ l₂)
    (nil : motive [] [] .nil)
    (cons : ∀ x {l₁ l₂}, (h : l₁ ~ l₂) → motive l₁ l₂ h → motive (x :: l₁) (x :: l₂) (.cons x h))
    (swap' : ∀ x y {l₁ l₂}, (h : l₁ ~ l₂) → motive l₁ l₂ h →
      motive (y :: x :: l₁) (x :: y :: l₂) (.swap' _ _ h))
    (trans : ∀ {l₁ l₂ l₃}, (h₁ : l₁ ~ l₂) → (h₂ : l₂ ~ l₃) → motive l₁ l₂ h₁ → motive l₂ l₃ h₂ →
      motive l₁ l₃ (.trans h₁ h₂)) : motive l₁ l₂ p

{motive : (l₁ l₂ : List α) → l₁ ~ l₂ → Prop}

(cons : ∀ (x : α) {l₁ l₂ : List α} (h : l₁ ~ l₂), motive l₁ l₂ h → motive (x :: l₁) (x :: l₂) ⋯)

(swap' : ∀ (x y : α) {l₁ l₂ : List α} (h : l₁ ~ l₂), motive l₁ l₂ h → motive (y :: x :: l₁) (x :: y :: l₂) ⋯)

(trans : ∀ {l₁ l₂ l₃ : List α} (h₁ : l₁ ~ l₂) (h₂ : l₂ ~ l₃), motive l₁ l₂ h₁ → motive l₂ l₃ h₂ → motive l₁ l₃ ⋯)


lemma IsLowerSet.dirSupInacc (hs : IsLowerSet s) : DirSupInacc s

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


theorem toFinsupp_append {R : Type*} [AddZeroClass R] (l₁ l₂ : List R)
    [DecidablePred (getD (l₁ ++ l₂) · 0 ≠ 0)] [DecidablePred (getD l₁ · 0 ≠ 0)]
    [DecidablePred (getD l₂ · 0 ≠ 0)] :
    toFinsupp (l₁ ++ l₂) =
      toFinsupp l₁ + (toFinsupp l₂).embDomain (addLeftEmbedding l₁.length)

[DecidablePred fun x => (l₁ ++ l₂).getD x 0 ≠ 0]

[DecidablePred fun x => l₁.getD x 0 ≠ 0]

[DecidablePred fun x => l₂.getD x 0 ≠ 0]

(l₁ ++ l₂).toFinsupp = l₁.toFinsupp + Finsupp.embDomain (addLeftEmbedding l₁.length) l₂.toFinsupp


/-- The obvious equivalence `ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps]
def functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C

(CategoryTheory.ShortComplex.functorEquivalence J C).functor =
  CategoryTheory.ShortComplex.FunctorEquivalence.functor J C


theorem pair {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ] {f : α → β} {g : α → γ}
    (hf : Primrec f) (hg : Primrec g) : Primrec fun a => (f a, g a)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{f : α → β}
{g : α → γ}
(hf : Primrec f)
(hg : Primrec g)


/-- The product map of two `C^n` functions within a set at a point is `C^n`
within the product set at the product point. -/
theorem ContMDiffWithinAt.prod_map' {p : M × N} (hf : ContMDiffWithinAt I I' n f s p.1)
    (hg : ContMDiffWithinAt J J' n g r p.2) :
    ContMDiffWithinAt (I.prod J) (I'.prod J') n (Prod.map f g) (s ×ˢ r) p

{𝕜 : 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 : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{f : M → M'}
{s : Set M}
{n : ℕ∞}
{g : N → N'}
{r : Set N}
{p : M × N}
(hf : ContMDiffWithinAt I I' n f s p.1)
(hg : ContMDiffWithinAt J J' n g r p.2)


@[simp]
theorem mk₂'ₛₗ_apply (f : M → N → P) {H1 H2 H3 H4} (m : M) (n : N) :
    (mk₂'ₛₗ ρ₁₂ σ₁₂ f H1 H2 H3 H4 : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) m n = f m n

{H1 : ∀ (m₁ m₂ : M) (n : N), f (m₁ + m₂) n = f m₁ n + f m₂ n}

{H2 : ∀ (c : R) (m : M) (n : N), f (c • m) n = ρ₁₂ c • f m n}

{H3 : ∀ (m : M) (n₁ n₂ : N), f m (n₁ + n₂) = f m n₁ + f m n₂}

{H4 : ∀ (c : S) (m : M) (n : N), f m (c • n) = σ₁₂ c • f m n}

((LinearMap.mk₂'ₛₗ ρ₁₂ σ₁₂ f H1 H2 H3 H4) m) n = f m n


theorem Integrable.neg {f : α → β} (hf : Integrable f μ) : Integrable (-f) μ

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


theorem FiniteDimensional.of_finite_intermediateField
    [Finite (IntermediateField F E)] : FiniteDimensional F E

(F : Type u_1)
(E : Type u_2)
[Field F]
[Field E]
[Algebra F E]
[Finite (IntermediateField F E)]


theorem star_self_mem (x : A) : star x ∈ elementalStarAlgebra R x

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[StarRing A]
[TopologicalSemiring A]
[ContinuousStar A]
[Algebra R A]
[StarModule R A]
(x : A)


@[to_additive]
theorem lift_mk'_spec (x v) (y : S) : f.lift hg (f.mk' x y) = v ↔ g x = g y * v

{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 : M →+ P}
(hg : ∀ (y : ↥S), IsAddUnit (g ↑y))
(x : M)
(v : P)
(y : ↥S)

(f.lift hg) (f.mk' x y) = v ↔ g x = g ↑y + v


theorem of_add_rat : Irrational (x + q) → Irrational x


@[to_additive]
theorem HasProd.inv (h : HasProd f a) : HasProd (fun b ↦ (f b)⁻¹) a⁻¹

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{a : α}
(h : HasProd f a)


@[to_additive upperClosure_interior_subset] lemma upperClosure_interior_subset' (s : Set α) :
    (upperClosure (interior s) : Set α) ⊆ interior (upperClosure s)

{α : Type u_1}
[NormedOrderedAddGroup α]
(s : Set α)

↑(upperClosure (interior s)) ⊆ interior ↑(upperClosure s)


lemma mono_of_injective' [HasCoproduct (X ∘ ι)] [HasCoproduct X]
    [HasCoproduct (fun (k : ((Set.range ι)ᶜ : Set I)) => X k.1)] :
    Mono (Sigma.desc (f := X ∘ ι) (fun j => Sigma.ι X (ι j)))

[CategoryTheory.Limits.HasCoproduct (X ∘ ι)]

[CategoryTheory.Limits.HasCoproduct fun k => X ↑k]

CategoryTheory.Mono (CategoryTheory.Limits.Sigma.desc fun j => CategoryTheory.Limits.Sigma.ι X (ι j))


/-- See also the strictly more general `inital_comp` below. -/
theorem initial_equivalence_comp [IsEquivalence F] [Initial G] : Initial (F ⋙ G)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[F.IsEquivalence]
[G.Initial]


theorem eq_iff_eq (f : r ≃r s) {a b} : f a = f b ↔ a = b

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ≃r s)
{a b : α}


@[to_additive]
theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} :
    ∀ l : List ι,
      (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) →
        Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod)

{ι : Type u_1}
{α : Type u_2}
{M : Type u_3}
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{f : ι → α → M}
{x : Filter α}
{a : ι → M}
(l : List ι)

(∀ i ∈ l, Filter.Tendsto (f i) x (𝓝 (a i))) →
  Filter.Tendsto (fun b => (List.map (fun c => f c b) l).prod) x (𝓝 (List.map a l).prod)


theorem measure_mono_top (h : s₁ ⊆ s₂) (h₁ : μ s₁ = ∞) : μ s₂ = ∞

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s₁ s₂ : Set α}
(h : s₁ ⊆ s₂)
(h₁ : μ s₁ = ⊤)


@[reassoc]
theorem prod.map_swap {A B X Y : C} (f : A ⟶ B) (g : X ⟶ Y)
    [HasLimitsOfShape (Discrete WalkingPair) C] :
    prod.map (𝟙 X) f ≫ prod.map g (𝟙 B) = prod.map g (𝟙 A) ≫ prod.map (𝟙 Y) f

[CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) C]

CategoryTheory.Limits.prod.map (𝟙 X) f ≫ CategoryTheory.Limits.prod.map g (𝟙 B) =
  CategoryTheory.Limits.prod.map g (𝟙 A) ≫ CategoryTheory.Limits.prod.map (𝟙 Y) f


theorem map_nhds_eq (e : M₁ ≃SL[σ₁₂] M₂) (x : M₁) : map e (𝓝 x) = 𝓝 (e x)

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
(x : M₁)


lemma isLocallySurjective_sheafToPresheaf_map_iff :
    Presheaf.IsLocallySurjective J ((sheafToPresheaf J A).map φ) ↔ IsLocallySurjective φ

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.Presheaf.IsLocallySurjective J ((CategoryTheory.sheafToPresheaf J A).map φ) ↔
  CategoryTheory.Sheaf.IsLocallySurjective φ


theorem Bounded.mem_gt : ∀ {t o} {x : α}, Bounded t x o → All (· > x) t

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

t.Bounded (↑x) o → Ordnode.All (fun x_1 => x_1 > x) t


@[simp]
theorem isBigOWith_abs_right : (IsBigOWith c l f fun x => |u x|) ↔ IsBigOWith c l f u

{α : Type u_1}
{E : Type u_3}
[Norm E]
{c : ℝ}
{f : α → E}
{l : Filter α}
{u : α → ℝ}

(Asymptotics.IsBigOWith c l f fun x => |u x|) ↔ Asymptotics.IsBigOWith c l f u


/-- Given f : Y ⟶ X, this is the obvious functor from (T/X)/f to T/Y -/
@[simps]
def iteratedSliceForward : Over f ⥤ Over f.left

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

f.iteratedSliceForward.obj α = CategoryTheory.Over.mk α.hom.left


theorem le_of_forall_lf {x y : PGame} (h₁ : ∀ i, x.moveLeft i ⧏ y) (h₂ : ∀ j, x ⧏ y.moveRight j) :
    x ≤ y

(h₁ : ∀ (i : x.LeftMoves), (x.moveLeft i).LF y)

(h₂ : ∀ (j : y.RightMoves), x.LF (y.moveRight j))


/-- A finite-dimensional `InnerProductSpace` has an orthonormal basis. -/
irreducible_def stdOrthonormalBasis : OrthonormalBasis (Fin (finrank 𝕜 E)) 𝕜 E

(𝕜 : Type u_8)
[RCLike 𝕜]
(E : Type u_9)
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[FiniteDimensional 𝕜 E]

stdOrthonormalBasis 𝕜 E =
  let b := Classical.choose ⋯;
  ⋯.mpr (b.reindex (Fintype.equivFinOfCardEq ⋯))


theorem Equiv.fg_iff {N : Type*} [L.Structure N] (f : M ≃[L] N) :
    Structure.FG L M ↔ Structure.FG L N

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N : Type u_2}
[L.Structure N]
(f : M ≃[L] N)

FirstOrder.Language.Structure.FG L M ↔ FirstOrder.Language.Structure.FG L N


@[simp]
theorem mul_bot (S : AddSubmonoid R) : S * ⊥ = ⊥

{R : Type u_4}
[NonUnitalNonAssocSemiring R]
(S : AddSubmonoid R)


/-- A measure `μ` is inner regular for finite measure sets with respect to compact sets:
for any measurable set `s` with finite measure, then `μ(s) = sup {μ(K) | K ⊆ s compact}`.
The main interest of this class is that it is satisfied for both natural Haar measures (the
regular one and the inner regular one). -/
class InnerRegularCompactLTTop (μ : Measure α) : Prop where
  protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[self : μ.InnerRegularCompactLTTop]

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


/-- Picard-Lindelöf (Cauchy-Lipschitz) theorem. -/
theorem IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq [CompleteSpace E] {v : ℝ → E → E}
    {tMin t₀ tMax : ℝ} (x₀ : E) {C R : ℝ} {L : ℝ≥0}
    (hpl : IsPicardLindelof v tMin t₀ tMax x₀ L R C) :
    ∃ f : ℝ → E, f t₀ = x₀ ∧
      ∀ t ∈ Icc tMin tMax, HasDerivWithinAt f (v t (f t)) (Icc tMin tMax) t

∃ f, f t₀ = x₀ ∧ ∀ t ∈ Set.Icc tMin tMax, HasDerivWithinAt f (v t (f t)) (Set.Icc tMin tMax) t


/-- This lemma implies that a single function is uniformly integrable (in the probability sense). -/
theorem Memℒp.eLpNorm_indicator_norm_ge_pos_le (hf : Memℒp f p μ) (hmeas : StronglyMeasurable f)
    {ε : ℝ} (hε : 0 < ε) :
    ∃ M : ℝ, 0 < M ∧ eLpNorm ({ x | M ≤ ‖f x‖₊ }.indicator f) p μ ≤ ENNReal.ofReal ε

(hmeas : MeasureTheory.StronglyMeasurable f)

∃ M, 0 < M ∧ MeasureTheory.eLpNorm ({x | M ≤ ↑‖f x‖₊}.indicator f) p μ ≤ ENNReal.ofReal ε


lemma exponentialCDFReal_eq_integral {r : ℝ} (hr : 0 < r) (x : ℝ) :
    exponentialCDFReal r x = ∫ x in Iic x, exponentialPDFReal r x

↑(ProbabilityTheory.exponentialCDFReal r) x = ∫ (x : ℝ) in Set.Iic x, ProbabilityTheory.exponentialPDFReal r x


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

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

((CategoryTheory.Comma.mapRightIso L i).counitIso.inv.app X).left = CategoryTheory.CategoryStruct.id X.left


/-- The functor `(F ⋙ G, S) ⥤ (G, S)`. -/
@[simps!]
def pre (F : B ⥤ C) (G : C ⥤ D) (S : D) : CostructuredArrow (F ⋙ G) S ⥤ CostructuredArrow G S

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{B : Type u₄}
[CategoryTheory.Category.{v₄, u₄} B]
(F : CategoryTheory.Functor B C)
(G : CategoryTheory.Functor C D)
(S : D)

∀ {X Y : CategoryTheory.Comma (F.comp G) (CategoryTheory.Functor.fromPUnit S)} (f : X ⟶ Y),
  ((CategoryTheory.CostructuredArrow.pre F G S).map f).right = CategoryTheory.CategoryStruct.id X.right


/-- The relation `≤` on a preorder is reflexive. -/
@[refl]
theorem le_refl : ∀ a : α, a ≤ a


/-- Extending a cone by the identity does nothing. -/
@[simps!]
def extendId (s : Cone F) : s.extend (𝟙 s.pt) ≅ s

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cone F)

(CategoryTheory.Limits.Cones.extendId s).hom.hom = 𝟙 s.pt


theorem fixed_point_card_lt_of_ne_one [DecidableEq α] [Fintype α] {σ : Perm α} (h : σ ≠ 1) :
    (filter (fun x => σ x = x) univ).card < Fintype.card α - 1

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{σ : Equiv.Perm α}
(h : σ ≠ 1)

(Finset.filter (fun x => σ x = x) Finset.univ).card < Fintype.card α - 1


theorem coeff_det_X_add_C_zero (A B : Matrix n n α) :
    coeff (det ((X : α[X]) • A.map C + B.map C)) 0 = det B

{n : Type u_1}
{α : Type u_2}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A B : Matrix n n α)

(Polynomial.X • A.map ⇑Polynomial.C + B.map ⇑Polynomial.C).det.coeff 0 = B.det


/-- Note that the `IsScalarTower α β β` typeclass argument is usually satisfied by `Algebra α β`. -/
@[to_additive] -- Porting note: nolint to_additive_doc
lemma smul_mul_assoc [Mul β] [SMul α β] [IsScalarTower α β β] (r : α) (x y : β) :
    r • x * y = r • (x * y)

{α : Type u_7}
{β : Type u_8}
[Mul β]
[SMul α β]
[IsScalarTower α β β]
(r : α)
(x y : β)


/-- (internal implementation) the limit cone of a functor,
implemented as flat sections of a pi type
-/
@[simps]
noncomputable def limitCone (F : J ⥤ TypeMax.{v, u}) : Cone F

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

(CategoryTheory.Limits.Types.limitCone F).pt = ↑F.sections


theorem ncard_le_ncard_iff_ncard_diff_le_ncard_diff (hs : s.Finite := by toFinite_tac)
    (ht : t.Finite := by toFinite_tac) : s.ncard ≤ t.ncard ↔ (s \ t).ncard ≤ (t \ s).ncard

{α : Type u_1}
{s t : Set α}
(hs : s.Finite := by toFinite_tac)
(ht : t.Finite := by toFinite_tac)


@[simp]
protected theorem map_sub {S} [Ring S] (f : R →+* S) : (p - q).map f = p.map f - q.map f

{R : Type u}
[Ring R]
{p q : R[X]}
{S : Type u_1}
[Ring S]
(f : R →+* S)

Polynomial.map f (p - q) = Polynomial.map f p - Polynomial.map f q


@[simp]
theorem cancel_iso_inv_right_assoc {W X X' Y Z : C} (f : W ⟶ X) (g : X ⟶ Y) (f' : W ⟶ X')
    (g' : X' ⟶ Y) (h : Z ≅ Y) : f ≫ g ≫ h.inv = f' ≫ g' ≫ h.inv ↔ f ≫ g = f' ≫ g'

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

CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.comp g h.inv) =
    CategoryTheory.CategoryStruct.comp f' (CategoryTheory.CategoryStruct.comp g' h.inv) ↔
  CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f' g'


/-- Transfer `IsBigOWith` over a `PartialHomeomorph`. -/
theorem isBigOWith_congr (e : PartialHomeomorph α β) {b : β} (hb : b ∈ e.target) {f : β → E}
    {g : β → F} {C : ℝ} : IsBigOWith C (𝓝 b) f g ↔ IsBigOWith C (𝓝 (e.symm b)) (f ∘ e) (g ∘ e)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{E : Type u_3}
[Norm E]
{F : Type u_4}
[Norm F]
(e : PartialHomeomorph α β)
{b : β}
(hb : b ∈ e.target)
{f : β → E}
{g : β → F}
{C : ℝ}

Asymptotics.IsBigOWith C (𝓝 b) f g ↔ Asymptotics.IsBigOWith C (𝓝 (↑e.symm b)) (f ∘ ↑e) (g ∘ ↑e)


theorem uniqueDiffOn_Ioo (a b : ℝ) : UniqueDiffOn ℝ (Ioo a b)


theorem map_comap_le : map f (comap f J) ≤ J

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
{J : LieIdeal R L'}


@[simp] lemma mem_Ico : x ∈ Ico a b ↔ a ≤ x ∧ x < b

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


@[simp]
theorem toContinuousLinearEquiv_inj {f g : E ≃ₛₗᵢ[σ₁₂] E₂} :
    f.toContinuousLinearEquiv = g.toContinuousLinearEquiv ↔ f = g

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
{f g : E ≃ₛₗᵢ[σ₁₂] E₂}


@[simp]
theorem implicitToPartialHomeomorph_apply_ker (hf : HasStrictFDerivAt f f' a) (hf' : range f' = ⊤)
    (y : ker f') : hf.implicitToPartialHomeomorph f f' hf' (y + a) = (f (y + a), y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[FiniteDimensional 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f f' a)
(hf' : LinearMap.range f' = ⊤)
(y : ↥(LinearMap.ker f'))

↑(HasStrictFDerivAt.implicitToPartialHomeomorph f f' hf hf') (↑y + a) = (f (↑y + a), y)


@[simp]
theorem toSet_sUnion (x : ZFSet.{u}) : (⋃₀ x).toSet = ⋃₀ (toSet '' x.toSet)

(⋃₀ x).toSet = ⋃₀ (ZFSet.toSet '' x.toSet)


theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α]
    [SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a }

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

⊥ = TopologicalSpace.generateFrom {s | ∃ a, s = Set.Ioi a ∨ s = Set.Iio a}


@[to_additive]
theorem card_quotient_rightRel [Fintype (α ⧸ s)] :
    Fintype.card (Quotient (QuotientGroup.rightRel s)) = Fintype.card (α ⧸ s)

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)
[Fintype (α ⧸ s)]

Fintype.card (Quotient (QuotientAddGroup.rightRel s)) = Fintype.card (α ⧸ s)


theorem gfp_induction {p : α → Prop} (step : ∀ a, p a → gfp f ≤ a → p (f a))
    (hInf : ∀ s, (∀ a ∈ s, p a) → p (sInf s)) : p (gfp f)

(step : ∀ (a : α), p a → OrderHom.gfp f ≤ a → p (f a))

(hInf : ∀ (s : Set α), (∀ a ∈ s, p a) → p (sInf s))


theorem eventually_measure_le_scaling_constant_mul (K : ℝ) :
    ∀ᶠ r in 𝓝[>] 0, ∀ x, μ (closedBall x (K * r)) ≤ scalingConstantOf μ K * μ (closedBall x r)

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

∀ᶠ (r : ℝ) in 𝓝[>] 0,
  ∀ (x : α),
    μ (Metric.closedBall x (K * r)) ≤ ↑(IsUnifLocDoublingMeasure.scalingConstantOf μ K) * μ (Metric.closedBall x r)


@[symm]
theorem OneOneEquiv.symm {α β} [Primcodable α] [Primcodable β] {p : α → Prop} {q : β → Prop} :
    OneOneEquiv p q → OneOneEquiv q p

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : α → Prop}
{q : β → Prop}


theorem lift.unique' {φ' : (⨂[R] i, s i) →ₗ[R] E}
    (H : φ'.compMultilinearMap (PiTensorProduct.tprod R) = φ) : φ' = lift φ

{φ' : (PiTensorProduct R fun i => s i) →ₗ[R] E}


theorem coe_equiv_snd_eq_one_iff_mem {g : G} (h1 : 1 ∈ T) :
    ((hST.equiv g).snd : G) = 1 ↔ g ∈ S

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
{g : G}
(h1 : 1 ∈ T)


@[simp]
theorem Equiv.Perm.decomposeFin_symm_apply_one {n : ℕ} (e : Perm (Fin (n + 1))) (p : Fin (n + 2)) :
    Equiv.Perm.decomposeFin.symm (p, e) 1 = swap 0 p (e 0).succ

{n : ℕ}
(e : Equiv.Perm (Fin (n + 1)))
(p : Fin (n + 2))

(Equiv.Perm.decomposeFin.symm (p, e)) 1 = (Equiv.swap 0 p) (e 0).succ


/-- The forgetful monoidal functor from a full monoidal subcategory into the original category
("forgetting" the condition).
-/
@[simps]
def fullMonoidalSubcategoryInclusion : MonoidalFunctor (FullSubcategory P) C

(CategoryTheory.MonoidalCategory.fullMonoidalSubcategoryInclusion P).toFunctor =
  CategoryTheory.fullSubcategoryInclusion P


/--
    If `P : ℤ → Prop` is a predicate such that the set `{m : P m}` is bounded above and nonempty,
    then this set has the greatest element. This lemma uses classical logic to avoid assumption
    `[DecidablePred P]`. See `Int.greatestOfBdd` for a constructive counterpart. -/
theorem exists_greatest_of_bdd
    {P : ℤ → Prop}
    (Hbdd : ∃ b : ℤ , ∀ z : ℤ , P z → z ≤ b)
    (Hinh : ∃ z : ℤ , P z) : ∃ ub : ℤ , P ub ∧ ∀ z : ℤ , P z → z ≤ ub

{P : ℤ → Prop}
(Hbdd : ∃ b, ∀ (z : ℤ), P z → z ≤ b)
(Hinh : ∃ z, P z)


theorem Superset.trans {s₁ s₂ s₃ : Finset α} : s₁ ⊇ s₂ → s₂ ⊇ s₃ → s₁ ⊇ s₃

s₁ ⊇ s₂ → s₂ ⊇ s₃ → s₁ ⊇ s₃


theorem rpow_add_rpow_le {p q : ℝ} (a b : ℝ≥0) (hp_pos : 0 < p) (hpq : p ≤ q) :
    (a ^ q + b ^ q) ^ (1 / q) ≤ (a ^ p + b ^ p) ^ (1 / p)


theorem factorization_le_iff_dvd {d n : ℕ} (hd : d ≠ 0) (hn : n ≠ 0) :
    d.factorization ≤ n.factorization ↔ d ∣ n


@[norm_cast]
theorem coe_sSup (s : Set ℝ≥0) : (↑(sSup s) : ℝ) = sSup (((↑) : ℝ≥0 → ℝ) '' s)


protected theorem mul_div_cancel' {a b : Int} (H : a ∣ b) : a * b.div a = b


@[to_additive]
theorem continuous_finprod {f : ι → X → M} (hc : ∀ i, Continuous (f i))
    (hf : LocallyFinite fun i => mulSupport (f i)) : Continuous fun x => ∏ᶠ i, f i x

(hf : LocallyFinite fun i => Function.mulSupport (f i))


private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂


@[simp]
theorem flag_last (b : Basis (Fin n) R M) : b.flag (.last n) = ⊤

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(b : Basis (Fin n) R M)


theorem succ_ne_last_iff (a : Fin (n + 1)) : succ a ≠ last (n + 1) ↔ a ≠ last n

a.succ ≠ Fin.last (n + 1) ↔ a ≠ Fin.last n


@[to_additive (attr := simp)]
theorem one_mem_div_iff : (1 : α) ∈ s / t ↔ ¬Disjoint s t

{α : Type u_2}
[DecidableEq α]
[Group α]
{s t : Finset α}


@[to_additive]
-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it.
theorem pure_div_pure : (pure a : Filter α) / pure b = pure (a / b)


theorem continuousOn_extend : ContinuousOn (f.extend I) (f.extend I).source

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)

ContinuousOn (↑(f.extend I)) (f.extend I).source


@[simp, norm_cast]
theorem coeFn_add (μ ν : FiniteMeasure Ω) : (⇑(μ + ν) : Set Ω → ℝ≥0) = (⇑μ + ⇑ν : Set Ω → ℝ≥0)

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ ν : MeasureTheory.FiniteMeasure Ω)

⇑(μ + ν) = ⇑μ + ⇑ν


theorem RelIso.minimals_preimage_eq (f : r ≃r s) (y : Set β) :
    minimals r (f ⁻¹' y) = f ⁻¹' (minimals s y)

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

minimals r (⇑f ⁻¹' y) = ⇑f ⁻¹' minimals s y


@[continuity, fun_prop]
protected theorem continuous_eval₂ [Semiring S] (p : S[X]) (f : S →+* R) :
    Continuous fun x => p.eval₂ f x

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
[Semiring S]
(p : Polynomial S)
(f : S →+* R)

Continuous fun x => Polynomial.eval₂ f x p


theorem Filter.Tendsto.subseq_mem_entourage {V : ℕ → Set (α × α)} (hV : ∀ n, V n ∈ 𝓤 α) {u : ℕ → α}
    {a : α} (hu : Tendsto u atTop (𝓝 a)) : ∃ φ : ℕ → ℕ, StrictMono φ ∧ (u (φ 0), a) ∈ V 0 ∧
      ∀ n, (u <| φ (n + 1), u <| φ n) ∈ V (n + 1)

(hu : Filter.Tendsto u Filter.atTop (𝓝 a))

∃ φ, StrictMono φ ∧ (u (φ 0), a) ∈ V 0 ∧ ∀ (n : ℕ), (u (φ (n + 1)), u (φ n)) ∈ V (n + 1)


theorem factorial_dvd_descFactorial (n k : ℕ) : k ! ∣ n.descFactorial k


@[to_additive]
theorem nhds_one_eq (B : GroupFilterBasis G) :
    @nhds G B.topology (1 : G) = B.toFilterBasis.filter

{G : Type u}
[AddGroup G]
(B : AddGroupFilterBasis G)

𝓝 0 = AddGroupFilterBasis.toFilterBasis.filter


/-- In each positive degree, this lemma decomposes the idempotent endomorphism
`Q q` as a sum of morphisms which are postcompositions with suitable degeneracies.
As `Q q` is the complement projection to `P q`, this implies that in the case of
simplicial abelian groups, any $(n+1)$-simplex $x$ can be decomposed as
$x = x' + \sum (i=0}^{q-1} σ_{n-i}(y_i)$ where $x'$ is in the image of `P q` and
the $y_i$ are in degree $n$. -/
theorem decomposition_Q (n q : ℕ) :
    ((Q q).f (n + 1) : X _[n + 1] ⟶ X _[n + 1]) =
      ∑ i ∈ Finset.filter (fun i : Fin (n + 1) => (i : ℕ) < q) Finset.univ,
        (P i).f (n + 1) ≫ X.δ i.rev.succ ≫ X.σ (Fin.rev i)

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

(AlgebraicTopology.DoldKan.Q q).f (n + 1) =
  ∑ i ∈ Finset.filter (fun i => ↑i < q) Finset.univ,
    (AlgebraicTopology.DoldKan.P ↑i).f (n + 1) ≫ X.δ i.rev.succ ≫ X.σ i.rev


@[simp]
theorem coe_toLinearIsometry : ⇑e.toLinearIsometry = e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


theorem ext_ring_iff {f g : R →ₑ+[σ] N'} : f = g ↔ f 1 = g 1

{R : Type u_11}
[Semiring R]
{S : Type u_13}
[Semiring S]
{N' : Type u_16}
[AddMonoid N']
[DistribMulAction S N']
{σ : R →* S}
{f g : R →ₑ+[σ] N'}


theorem le_f_of_mem_approx {x} : x ∈ approxChain f → x ≤ f x

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))


@[field_simps] lemma div_eq_iff (hb : b ≠ 0) : a / b = c ↔ a = c * b

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


@[simp]
theorem isPredLimit_iff : IsPredLimit a ↔ IsMax a

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
{a : α}
[IsPredArchimedean α]


/-- `HasFTaylorSeriesUpToOn n f p s` registers the fact that `p 0 = f` and `p (m+1)` is a
derivative of `p m` for `m < n`, and is continuous for `m ≤ n`. This is a predicate analogous to
`HasFDerivWithinAt` but for higher order derivatives.

Notice that `p` does not sum up to `f` on the diagonal (`FormalMultilinearSeries.sum`), even if
`f` is analytic and `n = ∞`: an additional `1/m!` factor on the `m`th term is necessary for that. -/
structure HasFTaylorSeriesUpToOn (n : ℕ∞) (f : E → F) (p : E → FormalMultilinearSeries 𝕜 E F)
  (s : Set E) : Prop where
  zero_eq : ∀ x ∈ s, (p x 0).uncurry0 = f x
  protected fderivWithin : ∀ m : ℕ, (m : ℕ∞) < n → ∀ x ∈ s,
    HasFDerivWithinAt (p · m) (p x m.succ).curryLeft s x
  cont : ∀ m : ℕ, (m : ℕ∞) ≤ n → ContinuousOn (p · m) s

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

↑m ≤ n → ContinuousOn (fun x => p x m) s


lemma mor₃_eq_zero_iff_mono₁ : T.mor₃ = 0 ↔ Mono T.mor₁

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


@[to_additive (attr := simp)]
theorem units_inv_left_iff : Commute (↑u⁻¹) a ↔ Commute (↑u) a

{M : Type u_1}
[AddMonoid M]
{a : M}
{u : AddUnits M}

AddCommute (↑(-u)) a ↔ AddCommute (↑u) a


theorem bot_eq_one [Monoid α] : (⊥ : Associates α) = 1


theorem mapMono_eq_zero (i : Δ' ⟶ Δ) [Mono i] (h₁ : Δ ≠ Δ') (h₂ : ¬Isδ₀ i) : mapMono K i = 0

(h₂ : ¬AlgebraicTopology.DoldKan.Isδ₀ i)

AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i = 0


theorem condexp_zero_or_one_of_measurableSet_limsup [StandardBorelSpace Ω] [Nonempty Ω]
    (hm : m ≤ m0) [IsFiniteMeasure μ]
    (h_le : ∀ n, s n ≤ m0) (h_indep : iCondIndep m hm s μ)
    (hf : ∀ t, p t → tᶜ ∈ f) (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a))
    (hns_univ : ∀ n, ∃ a, n ∈ ns a) {t : Set Ω} (ht_tail : MeasurableSet[limsup s f] t) :
    ∀ᵐ ω ∂μ, (μ⟦t | m⟧) ω = 0 ∨ (μ⟦t | m⟧) ω = 1

(h_indep : ProbabilityTheory.iCondIndep m hm s μ)

(hns : Directed (fun x x_1 => x ≤ x_1) ns)

∀ᵐ (ω : Ω) ∂μ, (μ[t.indicator fun ω => 1|m]) ω = 0 ∨ (μ[t.indicator fun ω => 1|m]) ω = 1


@[to_additive add_abs_nonneg] lemma one_le_mul_mabs (a : α) : 1 ≤ a * |a|ₘ

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


theorem IsRefl.nondegenerate_of_separatingRight {B : M →ₗ[R] M →ₗ[R] M₁} (hB : B.IsRefl)
    (hB' : B.SeparatingRight) : B.Nondegenerate

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
{B : M →ₗ[R] M →ₗ[R] M₁}
(hB : B.IsRefl)
(hB' : B.SeparatingRight)


lemma tsub_one_mul (a b : α) : (a - 1) * b = a * b - b

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


@[to_additive]
theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
    (∏ x ∈ range (n + m), f x) = (∏ x ∈ range n, f x) * ∏ x ∈ range m, f (n + x)

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

∏ x ∈ Finset.range (n + m), f x = (∏ x ∈ Finset.range n, f x) * ∏ x ∈ Finset.range m, f (n + x)


@[simp]
theorem argAux_self (hr₀ : Irreflexive r) (a : α) : argAux r (some a) a = a

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
(hr₀ : Irreflexive r)
(a : α)


@[simp, norm_cast]
theorem coe_iInf {ι} (s : ι → Closeds α) : ((⨅ i, s i : Closeds α) : Set α) = ⋂ i, s i

{α : Type u_2}
[TopologicalSpace α]
{ι : Sort u_4}
(s : ι → TopologicalSpace.Closeds α)


@[simp]
theorem coe_range : (f.range : Set S) = Set.range f

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


/-- Passing from `Mon_ (C ⥤ C)` to `Monad C` is functorial. -/
@[simps]
def monToMonad : Mon_ (C ⥤ C) ⥤ Monad C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(M : Mon_ (CategoryTheory.Functor C C))

(CategoryTheory.Monad.monToMonad C).obj M = CategoryTheory.Monad.ofMon M


@[to_additive (attr := simp)]
theorem coe_mul (f g : α →*o β) : ⇑(f * g) = f * g

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
(f g : α →+o β)


@[simp]
theorem coe_pointwise_smul (m : M) (S : Subring R) : ↑(m • S) = m • (S : Set R)

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


theorem neg_pi_lt_log_im (x : ℂ) : -π < (log x).im


@[simp]
theorem sup_eq_add (I J : FractionalIdeal S P) : I ⊔ J = I + J

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I J : FractionalIdeal S P)


/-- The inclusion functor into the disjoint union of categories. -/
@[simps map]
def incl (i : I) : C i ⥤ Σi, C i

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

∀ {X Y : C i} (a : X ⟶ Y), (CategoryTheory.Sigma.incl i).map a = CategoryTheory.Sigma.SigmaHom.mk a


/-- A `DivInvMonoid` is a `Monoid` with operations `/` and `⁻¹` satisfying
`div_eq_mul_inv : ∀ a b, a / b = a * b⁻¹`.

This deduplicates the name `div_eq_mul_inv`.
The default for `div` is such that `a / b = a * b⁻¹` holds by definition.

Adding `div` as a field rather than defining `a / b := a * b⁻¹` allows us to
avoid certain classes of unification failures, for example:
Let `Foo X` be a type with a `∀ X, Div (Foo X)` instance but no
`∀ X, Inv (Foo X)`, e.g. when `Foo X` is a `EuclideanDomain`. Suppose we
also have an instance `∀ X [Cromulent X], GroupWithZero (Foo X)`. Then the
`(/)` coming from `GroupWithZero.div` cannot be definitionally equal to
the `(/)` coming from `Foo.Div`.

In the same way, adding a `zpow` field makes it possible to avoid definitional failures
in diamonds. See the definition of `Monoid` and Note [forgetful inheritance] for more
explanations on this.
-/
class DivInvMonoid (G : Type u) extends Monoid G, Inv G, Div G where
  protected div := DivInvMonoid.div'
  /-- `a / b := a * b⁻¹` -/
  protected div_eq_mul_inv : ∀ a b : G, a / b = a * b⁻¹ := by intros; rfl
  /-- The power operation: `a ^ n = a * ··· * a`; `a ^ (-n) = a⁻¹ * ··· a⁻¹` (`n` times) -/
  protected zpow : ℤ → G → G := zpowRec npowRec
  /-- `a ^ 0 = 1` -/
  protected zpow_zero' : ∀ a : G, zpow 0 a = 1 := by intros; rfl
  /-- `a ^ (n + 1) = a ^ n * a` -/
  protected zpow_succ' (n : ℕ) (a : G) : zpow (Int.ofNat n.succ) a = zpow (Int.ofNat n) a  * a := by
    intros; rfl
  /-- `a ^ -(n + 1) = (a ^ (n + 1))⁻¹` -/
  protected zpow_neg' (n : ℕ) (a : G) : zpow (Int.negSucc n) a = (zpow n.succ a)⁻¹ := by intros; rfl

{G : Type u}
[self : DivInvMonoid G]
(n : ℕ)
(a : G)

DivInvMonoid.zpow (Int.ofNat n.succ) a = DivInvMonoid.zpow (Int.ofNat n) a * a


theorem Memℒp.norm_rpow {f : α → E} (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    Memℒp (fun x : α => ‖f x‖ ^ p.toReal) 1 μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
(hf : MeasureTheory.Memℒp f p μ)
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)

MeasureTheory.Memℒp (fun x => ‖f x‖ ^ p.toReal) 1 μ


/-- A closed operator is trivially closable. -/
theorem IsClosed.isClosable {f : E →ₗ.[R] F} (hf : f.IsClosed) : f.IsClosable

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
{f : E →ₗ.[R] F}
(hf : f.IsClosed)


theorem of_iSup_eq_top
    {ι} (U : ι → Y.affineOpens) (hU : ⨆ i, (U i : Y.Opens) = ⊤)
    (hU' : ∀ i, Q (f ∣_ U i)) :
    P f

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


theorem connectedComponentIn_univ (x : α) : connectedComponentIn univ x = connectedComponent x

{α : Type u}
[TopologicalSpace α]
(x : α)

connectedComponentIn Set.univ x = connectedComponent x


/-- Embedding `Fin n` into `Fin (n + 1)` with a hole around `last n` embeds by `castSucc`. -/
@[simp] lemma succAbove_last : succAbove (last n) = castSucc


theorem adjoin_singleton_one : adjoin R ({1} : Set A) = ⊥

(R : Type uR)
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]


theorem CauchySeq.mem_entourage {β : Type*} [SemilatticeSup β] {u : β → α} (h : CauchySeq u)
    {V : Set (α × α)} (hV : V ∈ 𝓤 α) : ∃ k₀, ∀ i j, k₀ ≤ i → k₀ ≤ j → (u i, u j) ∈ V

{α : Type u}
[uniformSpace : UniformSpace α]
{β : Type u_1}
[SemilatticeSup β]
{u : β → α}
(h : CauchySeq u)
{V : Set (α × α)}
(hV : V ∈ 𝓤 α)

∃ k₀, ∀ (i j : β), k₀ ≤ i → k₀ ≤ j → (u i, u j) ∈ V


@[deprecated (since := "2024-06-09")] theorem card_divisors (n : ℕ) (hn : n ≠ 0) :
    n.divisors.card = n.primeFactors.prod (n.factorization · + 1)

n.divisors.card = ∏ x ∈ n.primeFactors, (n.factorization x + 1)


theorem zneg_pos (n : PosNum) : -pos n = neg n


theorem mem_map_seq_iff {f : Filter α} {g : Filter β} {m : α → β → γ} {s : Set γ} :
    s ∈ (f.map m).seq g ↔ ∃ t u, t ∈ g ∧ u ∈ f ∧ ∀ x ∈ u, ∀ y ∈ t, m x y ∈ s

{α : Type u}
{β : Type v}
{γ : Type w}
{f : Filter α}
{g : Filter β}
{m : α → β → γ}
{s : Set γ}

s ∈ (Filter.map m f).seq g ↔ ∃ t u, t ∈ g ∧ u ∈ f ∧ ∀ x ∈ u, ∀ y ∈ t, m x y ∈ s


theorem isClique_map_iff_of_nontrivial {f : α ↪ β} {t : Set β} (ht : t.Nontrivial) :
    (G.map f).IsClique t ↔ ∃ (s : Set α), G.IsClique s ∧ f '' s = t

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{f : α ↪ β}
{t : Set β}
(ht : t.Nontrivial)

(SimpleGraph.map f G).IsClique t ↔ ∃ s, G.IsClique s ∧ ⇑f '' s = t


theorem adj_comm (G' : Subgraph G) (v w : V) : G'.Adj v w ↔ G'.Adj w v

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
(v w : V)


/-- A rotation of a vector equals that vector if and only if the vector or the angle is zero. -/
theorem rotation_eq_self_iff (x : V) (θ : Real.Angle) : o.rotation θ x = x ↔ x = 0 ∨ θ = 0

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


@[reassoc (attr := simp, elementwise)]
lemma moduleCatCyclesIso_inv_π :
    S.moduleCatCyclesIso.inv ≫ S.homologyπ =
       S.moduleCatHomologyπ ≫ S.moduleCatHomologyIso.inv

(S : CategoryTheory.ShortComplex (ModuleCat R))

CategoryTheory.CategoryStruct.comp S.moduleCatCyclesIso.inv S.homologyπ =
  CategoryTheory.CategoryStruct.comp S.moduleCatHomologyπ S.moduleCatHomologyIso.inv


@[simp]
theorem self_trans_symm (e : α ≃o β) : e.trans e.symm = OrderIso.refl α

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


lemma NNRat.cast_nonneg (q : ℚ≥0) : 0 ≤ (q : α)

{α : Type u_1}
[LinearOrderedSemifield α]
(q : ℚ≥0)


theorem Filter.Tendsto.edist {f g : β → α} {x : Filter β} {a b : α} (hf : Tendsto f x (𝓝 a))
    (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => edist (f x) (g x)) x (𝓝 (edist a b))

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
{f g : β → α}
{x : Filter β}
{a b : α}
(hf : Filter.Tendsto f x (𝓝 a))
(hg : Filter.Tendsto g x (𝓝 b))

Filter.Tendsto (fun x => edist (f x) (g x)) x (𝓝 (edist a b))