@[simp]
theorem lift_comp_includeLeft (f : A →ₐ[S] C) (g : B →ₐ[R] C) (hfg : ∀ x y, Commute (f x) (g y)) :
    (lift f g hfg).comp includeLeft = f

(hfg : ∀ (x : A) (y : B), Commute (f x) (g y))

(Algebra.TensorProduct.lift f g hfg).comp Algebra.TensorProduct.includeLeft = f


lemma Integrable.restrict (f_intble : Integrable f μ) {s : Set α} :
    Integrable f (μ.restrict s)

(f_intble : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable f (μ.restrict s)


@[simp]
theorem factorThruKernelSubobject_comp_kernelSubobjectIso {W : C} (h : W ⟶ X) (w : h ≫ f = 0) :
    factorThruKernelSubobject f h w ≫ (kernelSubobjectIso f).hom = kernel.lift f h w

CategoryTheory.Limits.factorThruKernelSubobject f h w ≫ (CategoryTheory.Limits.kernelSubobjectIso f).hom =
  CategoryTheory.Limits.kernel.lift f h w


theorem evaluation_aut_bijective_of_isGalois (A : C) [IsGalois A] (a : F.obj A) :
    Function.Bijective (fun f : Aut A ↦ F.map f.hom a)

(F : CategoryTheory.Functor C FintypeCat)

Function.Bijective fun f => F.map f.hom a


@[simp]
theorem mulRight_zero_eq_zero : mulRight R (0 : A) = 0

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]


@[to_additive (attr := simp)]
theorem prod_add (s t : Multiset α) : prod (s + t) = prod s * prod t

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


@[simp]
theorem schwartzSeminormFamily_apply (n k : ℕ) :
    schwartzSeminormFamily 𝕜 E F (n, k) = SchwartzMap.seminorm 𝕜 n k

(𝕜 : Type u_1)
(E : Type u_4)
(F : Type u_5)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedField 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
(n k : ℕ)


@[simps]
instance whiskerRight (f g : a ⟶ b) (h : b ⟶ c)
    [BicategoricalCoherence f g] : BicategoricalCoherence (f ≫ h) (g ≫ h)


/-- The right adjoint of the adjunction which induces the comonad `(U, ε_ U, δ_ U)`. -/
@[simps]
def toCokleisli : C ⥤ Cokleisli U

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

(CategoryTheory.Cokleisli.Adjunction.toCokleisli U).obj X = X


theorem prod_top : f ×ˢ (⊤ : Filter β) = f.comap Prod.fst

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


/-- The L-series of the twist of the von Mangoldt function `Λ` by a Dirichlet character `χ` at `s`
equals the negative logarithmic derivative of the L-series of `χ` when `re s > 1`. -/
lemma LSeries_twist_vonMangoldt_eq {N : ℕ} (χ : DirichletCharacter ℂ N) {s : ℂ} (hs : 1 < s.re) :
    L (↗χ * ↗Λ) s = - deriv (L ↗χ) s / L ↗χ s

L ((fun n => χ ↑n) * fun n => ↑(ArithmeticFunction.vonMangoldt n)) s = -deriv (L fun n => χ ↑n) s / L (fun n => χ ↑n) s


@[reassoc (attr := simp)]
lemma XIsoOfEq_inv_comp_XIsoOfEq_inv (K : HomologicalComplex V c) {p₁ p₂ p₃ : ι}
    (h₂₁ : p₂ = p₁) (h₃₂ : p₃ = p₂) :
    (K.XIsoOfEq h₂₁).inv ≫ (K.XIsoOfEq h₃₂).inv = (K.XIsoOfEq (h₃₂.trans h₂₁).symm).hom

(K.XIsoOfEq h₂₁).inv ≫ (K.XIsoOfEq h₃₂).inv = (K.XIsoOfEq ⋯).hom


@[to_additive (attr := simp)]
theorem mrange_id : mrange (MonoidHom.id M) = ⊤

AddMonoidHom.mrange (AddMonoidHom.id M) = ⊤


@[to_additive]
theorem div_subset_div_left : t₁ ⊆ t₂ → s / t₁ ⊆ s / t₂

{α : Type u_2}
[Sub α]
{s t₁ t₂ : Set α}


@[simp] theorem not_and_self : ∀ (x : Bool), (!x && x) = false


@[simp]
theorem not_bot_adj : ¬ (⊥ : Subgraph G).Adj a b

{V : Type u}
{G : SimpleGraph V}
{a b : V}


@[to_additive Filter.Tendsto.norm]
theorem Filter.Tendsto.norm' (h : Tendsto f l (𝓝 a)) : Tendsto (fun x => ‖f x‖) l (𝓝 ‖a‖)

{α : Type u_3}
{E : Type u_6}
[SeminormedAddGroup E]
{a : E}
{l : Filter α}
{f : α → E}
(h : Filter.Tendsto f l (𝓝 a))

Filter.Tendsto (fun x => ‖f x‖) l (𝓝 ‖a‖)


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

(starRingEnd ℂ) (jacobiTheta₂' z τ) = jacobiTheta₂' ((starRingEnd ℂ) z) (-(starRingEnd ℂ) τ)


theorem mul_exp_pos {a₁ a₂ : ℕ} (n) (h₁ : 0 < a₁) (h₂ : 0 < a₂) : 0 < a₁ ^ n * a₂


/-- Cantor's intersection theorem for sequences indexed by `ℕ`:
the intersection of a decreasing sequence of nonempty compact closed sets is nonempty. -/
theorem IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed (t : ℕ → Set X)
    (htd : ∀ i, t (i + 1) ⊆ t i) (htn : ∀ i, (t i).Nonempty) (ht0 : IsCompact (t 0))
    (htcl : ∀ i, IsClosed (t i)) : (⋂ i, t i).Nonempty

{X : Type u}
[TopologicalSpace X]
(t : ℕ → Set X)
(htd : ∀ (i : ℕ), t (i + 1) ⊆ t i)
(htn : ∀ (i : ℕ), (t i).Nonempty)
(ht0 : IsCompact (t 0))
(htcl : ∀ (i : ℕ), IsClosed (t i))


@[simp]
theorem finSumFinEquiv_symm_apply_castAdd (x : Fin m) :
    finSumFinEquiv.symm (Fin.castAdd n x) = Sum.inl x


theorem nfpBFamily_lt_ord_of_isRegular {o : Ordinal} {f : ∀ a < o, Ordinal → Ordinal} {c}
    (hc : IsRegular c) (ho : o.card < c) (hc' : c ≠ ℵ₀)
    (hf : ∀ (i hi), ∀ b < c.ord, f i hi b < c.ord) {a} :
    a < c.ord → nfpBFamily.{u, u} o f a < c.ord

{f : (a : Ordinal.{u}) → a < o → Ordinal.{u} → Ordinal.{u}}

(hf : ∀ (i : Ordinal.{u}) (hi : i < o), ∀ b < c.ord, f i hi b < c.ord)


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


@[to_additive]
theorem eq_top_of_card_eq [Finite H] (h : Nat.card H = Nat.card G) :
    H = ⊤

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
[Finite ↥H]
(h : Nat.card ↥H = Nat.card G)


/-- In a bicategory, we can compose the 1-morphisms `f : a ⟶ b` and `g : b ⟶ c` to obtain
a 1-morphism `f ≫ g : a ⟶ c`. This composition does not need to be strictly associative,
but there is a specified associator, `α_ f g h : (f ≫ g) ≫ h ≅ f ≫ (g ≫ h)`.
There is an identity 1-morphism `𝟙 a : a ⟶ a`, with specified left and right unitor
isomorphisms `λ_ f : 𝟙 a ≫ f ≅ f` and `ρ_ f : f ≫ 𝟙 a ≅ f`.
These associators and unitors satisfy the pentagon and triangle equations.

See https://ncatlab.org/nlab/show/bicategory.
-/
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
  -- category structure on the collection of 1-morphisms:
  homCategory : ∀ a b : B, Category.{w} (a ⟶ b) := by infer_instance
  -- left whiskering:
  whiskerLeft {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h) : f ≫ g ⟶ f ≫ h
  -- right whiskering:
  whiskerRight {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) : f ≫ h ⟶ g ≫ h
  -- associator:
  associator {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) : (f ≫ g) ≫ h ≅ f ≫ g ≫ h
  -- left unitor:
  leftUnitor {a b : B} (f : a ⟶ b) : 𝟙 a ≫ f ≅ f
  -- right unitor:
  rightUnitor {a b : B} (f : a ⟶ b) : f ≫ 𝟙 b ≅ f
  -- axioms for left whiskering:
  whiskerLeft_id : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerLeft f (𝟙 g) = 𝟙 (f ≫ g) := by
    aesop_cat
  whiskerLeft_comp :
    ∀ {a b c} (f : a ⟶ b) {g h i : b ⟶ c} (η : g ⟶ h) (θ : h ⟶ i),
      whiskerLeft f (η ≫ θ) = whiskerLeft f η ≫ whiskerLeft f θ := by
    aesop_cat
  id_whiskerLeft :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerLeft (𝟙 a) η = (leftUnitor f).hom ≫ η ≫ (leftUnitor g).inv := by
    aesop_cat
  comp_whiskerLeft :
    ∀ {a b c d} (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h'),
      whiskerLeft (f ≫ g) η =
        (associator f g h).hom ≫ whiskerLeft f (whiskerLeft g η) ≫ (associator f g h').inv := by
    aesop_cat
  -- axioms for right whiskering:
  id_whiskerRight : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerRight (𝟙 f) g = 𝟙 (f ≫ g) := by
    aesop_cat
  comp_whiskerRight :
    ∀ {a b c} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h) (i : b ⟶ c),
      whiskerRight (η ≫ θ) i = whiskerRight η i ≫ whiskerRight θ i := by
    aesop_cat
  whiskerRight_id :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerRight η (𝟙 b) = (rightUnitor f).hom ≫ η ≫ (rightUnitor g).inv := by
    aesop_cat
  whiskerRight_comp :
    ∀ {a b c d} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d),
      whiskerRight η (g ≫ h) =
        (associator f g h).inv ≫ whiskerRight (whiskerRight η g) h ≫ (associator f' g h).hom := by
    aesop_cat
  -- associativity of whiskerings:
  whisker_assoc :
    ∀ {a b c d} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d),
      whiskerRight (whiskerLeft f η) h =
        (associator f g h).hom ≫ whiskerLeft f (whiskerRight η h) ≫ (associator f g' h).inv := by
    aesop_cat
  -- exchange law of left and right whiskerings:
  whisker_exchange :
    ∀ {a b c} {f g : a ⟶ b} {h i : b ⟶ c} (η : f ⟶ g) (θ : h ⟶ i),
      whiskerLeft f θ ≫ whiskerRight η i = whiskerRight η h ≫ whiskerLeft g θ := by
    aesop_cat
  -- pentagon identity:
  pentagon :
    ∀ {a b c d e} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e),
      whiskerRight (associator f g h).hom i ≫
          (associator f (g ≫ h) i).hom ≫ whiskerLeft f (associator g h i).hom =
        (associator (f ≫ g) h i).hom ≫ (associator f g (h ≫ i)).hom := by
    aesop_cat
  -- triangle identity:
  triangle :
    ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c),
      (associator f (𝟙 b) g).hom ≫ whiskerLeft f (leftUnitor g).hom
      = whiskerRight (rightUnitor f).hom g := by
    aesop_cat

{B : Type u}
[self : CategoryTheory.Bicategory B]
{a b c : B}
{f g h : a ⟶ b}
(η : f ⟶ g)
(θ : g ⟶ h)
(i : b ⟶ c)

CategoryTheory.Bicategory.whiskerRight (CategoryTheory.CategoryStruct.comp η θ) i =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight η i)
    (CategoryTheory.Bicategory.whiskerRight θ i)


theorem lift.add' {α β} [AddCommGroup β] (a : FreeAbelianGroup α) (f g : α → β) :
    lift (f + g) a = lift f a + lift g a

{α : Type u_1}
{β : Type u_2}
[AddCommGroup β]
(a : FreeAbelianGroup α)
(f g : α → β)

(FreeAbelianGroup.lift (f + g)) a = (FreeAbelianGroup.lift f) a + (FreeAbelianGroup.lift g) a


theorem SeparatingLeft.congr (h : B.SeparatingLeft) :
    (e₁.arrowCongr (e₂.arrowCongr (LinearEquiv.refl R M)) B).SeparatingLeft

{R : Type u_1}
{M : Type u_5}
{Mₗ₁ : Type u_9}
{Mₗ₁' : Type u_10}
{Mₗ₂ : Type u_11}
{Mₗ₂' : Type u_12}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid Mₗ₁]
[AddCommMonoid Mₗ₂]
[AddCommMonoid Mₗ₁']
[AddCommMonoid Mₗ₂']
[Module R Mₗ₁]
[Module R Mₗ₂]
[Module R Mₗ₁']
[Module R Mₗ₂']
{B : Mₗ₁ →ₗ[R] Mₗ₂ →ₗ[R] M}
(e₁ : Mₗ₁ ≃ₗ[R] Mₗ₁')
(e₂ : Mₗ₂ ≃ₗ[R] Mₗ₂')
(h : B.SeparatingLeft)

((e₁.arrowCongr (e₂.arrowCongr (LinearEquiv.refl R M))) B).SeparatingLeft


@[simp]
theorem symm_dual_comp (g : sSupHom βᵒᵈ γᵒᵈ) (f : sSupHom αᵒᵈ βᵒᵈ) :
    sInfHom.dual.symm (g.comp f) = (sInfHom.dual.symm g).comp (sInfHom.dual.symm f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[InfSet α]
[InfSet β]
[InfSet γ]
(g : sSupHom βᵒᵈ γᵒᵈ)
(f : sSupHom αᵒᵈ βᵒᵈ)


/-- An unbundled relation class stating that `r` is the nonstrict relation corresponding to the
strict relation `s`. Compare `Preorder.lt_iff_le_not_le`. This is mostly meant to provide dot
notation on `(⊆)` and `(⊂)`. -/
class IsNonstrictStrictOrder (α : Type*) (r : semiOutParam (α → α → Prop)) (s : α → α → Prop) :
    Prop where
  /-- The relation `r` is the nonstrict relation corresponding to the strict relation `s`. -/
  right_iff_left_not_left (a b : α) : s a b ↔ r a b ∧ ¬r b a

{α : Type u_1}
{r : semiOutParam (α → α → Prop)}
{s : α → α → Prop}
[self : IsNonstrictStrictOrder α r s]
(a b : α)


@[reassoc]
lemma whiskerRight_mapId_hom (f : a ⟶ b) : (F.mapId a).hom ▷ F.map f =
    (F.mapComp (𝟙 a) f).inv ≫ F.map₂ (λ_ f).hom ≫ (λ_ (F.map f)).inv

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

CategoryTheory.Bicategory.whiskerRight (F.mapId a).hom (F.map f) =
  CategoryTheory.CategoryStruct.comp (F.mapComp (CategoryTheory.CategoryStruct.id a) f).inv
    (CategoryTheory.CategoryStruct.comp (F.map₂ (CategoryTheory.Bicategory.leftUnitor f).hom)
      (CategoryTheory.Bicategory.leftUnitor (F.map f)).inv)


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

{M : Type u_1}
[Add M]
(c : AddCon M)
{a b : M}


theorem trans_iterate_Ico {a : ℕ → ℝ} {m n : ℕ} (hmn : m ≤ n)
    (hint : ∀ k ∈ Ico m n, IntervalIntegrable f μ (a k) (a <| k + 1)) :
    IntervalIntegrable f μ (a m) (a n)

(hint : ∀ k ∈ Set.Ico m n, IntervalIntegrable f μ (a k) (a (k + 1)))


theorem Poly.denote_cons (ctx : Context) (k : Nat) (v : Var) (p : Poly) : denote ctx ((k, v) :: p) = k * v.denote ctx + p.denote ctx

(ctx : Nat.Linear.Context)
(k : Nat)
(v : Nat.Linear.Var)
(p : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx ((k, v) :: p) = k * Nat.Linear.Var.denote ctx v + Nat.Linear.Poly.denote ctx p


@[to_additive]
lemma prod_mul_eq_prod_mul_of_exists {s : Finset α} {f : α → β} {b₁ b₂ : β}
    (a : α) (ha : a ∈ s) (h : f a * b₁ = f a * b₂) :
    (∏ a ∈ s, f a) * b₁ = (∏ a ∈ s, f a) * b₂

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{s : Finset α}
{f : α → β}
{b₁ b₂ : β}
(a : α)
(ha : a ∈ s)
(h : f a + b₁ = f a + b₂)


@[simp]
theorem ofIsCompl_add (h : IsCompl p q) {φ₁ φ₂ : p →ₗ[R] F} {ψ₁ ψ₂ : q →ₗ[R] F} :
    ofIsCompl h (φ₁ + φ₂) (ψ₁ + ψ₂) = ofIsCompl h φ₁ ψ₁ + ofIsCompl h φ₂ ψ₂

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{p q : Submodule R E}
(h : IsCompl p q)
{φ₁ φ₂ : ↥p →ₗ[R] F}
{ψ₁ ψ₂ : ↥q →ₗ[R] F}

LinearMap.ofIsCompl h (φ₁ + φ₂) (ψ₁ + ψ₂) = LinearMap.ofIsCompl h φ₁ ψ₁ + LinearMap.ofIsCompl h φ₂ ψ₂


@[simp]
theorem toFun_eq_coe_aux {f : BiheytingHom α β} : (↑f.toLatticeHom) = ⇑f

{α : Type u_2}
{β : Type u_3}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
{f : BiheytingHom α β}


theorem mem_nhdsWithin_iff_eventuallyEq {s t : Set α} {x : α} :
    t ∈ 𝓝[s] x ↔ s =ᶠ[𝓝 x] (s ∩ t : Set α)

{α : Type u_1}
[TopologicalSpace α]
{s t : Set α}
{x : α}


@[simp]
theorem coe_zero : ⇑(0 : OuterMeasure α) = 0


theorem OrderIso.strictConcaveOn_symm (f : α ≃o β) (hf : StrictConvexOn 𝕜 univ f) :
    StrictConcaveOn 𝕜 univ f.symm

{𝕜 : Type u_1}
{α : Type u_4}
{β : Type u_5}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid α]
[SMul 𝕜 α]
[OrderedAddCommMonoid β]
[SMul 𝕜 β]
(f : α ≃o β)
(hf : StrictConvexOn 𝕜 Set.univ ⇑f)


theorem mem_implicitToPartialHomeomorph_source (hf : HasStrictFDerivAt f f' a)
    (hf' : range f' = ⊤) : a ∈ (hf.implicitToPartialHomeomorph f f' hf').source

{𝕜 : 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' = ⊤)

a ∈ (HasStrictFDerivAt.implicitToPartialHomeomorph f f' hf hf').source


theorem toFinsupp_apply_le (hn : l.length ≤ n) : l.toFinsupp n = 0

{M : Type u_1}
[Zero M]
(l : List M)
[DecidablePred fun x => l.getD x 0 ≠ 0]
(n : ℕ)
(hn : l.length ≤ n)


theorem restrict_iUnion [Countable ι] {s : ι → Set α} (hd : Pairwise (Disjoint on s))
    (hm : ∀ i, MeasurableSet (s i)) : μ.restrict (⋃ i, s i) = sum fun i => μ.restrict (s i)

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable ι]
{s : ι → Set α}
(hd : Pairwise (Disjoint on s))
(hm : ∀ (i : ι), MeasurableSet (s i))

μ.restrict (⋃ i, s i) = MeasureTheory.Measure.sum fun i => μ.restrict (s i)


@[simp]
theorem traceMatrix_apply (b : κ → B) (i j) : traceMatrix A b i j = traceForm A B (b i) (b j)

{κ : Type w}
(A : Type u)
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
(b : κ → B)
(i j : κ)

Algebra.traceMatrix A b i j = ((Algebra.traceForm A B) (b i)) (b j)


theorem csSup_image2_eq_csSup_csSup (h₁ : ∀ b, GaloisConnection (swap l b) (u₁ b))
    (h₂ : ∀ a, GaloisConnection (l a) (u₂ a)) (hs₀ : s.Nonempty) (hs₁ : BddAbove s)
    (ht₀ : t.Nonempty) (ht₁ : BddAbove t) : sSup (image2 l s t) = l (sSup s) (sSup t)

{l : α → β → γ}

{u₁ : β → γ → α}

{u₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (Function.swap l b) (u₁ b))

(h₂ : ∀ (a : α), GaloisConnection (l a) (u₂ a))

sSup (Set.image2 l s t) = l (sSup s) (sSup t)


@[to_additive]
theorem preimage_of_equiv {ν : Measure β} (h : IsFundamentalDomain G s μ) {f : β → α}
    (hf : QuasiMeasurePreserving f ν μ) {e : G → H} (he : Bijective e)
    (hef : ∀ g, Semiconj f (e g • ·) (g • ·)) : IsFundamentalDomain H (f ⁻¹' s) ν

(h : MeasureTheory.IsFundamentalDomain G s μ)

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f ν μ)

(hef : ∀ (g : G), Function.Semiconj f (fun x => e g • x) fun x => g • x)

MeasureTheory.IsFundamentalDomain H (f ⁻¹' s) ν


theorem hasStrictDerivAt_arccos {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) :
    HasStrictDerivAt arccos (-(1 / √(1 - x ^ 2))) x

HasStrictDerivAt Real.arccos (-(1 / √(1 - x ^ 2))) x


theorem constantCoeff_surj : Function.Surjective (constantCoeff R)


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

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


@[simp] lemma coe_equivNatSumOfFintype_apply_apply [Fintype α] (s : Sym α n) (a : α) :
    (equivNatSumOfFintype α n s : α → ℕ) a = (s : Multiset α).count a

(α : Type u_1)
[DecidableEq α]
(n : ℕ)
[Fintype α]
(s : Sym α n)
(a : α)

↑((Sym.equivNatSumOfFintype α n) s) a = Multiset.count a ↑s


/-- `circumcenterWeightsWithCircumcenter` sums to 1. -/
@[simp]
theorem sum_circumcenterWeightsWithCircumcenter (n : ℕ) :
    ∑ i, circumcenterWeightsWithCircumcenter n i = 1

∑ i : Affine.Simplex.PointsWithCircumcenterIndex n, Affine.Simplex.circumcenterWeightsWithCircumcenter n i = 1


@[simp 1100]
theorem mod_mul_left_mod (a b c : Nat) : a % (b * c) % c = a % c


@[congr]
theorem inf'_congr {t : Finset β} {f g : β → α} (h₁ : s = t) (h₂ : ∀ x ∈ s, f x = g x) :
    s.inf' H f = t.inf' (h₁ ▸ H) g

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
{s : Finset β}
(H : s.Nonempty)
{t : Finset β}
{f g : β → α}
(h₁ : s = t)
(h₂ : ∀ x ∈ s, f x = g x)


@[to_additive]
theorem subset_interior_mul : interior s * interior t ⊆ interior (s * t)

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul α α]
{s t : Set α}


@[to_additive]
theorem quotientQuotientEquivQuotientAux_mk_mk (x : G) :
    quotientQuotientEquivQuotientAux N M h (x : G ⧸ N) = x

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]
(M : AddSubgroup G)
[nM : M.Normal]
(h : N ≤ M)
(x : G)

(QuotientAddGroup.quotientQuotientEquivQuotientAux N M h) ↑↑x = ↑x


@[simp]
theorem eval_mul_X : (p * X).eval x = p.eval x * x

{R : Type u}
[Semiring R]
{p : R[X]}
{x : R}

Polynomial.eval x (p * Polynomial.X) = Polynomial.eval x p * x


@[to_additive]
lemma finite_mul : (s * t).Finite ↔ s.Finite ∧ t.Finite ∨ s = ∅ ∨ t = ∅

{α : Type u_2}
[Mul α]
[IsLeftCancelMul α]
[IsRightCancelMul α]
{s t : Set α}


theorem Periodic.mul_const_inv [DivisionSemiring α] (h : Periodic f c) (a : α) :
    Periodic (fun x => f (x * a⁻¹)) (c * a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[DivisionSemiring α]
(h : Function.Periodic f c)
(a : α)

Function.Periodic (fun x => f (x * a⁻¹)) (c * a)


theorem append_consecutive {n m l : ℕ} (hnm : n ≤ m) (hml : m ≤ l) :
    Ico n m ++ Ico m l = Ico n l

List.Ico n m ++ List.Ico m l = List.Ico n l


@[to_additive (attr := simp)]
theorem homQuotientZPowOfHom_comp_of_rightInverse (i : Function.RightInverse g f) :
    (homQuotientZPowOfHom f n).comp (homQuotientZPowOfHom g n) = MonoidHom.id _

{A B : Type u}
[AddCommGroup A]
[AddCommGroup B]
(f : A →+ B)
(g : B →+ A)
(n : ℤ)
(i : Function.RightInverse ⇑g ⇑f)

(QuotientAddGroup.homQuotientZSMulOfHom f n).comp (QuotientAddGroup.homQuotientZSMulOfHom g n) =
  AddMonoidHom.id (B ⧸ (zsmulAddGroupHom n).range)


theorem coeFn_comp₂ (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β)
    (f₂ : α →ₘ[μ] γ) : comp₂ g hg f₁ f₂ =ᵐ[μ] fun a => g (f₁ a) (f₂ a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
(g : β → γ → δ)
(hg : Continuous (Function.uncurry g))
(f₁ : α →ₘ[μ] β)
(f₂ : α →ₘ[μ] γ)

↑(MeasureTheory.AEEqFun.comp₂ g hg f₁ f₂) =ᵐ[μ] fun a => g (↑f₁ a) (↑f₂ a)


@[to_additive]
theorem Filter.EventuallyEq.mulIndicator_one [One β] {l : Filter α} {f : α → β} {s : Set α}
    (hf : f =ᶠ[l] 1) : s.mulIndicator f =ᶠ[l] 1

{α : Type u_1}
{β : Type u_2}
[One β]
{l : Filter α}
{f : α → β}
{s : Set α}
(hf : f =ᶠ[l] 1)


theorem HasBasis.inf {ι ι' : Type*} {p : ι → Prop} {s : ι → Set α} {p' : ι' → Prop}
    {s' : ι' → Set α} (hl : l.HasBasis p s) (hl' : l'.HasBasis p' s') :
    (l ⊓ l').HasBasis (fun i : ι × ι' => p i.1 ∧ p' i.2) fun i => s i.1 ∩ s' i.2

{α : Type u_1}
{l l' : Filter α}
{ι : Type u_6}
{ι' : Type u_7}
{p : ι → Prop}
{s : ι → Set α}
{p' : ι' → Prop}
{s' : ι' → Set α}
(hl : l.HasBasis p s)
(hl' : l'.HasBasis p' s')

(l ⊓ l').HasBasis (fun i => p i.1 ∧ p' i.2) fun i => s i.1 ∩ s' i.2


lemma isBounded_add [Bornology R] [Add R] [BoundedAdd R] {s t : Set R}
    (hs : Bornology.IsBounded s) (ht : Bornology.IsBounded t) :
    Bornology.IsBounded (s + t)

{R : Type u_1}
[Bornology R]
[Add R]
[BoundedAdd R]
{s t : Set R}
(hs : Bornology.IsBounded s)
(ht : Bornology.IsBounded t)


/-- The functor which flips commutative squares. -/
@[simps]
def flipFunctor : Square C ⥤ Square C

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.flipFunctor.map φ).τ₁ = φ.τ₁


@[simp]
theorem spanExt_hom_app_left : (spanExt iX iY iZ wf wg).hom.app WalkingSpan.left = iY.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Y}
{g : X ⟶ Z}
{f' : X' ⟶ Y'}
{g' : X' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iY.hom)
(wg : iX.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.spanExt iX iY iZ wf wg).hom.app CategoryTheory.Limits.WalkingSpan.left = iY.hom


@[simp]
theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : A *ᵥ v = ![]

{α : Type u}
{n' : Type uₙ}
[NonUnitalNonAssocSemiring α]
[Fintype n']
(A : Matrix (Fin 0) n' α)
(v : n' → α)


@[to_additive]
theorem tendsto_norm_div_self (x : E) : Tendsto (fun a => ‖a / x‖) (𝓝 x) (𝓝 0)

{E : Type u_6}
[SeminormedAddGroup E]
(x : E)

Filter.Tendsto (fun a => ‖a - x‖) (𝓝 x) (𝓝 0)


@[simp]
theorem swap_covBy_swap : x.swap ⋖ y.swap ↔ x ⋖ y

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{x y : α × β}


lemma Equiv.biInf_comp {ι ι' : Type*} {g : ι' → α} (e : ι ≃ ι') (s : Set ι') :
    ⨅ i ∈ e.symm '' s, g (e i) = ⨅ i ∈ s, g i

{α : Type u_1}
[CompleteLattice α]
{ι : Type u_9}
{ι' : Type u_10}
{g : ι' → α}
(e : ι ≃ ι')
(s : Set ι')

⨅ i ∈ ⇑e.symm '' s, g (e i) = ⨅ i ∈ s, g i


/-- Interior and frontier are disjoint. -/
lemma disjoint_interior_frontier : Disjoint (interior s) (frontier s)

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


@[simp]
theorem row_mul_col_apply [Fintype m] [Mul α] [AddCommMonoid α] (v w : m → α) (i j) :
    (row ι v * col ι w) i j = v ⬝ᵥ w

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
[Fintype m]
[Mul α]
[AddCommMonoid α]
(v w : m → α)
(i j : ι)

(Matrix.row ι v * Matrix.col ι w) i j = Matrix.dotProduct v w


theorem symmetric_isOrtho : Symmetric (IsOrtho : Submodule 𝕜 E → Submodule 𝕜 E → Prop)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]


@[simp]
theorem ofBoolRing_one : ofBoolRing (1 : AsBoolRing α) = ⊤


theorem StrictMono.mul_const [MulPosStrictMono α]
    (hf : StrictMono f) (ha : 0 < a) : StrictMono fun x => f x * a

{α : Type u}
{β : Type u_1}
[Semiring α]
[PartialOrder α]
{a : α}
[Preorder β]
{f : β → α}
[MulPosStrictMono α]
(hf : StrictMono f)
(ha : 0 < a)


@[simp]
theorem cons_sublist_cons : a :: l₁ <+ a :: l₂ ↔ l₁ <+ l₂

∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, a :: l₁ <+ a :: l₂ ↔ l₁ <+ l₂


@[simp]
theorem pow_comp {R : Type*} [CommSemiring R] (p q : R[X]) (n : ℕ) :
    (p ^ n).comp q = p.comp q ^ n

{R : Type u_1}
[CommSemiring R]
(p q : R[X])
(n : ℕ)


theorem map_eq (f : Char → Char) (s) : map f s = ⟨s.1.map f⟩

String.map f s = { data := List.map f s.data }


@[reassoc]
lemma ιMapBifunctorBifunctor₂₃MapObj_eq (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (j : J)
    (h : r (i₁, i₂, i₃) = j) (i₂₃ : ρ₂₃.I₂₃) (h₂₃ : ρ₂₃.p ⟨i₂, i₃⟩ = i₂₃) :
    ιMapBifunctorBifunctor₂₃MapObj F G₂₃ ρ₂₃ X₁ X₂ X₃ i₁ i₂ i₃ j h =
  (F.obj (X₁ i₁)).map (ιMapBifunctorMapObj G₂₃ ρ₂₃.p X₂ X₃ i₂ i₃ i₂₃ h₂₃) ≫
    ιMapBifunctorMapObj F ρ₂₃.q X₁ (mapBifunctorMapObj G₂₃ ρ₂₃.p X₂ X₃) i₁ i₂₃ j
      (by rw [← h, ← h₂₃, ← ρ₂₃.hpq])

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂₃ C₄))

(G₂₃ : CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₂₃))

(ρ₂₃ : CategoryTheory.GradedObject.BifunctorComp₂₃IndexData r)

(X₁ : CategoryTheory.GradedObject I₁ C₁)

(X₂ : CategoryTheory.GradedObject I₂ C₂)

(X₃ : CategoryTheory.GradedObject I₃ C₃)

[(((CategoryTheory.GradedObject.mapBifunctor G₂₃ I₂ I₃).obj X₂).obj X₃).HasMap ρ₂₃.p]

[(((CategoryTheory.GradedObject.mapBifunctor F I₁ ρ₂₃.I₂₃).obj X₁).obj
        (CategoryTheory.GradedObject.mapBifunctorMapObj G₂₃ ρ₂₃.p X₂ X₃)).HasMap
    ρ₂₃.q]

(i₂₃ : ρ₂₃.I₂₃)

CategoryTheory.GradedObject.ιMapBifunctorBifunctor₂₃MapObj F G₂₃ ρ₂₃ X₁ X₂ X₃ i₁ i₂ i₃ j h =
  CategoryTheory.CategoryStruct.comp
    ((F.obj (X₁ i₁)).map (CategoryTheory.GradedObject.ιMapBifunctorMapObj G₂₃ ρ₂₃.p X₂ X₃ i₂ i₃ i₂₃ h₂₃))
    (CategoryTheory.GradedObject.ιMapBifunctorMapObj F ρ₂₃.q X₁
      (CategoryTheory.GradedObject.mapBifunctorMapObj G₂₃ ρ₂₃.p X₂ X₃) i₁ i₂₃ j ⋯)


@[simp]
theorem coe_copy (p : SubMulAction R M) (s : Set M) (hs : s = ↑p) : (p.copy s hs : Set M) = s

{R : Type u}
{M : Type v}
[SMul R M]
(p : SubMulAction R M)
(s : Set M)
(hs : s = ↑p)


@[to_additive]
theorem prehaar_empty (K₀ : PositiveCompacts G) {U : Set G} : prehaar (K₀ : Set G) U ⊥ = 0

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.prehaar (↑K₀) U ⊥ = 0


/--
If `α` and `β` are two equal natural transformations, then the functors of algebras induced by them
are isomorphic.
We define it like this as opposed to using `eq_to_iso` so that the components are nicer to prove
lemmas about.
-/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransEq {F G : C ⥤ C} {α β : F ⟶ G} (h : α = β) :
    functorOfNatTrans α ≅ functorOfNatTrans β

(X : CategoryTheory.Endofunctor.Algebra G)

((CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq h).inv.app X).f = CategoryTheory.CategoryStruct.id X.a


lemma root_X_pow_sub_C_eq_zero_iff {n : ℕ} {a : K} (H : Irreducible (X ^ n - C a)) :
    (AdjoinRoot.root (X ^ n - C a)) = 0 ↔ a = 0

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a) = 0 ↔ a = 0


lemma C_addPolynomial (x y L : R) : mk W (C <| W.addPolynomial x y L) =
    mk W ((Y - C (linePolynomial x y L)) * (W.negPolynomial - C (linePolynomial x y L)))

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
(x y L : R)

(WeierstrassCurve.Affine.CoordinateRing.mk W) (Polynomial.C (W.addPolynomial x y L)) =
  (WeierstrassCurve.Affine.CoordinateRing.mk W)
    ((Y - Polynomial.C (WeierstrassCurve.Affine.linePolynomial x y L)) *
      (W.negPolynomial - Polynomial.C (WeierstrassCurve.Affine.linePolynomial x y L)))


@[simp]
theorem disjUnion_eq_union (s t h) : @disjUnion α s t h = s ∪ t

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


@[simp, mfld_simps]
theorem image_eq_empty {α β} {f : α → β} {s : Set α} : f '' s = ∅ ↔ s = ∅

{α : Type u_6}
{β : Type u_7}
{f : α → β}
{s : Set α}


/-- Given a set `s` which is a convex neighbourhood of `0` and a point `x₀` outside of it, there is
a continuous linear functional `f` separating `x₀` and `s`, in the sense that it sends `x₀` to 1 and
all of `s` to values strictly below `1`. -/
theorem separate_convex_open_set [TopologicalSpace E] [AddCommGroup E] [TopologicalAddGroup E]
    [Module ℝ E] [ContinuousSMul ℝ E] {s : Set E} (hs₀ : (0 : E) ∈ s) (hs₁ : Convex ℝ s)
    (hs₂ : IsOpen s) {x₀ : E} (hx₀ : x₀ ∉ s) : ∃ f : E →L[ℝ] ℝ, f x₀ = 1 ∧ ∀ x ∈ s, f x < 1

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{s : Set E}
(hs₀ : 0 ∈ s)
(hs₁ : Convex ℝ s)
(hs₂ : IsOpen s)
{x₀ : E}
(hx₀ : x₀ ∉ s)


theorem push_eq_append_singleton (as : Array α) (x) : as.push x = as ++ #[x]


theorem Monotone.mul_antitone [ExistsAddOfLE α] [PosMulMono α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hf : Monotone f) (hg : Antitone g) (hf₀ : ∀ x, 0 ≤ f x)
    (hg₀ : ∀ x, g x ≤ 0) : Antitone (f * g)

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

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


theorem rename_isHomogeneous {f : σ → τ} (h : φ.IsHomogeneous n) :
    (rename f φ).IsHomogeneous n

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
{φ : MvPolynomial σ R}
{n : ℕ}
{f : σ → τ}
(h : φ.IsHomogeneous n)

((MvPolynomial.rename f) φ).IsHomogeneous n


theorem concaveOn_iff_pairwise_pos {s : Set E} {f : E → β} :
    ConcaveOn 𝕜 s f ↔
      Convex 𝕜 s ∧
        s.Pairwise fun x y =>
          ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → a • f x + b • f y ≤ f (a • x + b • y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f : E → β}


theorem diff_inter_diff {s t u : Set α} : s \ t ∩ (s \ u) = s \ (t ∪ u)


@[simp]
theorem Iic_iInf (f : ι → α) : Iic (⨅ i, f i) = ⨅ i, Iic (f i)

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

LowerSet.Iic (⨅ i, f i) = ⨅ i, LowerSet.Iic (f i)


@[simp]
theorem toBoolRing_symmDiff (a b : α) : toBoolRing (a ∆ b) = toBoolRing a + toBoolRing b

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


@[simp]
theorem gauge_closedBall (hr : 0 ≤ r) (x : E) : gauge (closedBall (0 : E) r) x = ‖x‖ / r

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{r : ℝ}
(hr : 0 ≤ r)
(x : E)

gauge (Metric.closedBall 0 r) x = ‖x‖ / r


/-- A morphism of monoid objects. -/
@[ext]
structure Hom (M N : Mon_ C) where
  hom : M.X ⟶ N.X
  one_hom : M.one ≫ hom = N.one := by aesop_cat
  mul_hom : M.mul ≫ hom = (hom ⊗ hom) ≫ N.mul := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M N : Mon_ C}
(self : M.Hom N)

M.mul ≫ self.hom = (self.hom ⊗ self.hom) ≫ N.mul


@[ext]
protected theorem ext {s t : ClopenUpperSet α} (h : (s : Set α) = t) : s = t

{α : Type u_1}
[TopologicalSpace α]
[LE α]
{s t : ClopenUpperSet α}
(h : ↑s = ↑t)


/-- Homotopy equivalent complexes become isomorphic in the homotopy category. -/
@[simps]
def isoOfHomotopyEquiv {C D : HomologicalComplex V c} (f : HomotopyEquiv C D) :
    (quotient V c).obj C ≅ (quotient V c).obj D

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
(f : HomotopyEquiv C D)

(HomotopyCategory.isoOfHomotopyEquiv f).hom = (HomotopyCategory.quotient V c).map f.hom


@[to_additive (attr := simp)]
lemma hasProd_singleton (m : β) (f : β → α) : HasProd (({m} : Set β).restrict f) (f m)

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


@[simp]
theorem codeSupp'_self (c k) : trStmts₁ (trNormal c k) ⊆ codeSupp' c k

(c : Turing.ToPartrec.Code)
(k : Turing.PartrecToTM2.Cont')

Turing.PartrecToTM2.trStmts₁ (Turing.PartrecToTM2.trNormal c k) ⊆ Turing.PartrecToTM2.codeSupp' c k


theorem house_nonneg (α : K) : 0 ≤ house α

{K : Type u_1}
[Field K]
[NumberField K]
(α : K)


@[simp]
theorem comp_apply (g : N ↪[L] P) (f : M ↪[L] N) (x : M) : g.comp f x = g (f x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
(g : L.Embedding N P)
(f : L.Embedding M N)
(x : M)


@[simp] theorem isSome_some : isSome (some a) = true

∀ {α : Type u_1} {a : α}, (some a).isSome = true


theorem IsLittleO.comp_tendsto (hfg : f =o[l] g) {k : β → α} {l' : Filter β} (hk : Tendsto k l' l) :
    (f ∘ k) =o[l'] (g ∘ k)

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}
(hfg : f =o[l] g)
{k : β → α}
{l' : Filter β}
(hk : Filter.Tendsto k l' l)


theorem EuclideanSpace.inner_single_right (i : ι) (a : 𝕜) (v : EuclideanSpace 𝕜 ι) :
    ⟪v, EuclideanSpace.single i (a : 𝕜)⟫ = a * conj (v i)

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
[DecidableEq ι]
[Fintype ι]
(i : ι)
(a : 𝕜)
(v : EuclideanSpace 𝕜 ι)

⟪v, EuclideanSpace.single i a⟫_𝕜 = a * (starRingEnd ((fun x => 𝕜) i)) (v i)


theorem carrier_eq_preimage_mk {a : ConjClasses α} : a.carrier = ConjClasses.mk ⁻¹' {a}

{α : Type u}
[Monoid α]
{a : ConjClasses α}


theorem mul_mono {a b c d : Associates α} (h₁ : a ≤ b) (h₂ : c ≤ d) : a * c ≤ b * d

{α : Type u_1}
[CommMonoid α]
{a b c d : Associates α}
(h₁ : a ≤ b)
(h₂ : c ≤ d)


/-- Composition of first-order homomorphisms is associative. -/
theorem comp_assoc (f : M →[L] N) (g : N →[L] P) (h : P →[L] Q) :
    (h.comp g).comp f = h.comp (g.comp f)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
{Q : Type u_2}
[L.Structure Q]
(f : L.Hom M N)
(g : L.Hom N P)
(h : L.Hom P Q)


@[to_additive]
theorem ofList_singleton (x : α) : ofList [x] = of x


/-- Product divergence test: if `f` is unconditionally multipliable, then `f x` tends to one along
`cofinite`. -/
@[to_additive "Series divergence test: if `f` is unconditionally summable, then `f x` tends to zero
along `cofinite`."]
theorem Multipliable.tendsto_cofinite_one (hf : Multipliable f) : Tendsto f cofinite (𝓝 1)

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[CommGroup G]
[TopologicalGroup G]
{f : α → G}
(hf : Multipliable f)


@[simp]
theorem coe_bot : ((⊥ : HomogeneousIdeal 𝒜) : Set A) = 0

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]


@[simp]
theorem map_id (K : Compacts α) : K.map id continuous_id = K

{α : Type u_1}
[TopologicalSpace α]
(K : TopologicalSpace.Compacts α)

TopologicalSpace.Compacts.map id ⋯ K = K


@[to_additive]
theorem op_closure (s : Set G) : (closure s).op = closure (MulOpposite.unop ⁻¹' s)

(AddSubgroup.closure s).op = AddSubgroup.closure (AddOpposite.unop ⁻¹' s)


/-- The Jacobi symbol is multiplicative in its first argument. -/
theorem mul_left (a₁ a₂ : ℤ) (b : ℕ) : J(a₁ * a₂ | b) = J(a₁ | b) * J(a₂ | b)

jacobiSym (a₁ * a₂) b = jacobiSym a₁ b * jacobiSym a₂ b


theorem lift_le {f : Filter α} {g : Set α → Filter β} {h : Filter β} {s : Set α} (hs : s ∈ f)
    (hg : g s ≤ h) : f.lift g ≤ h

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Set α → Filter β}
{h : Filter β}
{s : Set α}
(hs : s ∈ f)
(hg : g s ≤ h)


theorem bmex_not_mem_brange {o : Ordinal} (f : ∀ a < o, Ordinal) : bmex o f ∉ brange o f

(f : (a : Ordinal.{u_4}) → a < o → Ordinal.{max u_4 u_5})


@[simp]
theorem _root_.Real.tendsto_toNNReal_atTop_iff {l : Filter α} {f : α → ℝ} :
    Tendsto (fun x ↦ (f x).toNNReal) l atTop ↔ Tendsto f l atTop

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

Filter.Tendsto (fun x => (f x).toNNReal) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


/-- If `γ` is a nonzero element of a linearly ordered group with zero element adjoined, then `{γ}`
is a neighbourhood of `γ`. -/
theorem singleton_mem_nhds_of_ne_zero (h : γ ≠ 0) : ({γ} : Set Γ₀) ∈ 𝓝 (γ : Γ₀)

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


@[simp]
theorem prod_top_top : prod (⊤ : Ideal R) (⊤ : Ideal S) = ⊤

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]


/-- The map sending `f : P ⟶ Q` to `f.f : P.X ⟶ Q.X` is additive. -/
@[simps]
def inclusionHom [Preadditive C] (P Q : Karoubi C) : AddMonoidHom (P ⟶ Q) (P.X ⟶ Q.X)

(P Q : CategoryTheory.Idempotents.Karoubi C)


theorem DirectedSystem.map_self i x h : f i i h x = x

{ι : Type v}
[Preorder ι]
{G : ι → Type w}
(f : (i j : ι) → i ≤ j → G i → G j)
[DirectedSystem G fun i j h => f i j h]
(i : ι)
(x : G i)
(h : i ≤ i)


theorem powersetCard_eq_filter {n} {s : Finset α} :
    powersetCard n s = (powerset s).filter fun x => x.card = n

Finset.powersetCard n s = Finset.filter (fun x => x.card = n) s.powerset


@[simp, nolint simpNF]
theorem isSubordinate_toBumpCovering {f : SmoothBumpCovering ι I M s} {U : M → Set M} :
    (f.toBumpCovering.IsSubordinate fun i => U (f.c i)) ↔ f.IsSubordinate U

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{s : Set M}
[T2Space M]
{f : SmoothBumpCovering ι I M s}
{U : M → Set M}


/-- If `u` is a sequence which is unbounded below,
then after any point, it reaches a value strictly smaller than all previous values.
-/
-- @[nolint ge_or_gt] Porting note: restore attribute
theorem low_scores [LinearOrder β] [NoMinOrder β] {u : ℕ → β} (hu : Tendsto u atTop atBot) :
    ∀ N, ∃ n ≥ N, ∀ k < n, u n < u k

(hu : Filter.Tendsto u Filter.atTop Filter.atBot)


theorem dist_coe_int (x y : ℕ) : dist (x : ℤ) (y : ℤ) = dist x y


lemma distinguished_iff_of_iso {T₁ T₂ : Triangle C} (e : T₁ ≅ T₂) :
    (T₁ ∈ distTriang C) ↔ T₂ ∈ distTriang C

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

{T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C}

T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles ↔ T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


/-- Auxiliary definition for `opEquivalence`. -/
@[simps]
def opInverse : HomologicalComplex Vᵒᵖ c.symm ⥤ (HomologicalComplex V c)ᵒᵖ

∀ {X Y : HomologicalComplex Vᵒᵖ c.symm} (f : X ⟶ Y),
  (HomologicalComplex.opInverse V c).map f = Quiver.Hom.op { f := fun i => (f.f i).unop, comm' := ⋯ }


@[simp]
lemma range_ι : Set.range U.ι.val.base = U

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


@[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem inter_right_subset_ground (hX : X ⊆ M.E) :
    X ∩ Y ⊆ M.E

{α : Type u_1}
{M : Matroid α}
{X Y : Set α}
(hX : X ⊆ M.E)


theorem isCaratheodory_iff_le {s : Set α} :
    MeasurableSet[OuterMeasure.caratheodory m] s ↔ ∀ t, m (t ∩ s) + m (t \ s) ≤ m t

{α : Type u}
(m : MeasureTheory.OuterMeasure α)
{s : Set α}

MeasurableSet s ↔ ∀ (t : Set α), m (t ∩ s) + m (t \ s) ≤ m t


@[to_additive (attr := simp)]
theorem noncommCoprod_inl_inr {M N : Type*} [Monoid M] [Monoid N] :
    (inl M N).noncommCoprod (inr M N) commute_inl_inr = id (M × N)

{M : Type u_4}
{N : Type u_5}
[Monoid M]
[Monoid N]

(MonoidHom.inl M N).noncommCoprod (MonoidHom.inr M N) ⋯ = MonoidHom.id (M × N)


protected theorem Embedding.measurableEmbedding {f : α → β} (h₁ : Embedding f)
    (h₂ : MeasurableSet (range f)) : MeasurableEmbedding f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[TopologicalSpace β]
[MeasurableSpace β]
[BorelSpace β]
{f : α → β}
(h₁ : Embedding f)
(h₂ : MeasurableSet (Set.range f))


/-- The map `(x, y) ↦ (y, y⁻¹x)` sends `μ × ν` to `ν × μ`.
This is the function `S⁻¹R` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_prod_neg_add_swap
"The map `(x, y) ↦ (y, - y + x)` sends `μ × ν` to `ν × μ`."]
theorem measurePreserving_prod_inv_mul_swap :
    MeasurePreserving (fun z : G × G => (z.2, z.2⁻¹ * z.1)) (μ.prod ν) (ν.prod μ)

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddLeftInvariant]

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


/-- **Fermat's Theorem**: the derivative of a function at a local maximum equals zero. -/
theorem IsLocalMax.fderiv_eq_zero (h : IsLocalMax f a) : fderiv ℝ f a = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{a : E}
(h : IsLocalMax f a)


theorem prod_assoc_image {α β γ} {s : Set α} {t : Set β} {u : Set γ} :
    Equiv.prodAssoc α β γ '' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{u : Set γ}

⇑(Equiv.prodAssoc α β γ) '' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u


@[to_additive (attr := simp)]
theorem units_val_iff : Commute (u₁ : M) u₂ ↔ Commute u₁ u₂

{M : Type u_1}
[AddMonoid M]
{u₁ u₂ : AddUnits M}


/-- A mixin class saying that elements `μ : F` are outer measures on `α`.

This typeclass is used to unify some API for outer measures and measures. -/
class OuterMeasureClass (F : Type*) (α : outParam Type*) [FunLike F (Set α) ℝ≥0∞] : Prop where
  protected measure_empty (f : F) : f ∅ = 0
  protected measure_mono (f : F) {s t} : s ⊆ t → f s ≤ f t
  protected measure_iUnion_nat_le (f : F) (s : ℕ → Set α) : Pairwise (Disjoint on s) →
    f (⋃ i, s i) ≤ ∑' i, f (s i)

[self : MeasureTheory.OuterMeasureClass F α]

Pairwise (Disjoint on s) → f (⋃ i, s i) ≤ ∑' (i : ℕ), f (s i)


@[simp]
theorem coe_incl : ⇑L'.incl = ((↑) : L' → L)

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


theorem fderivWithin_sub_const (hxs : UniqueDiffWithinAt 𝕜 s x) (c : F) :
    fderivWithin 𝕜 (fun y => f y - c) s x = fderivWithin 𝕜 f s x

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


theorem not_injOn_infinite_finite_image {f : α → β} {s : Set α} (h_inf : s.Infinite)
    (h_fin : (f '' s).Finite) : ¬InjOn f s

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set α}
(h_inf : s.Infinite)
(h_fin : (f '' s).Finite)


/-- `Irreducible p` states that `p` is non-unit and only factors into units.

We explicitly avoid stating that `p` is non-zero, this would require a semiring. Assuming only a
monoid allows us to reuse irreducible for associated elements.
-/
structure Irreducible [Monoid α] (p : α) : Prop where
  /-- `p` is not a unit -/
  not_unit : ¬IsUnit p
  /-- if `p` factors then one factor is a unit -/
  isUnit_or_isUnit' : ∀ a b, p = a * b → IsUnit a ∨ IsUnit b

{α : Type u_1}
[Monoid α]
{p : α}
(self : Irreducible p)


/-- (Impl)
A cocone for the diagram `(D ⋙ forget T) ⋙ T` found by composing the natural transformation `γ`
with the colimiting cocone for `D ⋙ forget T`.
-/
@[simps]
def newCocone : Cocone ((D ⋙ forget T) ⋙ (T : C ⥤ C))

{D : CategoryTheory.Functor J T.Algebra}

(c : CategoryTheory.Limits.Cocone (D.comp T.forget))

(CategoryTheory.Monad.ForgetCreatesColimits.newCocone c).ι =
  CategoryTheory.CategoryStruct.comp CategoryTheory.Monad.ForgetCreatesColimits.γ c.ι


@[simp]
theorem id_comp (f : R →ₑ+*[φ] S) : (MulSemiringActionHom.id N).comp f = f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
(f : R →ₑ+*[φ] S)


/-- `Fin.natAdd` as an `Embedding`, `natAddEmb n i` adds `n` to `i` "on the left". -/
@[simps! apply]
def natAddEmb (n) {m} : Fin m ↪ Fin (n + m)


theorem comap_mono {S₁ S₂ : StarSubalgebra R B} {f : A →⋆ₐ[R] B} :
    S₁ ≤ S₂ → S₁.comap f ≤ S₂.comap f

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
[Semiring B]
[StarRing B]
[Algebra R B]
[StarModule R B]
{S₁ S₂ : StarSubalgebra R B}
{f : A →⋆ₐ[R] B}

S₁ ≤ S₂ → StarSubalgebra.comap f S₁ ≤ StarSubalgebra.comap f S₂


@[simp]
theorem map_top_of_surjective (f : α → β) (hf : Surjective f) : map f ⊤ = ⊤

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(hf : Function.Surjective f)

(MeasureTheory.OuterMeasure.map f) ⊤ = ⊤


@[simp]
theorem pi_midpoint_apply {k ι : Type*} {V : ι → Type*} {P : ι → Type*} [Field k]
    [Invertible (2 : k)] [∀ i, AddCommGroup (V i)] [∀ i, Module k (V i)]
    [∀ i, AddTorsor (V i) (P i)] (f g : ∀ i, P i) (i : ι) :
    midpoint k f g i = midpoint k (f i) (g i)

{k : Type u_1}
{ι : Type u_2}
{V : ι → Type u_3}
{P : ι → Type u_4}
[Field k]
[Invertible 2]
[(i : ι) → AddCommGroup (V i)]
[(i : ι) → Module k (V i)]
[(i : ι) → AddTorsor (V i) (P i)]
(f g : (i : ι) → P i)
(i : ι)


theorem ihom_map (F : D ⥤ C) {G H : D ⥤ C} (f : G ⟶ H) : (ihom F).map f = (closedIhom F).map f

{D : Type u_1}
{C : Type u_2}
[CategoryTheory.Groupoid D]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalClosed C]
(F : D ⥤ C)
{G H : D ⥤ C}
(f : G ⟶ H)

(CategoryTheory.ihom F).map f = F.closedIhom.map f


@[simp]
theorem map_some (f : α → β) (a : α) : map f (some a) = some (f a)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(a : α)

Part.map f (Part.some a) = Part.some (f a)


/-- A morphism of schemes `X ⟶ Y` is a closed immersion if the underlying
topological map is a closed embedding and the induced stalk maps are surjective. -/
@[mk_iff]
class IsClosedImmersion {X Y : Scheme} (f : X ⟶ Y) : Prop where
  base_closed : ClosedEmbedding f.1.base
  surj_on_stalks : ∀ x, Function.Surjective (f.stalkMap x)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)

AlgebraicGeometry.IsClosedImmersion f ↔
  ClosedEmbedding ⇑f.val.base ∧
    ∀ (x : ↑↑X.toPresheafedSpace), Function.Surjective ⇑(AlgebraicGeometry.Scheme.Hom.stalkMap f x)


@[simp]
theorem card_erase_of_mem {a : α} {s : Multiset α} : a ∈ s → card (s.erase a) = pred (card s)

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

a ∈ s → Multiset.card (s.erase a) = (Multiset.card s).pred


theorem edist_vsub_vsub_le (p₁ p₂ p₃ p₄ : P) :
    edist (p₁ -ᵥ p₂) (p₃ -ᵥ p₄) ≤ edist p₁ p₃ + edist p₂ p₄

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(p₁ p₂ p₃ p₄ : P)


theorem circulant_sub [Sub α] [Sub n] (v w : n → α) :
    circulant (v - w) = circulant v - circulant w

{α : Type u_1}
{n : Type u_4}
[Sub α]
[Sub n]
(v w : n → α)

Matrix.circulant (v - w) = Matrix.circulant v - Matrix.circulant w


/-- Units of an `AddMonoid`, bundled version.

An element of an `AddMonoid` is a unit if it has a two-sided additive inverse.
This version bundles the inverse element so that it can be computed.
For a predicate see `isAddUnit`. -/
structure AddUnits (α : Type u) [AddMonoid α] where
  /-- The underlying value in the base `AddMonoid`. -/
  val : α
  /-- The additive inverse value of `val` in the base `AddMonoid`. -/
  neg : α
  /-- `neg` is the right additive inverse of `val` in the base `AddMonoid`. -/
  val_neg : val + neg = 0
  /-- `neg` is the left additive inverse of `val` in the base `AddMonoid`. -/
  neg_val : neg + val = 0

{α : Type u}
[AddMonoid α]
(self : AddUnits α)


@[to_additive add_left_addIndex_le]
theorem mul_left_index_le {K : Set G} (hK : IsCompact K) {V : Set G} (hV : (interior V).Nonempty)
    (g : G) : index ((fun h => g * h) '' K) V ≤ index K V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
{K : Set G}
(hK : IsCompact K)
{V : Set G}
(hV : (interior V).Nonempty)
(g : G)

MeasureTheory.Measure.haar.index ((fun h => g * h) '' K) V ≤ MeasureTheory.Measure.haar.index K V


theorem exists_nonneg_right_iff_sameRay (hy : y ≠ 0) :
    (∃ r : R, 0 ≤ r ∧ x = r • y) ↔ SameRay R x y

{R : Type u_1}
[LinearOrderedField R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{x y : M}
(hy : y ≠ 0)

(∃ r, 0 ≤ r ∧ x = r • y) ↔ SameRay R x y


@[simp]
lemma ofHom_zero : ofHom (0 : F ⟶ G) = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(F G : CochainComplex C ℤ)

CochainComplex.HomComplex.Cochain.ofHom 0 = 0


/-- If `gcd a (m * n) = 1`, then `gcd a n = 1`. -/
theorem gcd_eq_one_of_gcd_mul_right_eq_one_right {a : ℤ} {m n : ℕ} (h : a.gcd (m * n) = 1) :
    a.gcd n = 1


theorem Relabelling.numeric_imp {x y : PGame} (r : x ≡r y) (ox : Numeric x) : Numeric y

{x y : SetTheory.PGame}
(r : x ≡r y)
(ox : x.Numeric)


nonrec theorem ContinuousAt.rpow_const (hf : ContinuousAt f x) (h : f x ≠ 0 ∨ 0 ≤ p) :
    ContinuousAt (fun x => f x ^ p) x

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
{x : α}
{p : ℝ}
(hf : ContinuousAt f x)
(h : f x ≠ 0 ∨ 0 ≤ p)


lemma isUnit_eq_one_or (hu : IsUnit u) : u = 1 ∨ u = -1


@[simp]
theorem midpoint_add_self (x y : V) : midpoint R x y + midpoint R x y = x + y

(R : Type u_1)
{V : Type u_2}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
(x y : V)


@[simp]
lemma normEDS_two : normEDS b c d 2 = b


/-- If `f` is integrable on a box `I`, then integral sums of `f` over tagged prepartitions
that cover exactly a subbox `J ≤ I` tend to the integral of `f` over `J` along `l`. -/
theorem tendsto_integralSum_toFilteriUnion_single (h : Integrable I l f vol) (hJ : J ≤ I) :
    Tendsto (integralSum f vol) (l.toFilteriUnion I (Prepartition.single I J hJ))
      (𝓝 <| integral J l f vol)

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

Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I (BoxIntegral.Prepartition.single I J hJ))
  (𝓝 (BoxIntegral.integral J l f vol))


@[simp]
theorem equiv_fst (x : WithLp p (α × β)) : (WithLp.equiv p (α × β) x).fst = x.fst

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
(x : WithLp p (α × β))


/-- A T₂ space, also known as a Hausdorff space, is one in which for every
  `x ≠ y` there exists disjoint open sets around `x` and `y`. This is
  the most widely used of the separation axioms. -/
@[mk_iff]
class T2Space (X : Type u) [TopologicalSpace X] : Prop where
  /-- Every two points in a Hausdorff space admit disjoint open neighbourhoods. -/
  t2 : Pairwise fun x y => ∃ u v : Set X, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v

T2Space X ↔ Pairwise fun x y => ∃ u v, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v


theorem nullMeasurableSet_le [Preorder β] [OrderClosedTopology β] [PseudoMetrizableSpace β]
    {f g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
    NullMeasurableSet { a | f a ≤ g a } μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.NullMeasurableSet {a | f a ≤ g a} μ


theorem support_dropUntil_subset {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.dropUntil u h).support ⊆ p.support

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


theorem uniformity_basis_edist_nnreal_le :
    (𝓤 α).HasBasis (fun ε : ℝ≥0 => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 ≤ ε }

(𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 ≤ ↑ε}


theorem tendsto_right_nhds_uniformity {a : α} : Tendsto (fun a' => (a', a)) (𝓝 a) (𝓤 α)

Filter.Tendsto (fun a' => (a', a)) (𝓝 a) (𝓤 α)


theorem le_degree_of_mem_supp (a : ℕ) : a ∈ p.support → ↑a ≤ degree p

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


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

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


/-- A dependent version of `Submonoid.iSup_induction`. -/
@[to_additive (attr := elab_as_elim) "A dependent version of `AddSubmonoid.iSup_induction`. "]
theorem iSup_induction' {ι : Sort*} (S : ι → Submonoid M) {C : ∀ x, (x ∈ ⨆ i, S i) → Prop}
    (mem : ∀ (i), ∀ (x) (hxS : x ∈ S i), C x (mem_iSup_of_mem i hxS)) (one : C 1 (one_mem _))
    (mul : ∀ x y hx hy, C x hx → C y hy → C (x * y) (mul_mem ‹_› ‹_›)) {x : M}
    (hx : x ∈ ⨆ i, S i) : C x hx

(mem : ∀ (i : ι) (x : M) (hxS : x ∈ S i), C x ⋯)

(mul : ∀ (x y : M) (hx : x ∈ ⨆ i, S i) (hy : y ∈ ⨆ i, S i), C x hx → C y hy → C (x + y) ⋯)


@[simp] lemma zeckendorf_succ (n : ℕ) :
    zeckendorf (n + 1) = greatestFib (n + 1) :: zeckendorf (n + 1 - fib (greatestFib (n + 1)))

(n + 1).zeckendorf = (n + 1).greatestFib :: (n + 1 - Nat.fib (n + 1).greatestFib).zeckendorf


theorem Or.imp (f : a → c) (g : b → d) (h : a ∨ b) : c ∨ d

{a c b d : Prop}
(f : a → c)
(g : b → d)
(h : a ∨ b)


theorem Pi.norm_single [DecidableEq ι] [∀ i, NormedAddCommGroup (π i)] {i : ι} (y : π i) :
    ‖Pi.single i y‖ = ‖y‖

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → NormedAddCommGroup (π i)]
{i : ι}
(y : π i)


@[to_additive (attr := simp)]
theorem leftInvEquiv_symm_mul (x : S) : ((S.leftInvEquiv hS).symm x : M) * x = 1

{M : Type u_1}
[CommMonoid M]
(S : Submonoid M)
(hS : S ≤ IsUnit.submonoid M)
(x : ↥S)


theorem smul_im (a : ℤ) (b : ℤ√d) : (↑a * b).im = a * b.im


@[simp]
theorem binaryProductLimitCone_cone_π_app_right (M N : ModuleCat.{v} R) :
    (binaryProductLimitCone M N).cone.π.app ⟨WalkingPair.right⟩ = LinearMap.snd R M N

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

(M.binaryProductLimitCone N).cone.π.app { as := CategoryTheory.Limits.WalkingPair.right } = LinearMap.snd R ↑M ↑N


/-- The map `Square C → Square Cᵒᵖ` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def op (sq : Square C) : Square Cᵒᵖ

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


/-- If `M` is quasicoherent, it is locally generated by sections. -/
@[simps]
def localGeneratorsData (q : M.QuasicoherentData) : M.LocalGeneratorsData

{J : CategoryTheory.GrothendieckTopology C}

[∀ (X : C), (J.over X).HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

[∀ (X : C), CategoryTheory.HasWeakSheafify (J.over X) AddCommGrp]

[∀ (X : C), (J.over X).WEqualsLocallyBijective AddCommGrp]

∀ (a : q.I), q.localGeneratorsData.X a = q.X a


private theorem nonarchimedean_aux {q r : ℚ} (h : padicValRat p q ≤ padicValRat p r) :
    padicNorm p (q + r) ≤ max (padicNorm p q) (padicNorm p r)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ}
(h : padicValRat p q ≤ padicValRat p r)


theorem Context.unwrap_isNeutral
  {ctx : Context α}
  {x : Nat}
  : ContextInformation.isNeutral ctx x = true → LawfulIdentity (EvalInformation.evalOp ctx) (EvalInformation.evalVar (β := α) ctx x)

{α : Sort u_1}
{ctx : Lean.Data.AC.Context α}
{x : Nat}

Lean.Data.AC.ContextInformation.isNeutral ctx x = true →
  Std.LawfulIdentity (Lean.Data.AC.EvalInformation.evalOp ctx) (Lean.Data.AC.EvalInformation.evalVar ctx x)


@[simp]
lemma withDensity_zero' (κ : Kernel α β) [IsSFiniteKernel κ] :
    Kernel.withDensity κ (fun _ _ ↦ 0) = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]


theorem pairwise_top (s : Set α) : s.Pairwise ⊤


lemma neg_smul_equiv (P : Fin 3 → R) {u : R} (hu : IsUnit u) : W'.neg (u • P) ≈ W'.neg P

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


@[simp]
theorem neg_le_zero_iff {x : PGame} : -x ≤ 0 ↔ 0 ≤ x


@[simp] theorem const_comp {γ : Sort*} (f : α → β) (c : γ) : const β c ∘ f = const α c

{α : Sort u₁}
{β : Sort u₂}
{γ : Sort u_1}
(f : α → β)
(c : γ)

Function.const β c ∘ f = Function.const α c


theorem gc_comap_map (f : α → β) :
    GaloisConnection (MeasurableSpace.comap f) (MeasurableSpace.map f)

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


/-- A prefunctor induces a map of `Quiver.Star` at every vertex. -/
@[simps]
def Prefunctor.star (u : U) : Quiver.Star u → Quiver.Star (φ.obj u)

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
(φ : U ⥤q V)
(u : U)

∀ (a : Quiver.Star u), (φ.star u a).snd = φ.map a.snd


/-- For `1 ≤ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `ℝ`-valued functions. -/
theorem rpow_sum_le_const_mul_sum_rpow (hp : 1 ≤ p) :
    (∑ i ∈ s, |f i|) ^ p ≤ (card s : ℝ) ^ (p - 1) * ∑ i ∈ s, |f i| ^ p

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

(∑ i ∈ s, |f i|) ^ p ≤ ↑s.card ^ (p - 1) * ∑ i ∈ s, |f i| ^ p


/-- The second projection at a point in a product is `C^∞`. -/
theorem contDiffAt_snd {p : E × F} : ContDiffAt 𝕜 n (Prod.snd : E × F → F) p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{p : E × F}


lemma doubleFactorial_le_factorial : ∀ n, n‼ ≤ n !


@[simp]
theorem coe_le [LE β] : (f : Germ l β) ≤ g ↔ f ≤ᶠ[l] g

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f g : α → β}
[LE β]


@[elab_as_elim]
protected theorem ind₂ {β : G.ConnectedComponent → G.ConnectedComponent → Prop}
    (h : ∀ v w : V, β (G.connectedComponentMk v) (G.connectedComponentMk w))
    (c d : G.ConnectedComponent) : β c d

(h : ∀ (v w : V), β (G.connectedComponentMk v) (G.connectedComponentMk w))


@[simp]
theorem coe_uniqueProd [Unique β] : (⇑(uniqueProd α β) : β × α → α) = Prod.snd

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


theorem lcm_eq {x y : PUnit} : lcm x y = unit


@[simp]
theorem nsmul_pow_two_powHalf' (n k : ℕ) : 2 ^ n * powHalf (n + k) = powHalf k

2 ^ n * Surreal.powHalf (n + k) = Surreal.powHalf k


/-- Constructor for short complexes in `ModuleCat.{v} R` taking as inputs
morphisms `f` and `g` and the assumption `LinearMap.range f ≤ LinearMap.ker g`. -/
@[simps]
def moduleCatMkOfKerLERange {X₁ X₂ X₃ : ModuleCat.{v} R} (f : X₁ ⟶ X₂) (g : X₂ ⟶ X₃)
    (hfg : LinearMap.range f ≤ LinearMap.ker g) : ShortComplex (ModuleCat.{v} R)

(CategoryTheory.ShortComplex.moduleCatMkOfKerLERange f g hfg).X₃ = X₃


theorem eq_lift_comp_mkRingHom {r : R → R → Prop} (f : RingQuot r →+* T) :
    f = lift ⟨f.comp (mkRingHom r), fun x y h ↦ congr_arg f (mkRingHom_rel h)⟩

{R : Type uR}
[Semiring R]
{T : Type uT}
[Semiring T]
{r : R → R → Prop}
(f : RingQuot r →+* T)

f = RingQuot.lift ⟨f.comp (RingQuot.mkRingHom r), ⋯⟩


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[simp, norm_cast] lemma ofReal_ratCast (q : ℚ) : ofReal' q = q


@[simp]
theorem mapRange.addMonoidHom_id :
    (mapRange.addMonoidHom fun i => AddMonoidHom.id (β₂ i)) = AddMonoidHom.id _

{ι : Type u}
{β₂ : ι → Type v₂}
[(i : ι) → AddZeroClass (β₂ i)]

(DFinsupp.mapRange.addMonoidHom fun i => AddMonoidHom.id (β₂ i)) = AddMonoidHom.id (Π₀ (i : ι), β₂ i)


theorem rightLim_le (h : x < y) : rightLim f x ≤ f y

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
{x y : α}
(h : x < y)


protected theorem neg_mem (hx : x ∈ p) : -x ∈ p

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
{module_M : Module R M}
(p : Submodule R M)
{x : M}
(hx : x ∈ p)


protected theorem IsVonNBounded.sub (hs : IsVonNBounded 𝕜 s) (ht : IsVonNBounded 𝕜 t) :
    IsVonNBounded 𝕜 (s - t)

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[AddGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[DistribMulAction 𝕜 E]
{s t : Set E}
(hs : Bornology.IsVonNBounded 𝕜 s)
(ht : Bornology.IsVonNBounded 𝕜 t)


theorem uniformContinuous_toAdd : UniformContinuous (toAdd : Multiplicative α → α)


theorem coe_one : ↑(1 : SubMulAction R M) = Set.range fun r : R => r • (1 : M)

{R : Type u_1}
{M : Type u_2}
[Monoid R]
[MulAction R M]
[One M]


theorem tsub_pos_of_lt (h : a < b) : 0 < b - a

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b : α}
(h : a < b)


@[simp]
theorem add_mk_eq_max {α β : Type u} [Infinite α] : #α + #β = max #α #β


/-- Continuous functions on products are continuous in their second argument -/
theorem Continuous.curry_right {f : X × Y → Z} (hf : Continuous f) {x : X} :
    Continuous fun y ↦ f (x, y)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X × Y → Z}
(hf : Continuous f)
{x : X}


theorem Submodule.rank_sup_add_rank_inf_eq (s t : Submodule R M) :
    Module.rank R (s ⊔ t : Submodule R M) + Module.rank R (s ⊓ t : Submodule R M) =
    Module.rank R s + Module.rank R t

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
(s t : Submodule R M)

Module.rank R ↥(s ⊔ t) + Module.rank R ↥(s ⊓ t) = Module.rank R ↥s + Module.rank R ↥t


@[to_additive (attr := gcongr) sub_lt_sub_left]
theorem div_lt_div_left' (h : a < b) (c : α) : c / b < c / a

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

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


/-- The submonoid generated by a set includes the set. -/
@[to_additive (attr := simp, aesop safe 20 apply (rule_sets := [SetLike]))
  "The `AddSubmonoid` generated by a set includes the set."]
theorem subset_closure : s ⊆ closure s

{M : Type u_1}
[MulOneClass M]
{s : Set M}


@[simp]
theorem get_enum (s : Stream' α) (n : ℕ) : get (enum s) n = (n, s.get n)


@[to_additive (attr := simp)]
theorem inv_subset_inv : s⁻¹ ⊆ t⁻¹ ↔ s ⊆ t

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


/-- A normal form ordinal notation has the form

     ω ^ a₁ * n₁ + ω ^ a₂ * n₂ + ... ω ^ aₖ * nₖ
  where `a₁ > a₂ > ... > aₖ` and all the `aᵢ` are
  also in normal form.

  We will essentially only be interested in normal form
  ordinal notations, but to avoid complicating the algorithms
  we define everything over general ordinal notations and
  only prove correctness with normal form as an invariant. -/
class NF (o : ONote) : Prop where
  out : Exists (NFBelow o)


theorem IsLocalMax.comp_continuousOn [TopologicalSpace δ] {s : Set δ} {g : δ → α} {b : δ}
    (hf : IsLocalMax f (g b)) (hg : ContinuousOn g s) (hb : b ∈ s) : IsLocalMaxOn (f ∘ g) s b

{α : Type u}
{β : Type v}
{δ : Type x}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
[TopologicalSpace δ]
{s : Set δ}
{g : δ → α}
{b : δ}
(hf : IsLocalMax f (g b))
(hg : ContinuousOn g s)
(hb : b ∈ s)


@[to_additive (attr := simp)]
theorem isUnit_iff : IsUnit s ↔ ∃ a, s = {a} ∧ IsUnit a

{α : Type u_2}
[DecidableEq α]
[SubtractionMonoid α]
{s : Finset α}

IsAddUnit s ↔ ∃ a, s = {a} ∧ IsAddUnit a


theorem image_union (s t : Set α) : r.image (s ∪ t) = r.image s ∪ r.image t

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


/-- When the second map `S.g` is zero, this is the right homology data on `S` given
by any colimit cokernel cofork of `S.g` -/
@[simps]
def ofIsColimitCokernelCofork (hg : S.g = 0) (c : CokernelCofork S.f) (hc : IsColimit c) :
    S.RightHomologyData

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.RightHomologyData.ofIsColimitCokernelCofork S hg c hc).Q = c.pt


@[simp]
theorem realize_sentence (S : L.ElementarySubstructure M) (φ : L.Sentence) : S ⊨ φ ↔ M ⊨ φ

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
(S : L.ElementarySubstructure M)
(φ : L.Sentence)

↥S ⊨ φ ↔ M ⊨ φ


/-- `CentroidHom.toEnd` as a `RingHom`. -/
@[simps]
def toEndRingHom : CentroidHom α →+* AddMonoid.End α

(α : Type u_5)
[NonUnitalNonAssocSemiring α]
(f : CentroidHom α)

(CentroidHom.toEndRingHom α) f = f.toEnd


@[simp]
theorem zero_trim (hm : m ≤ m0) : (0 : Measure α).trim hm = (0 : @Measure α m)

{α : Type u_1}
{m m0 : MeasurableSpace α}
(hm : m ≤ m0)


theorem aecover_Ico_of_Ioc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
    AECover (μ.restrict <| Ico A B) l fun i => Ioc (a i) (b i)

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

MeasureTheory.AECover (μ.restrict (Set.Ico A B)) l fun i => Set.Ioc (a i) (b i)


/-- When a vector is in `Kᗮ`, with the inner product the
other way round. -/
theorem mem_orthogonal' (v : E) : v ∈ Kᗮ ↔ ∀ u ∈ K, ⟪v, u⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(K : Submodule 𝕜 E)
(v : E)


/-- Let `t i` be a nonempty countable family of measurable sets in `α`. Let `g i : α → β` be a
family of measurable functions such that `g i` agrees with `g j` on `t i ∩ t j`. Then there exists
a measurable function `f : α → β` that agrees with each `g i` on `t i`.

We only need the assumption `[Nonempty ι]` to prove `[Nonempty (α → β)]`. -/
theorem exists_measurable_piecewise {ι} [Countable ι] [Nonempty ι] (t : ι → Set α)
    (t_meas : ∀ n, MeasurableSet (t n)) (g : ι → α → β) (hg : ∀ n, Measurable (g n))
    (ht : Pairwise fun i j => EqOn (g i) (g j) (t i ∩ t j)) :
    ∃ f : α → β, Measurable f ∧ ∀ n, EqOn f (g n) (t n)

(t_meas : ∀ (n : ι), MeasurableSet (t n))

(g : ι → α → β)

(ht : Pairwise fun i j => Set.EqOn (g i) (g j) (t i ∩ t j))

∃ f, Measurable f ∧ ∀ (n : ι), Set.EqOn f (g n) (t n)


theorem tendsto_approxBounded_ae {β} {f : α → β} [NormedAddCommGroup β] [NormedSpace ℝ β]
    {m m0 : MeasurableSpace α} {μ : Measure α} (hf : StronglyMeasurable[m] f) {c : ℝ}
    (hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) :
    ∀ᵐ x ∂μ, Tendsto (fun n => hf.approxBounded c n x) atTop (𝓝 (f x))

(hf : MeasureTheory.StronglyMeasurable f)

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => ↑(hf.approxBounded c n) x) Filter.atTop (𝓝 (f x))


theorem TendstoUniformlyOn.mono {s' : Set α} (h : TendstoUniformlyOn F f p s) (h' : s' ⊆ s) :
    TendstoUniformlyOn F f p s'

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{s : Set α}
{p : Filter ι}
{s' : Set α}
(h : TendstoUniformlyOn F f p s)
(h' : s' ⊆ s)


theorem ExprCnstr.eq_of_toNormPoly_eq (ctx : Context) (c d : ExprCnstr) (h : c.toNormPoly == d.toPoly) : c.denote ctx = d.denote ctx

(ctx : Nat.Linear.Context)
(c d : Nat.Linear.ExprCnstr)
(h : (c.toNormPoly == d.toPoly) = true)

Nat.Linear.ExprCnstr.denote ctx c = Nat.Linear.ExprCnstr.denote ctx d


@[simp]
theorem mk_eq_zero : (mk x : M ⧸ p) = 0 ↔ x ∈ p

{R : Type u_1}
{M : Type u_2}
{x : M}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)


@[simp]
theorem coe_pointwise_smul (a : α) (S : AddSubmonoid A) : ↑(a • S) = a • (S : Set A)

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[Monoid α]
[DistribMulAction α A]
(a : α)
(S : AddSubmonoid A)


@[simp]
theorem frontier_sphere' (x : E) (r : ℝ) : frontier (sphere x r) = sphere x r

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Nontrivial E]
(x : E)
(r : ℝ)

frontier (Metric.sphere x r) = Metric.sphere x r


lemma Functor.FullyFaithful.reflectsIsomorphisms {F : C ⥤ D} (hF : F.FullyFaithful) :
    F.ReflectsIsomorphisms

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : C ⥤ D}
(hF : F.FullyFaithful)


lemma list_sum_left (b : R) (l : List R) (h : ∀ a ∈ l, Commute a b) : Commute l.sum b

{R : Type u_5}
[NonUnitalNonAssocSemiring R]
(b : R)
(l : List R)
(h : ∀ a ∈ l, Commute a b)


@[simp] lemma map_nnratCast [DivisionSemiring α] [DivisionSemiring β] [RingHomClass F α β] (f : F)
    (q : ℚ≥0) : f q = q

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[DivisionSemiring α]
[DivisionSemiring β]
[RingHomClass F α β]
(f : F)
(q : ℚ≥0)


theorem integrableOn_Icc_iff_integrableOn_Ioo :
    IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioo a b) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[PartialOrder α]
[MeasurableSingletonClass α]
{f : α → E}
{μ : MeasureTheory.Measure α}
{a b : α}
[MeasureTheory.NoAtoms μ]

MeasureTheory.IntegrableOn f (Set.Icc a b) μ ↔ MeasureTheory.IntegrableOn f (Set.Ioo a b) μ


@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b

{α : Type u}
[CanonicallyOrderedCommMonoid α]
{a b : α}
(h : a < b)


@[to_additive]
theorem measure_pos_iff_nonempty_of_isMulLeftInvariant [Regular μ] (h3μ : μ ≠ 0) {s : Set G}
    (hs : IsOpen s) : 0 < μ s ↔ s.Nonempty

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[TopologicalGroup G]
[μ.IsMulLeftInvariant]
[μ.Regular]
(h3μ : μ ≠ 0)
{s : Set G}
(hs : IsOpen s)


@[simp]
theorem subtypePerm_zpow (f : Perm α) (n : ℤ) (hf) :
    (f.subtypePerm hf ^ n : Perm { x // p x }) = (f ^ n).subtypePerm (zpow_aux hf)

{α : Type u}
{p : α → Prop}
(f : Equiv.Perm α)
(n : ℤ)
(hf : ∀ (x : α), p x ↔ p (f x))

f.subtypePerm hf ^ n = (f ^ n).subtypePerm ⋯


/-- If `M` is the tensor product of `M₁` and `M₂`, it is linearly equivalent to `M₁ ⊗[R] M₂`. -/
@[simps! apply]
noncomputable def IsTensorProduct.equiv (h : IsTensorProduct f) : M₁ ⊗[R] M₂ ≃ₗ[R] M

{R : Type u_1}
[CommSemiring R]
{M₁ : Type u_2}
{M₂ : Type u_3}
{M : Type u_4}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M]
[Module R M₁]
[Module R M₂]
[Module R M]
{f : M₁ →ₗ[R] M₂ →ₗ[R] M}
(h : IsTensorProduct f)

∀ (a : M₁ ⊗[R] M₂), h.equiv a = (TensorProduct.lift f) a


/-- See also `LieIdeal.map_comap_eq`. -/
theorem comap_map_le : I ≤ comap f (map f I)

{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'}
{I : LieIdeal R L}


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise scalar multiplication of
`f` and `g`, which monovary together, is strictly decreased by a permutation if and only if
`f` and `g ∘ σ` do not monovary together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_comp_perm_smul_lt_sum_smul_iff (hfg : Monovary f g) :
    ∑ i, f (σ i) • g i < ∑ i, f i • g i ↔ ¬Monovary (f ∘ σ) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Monovary f g)

∑ i : ι, f (σ i) • g i < ∑ i : ι, f i • g i ↔ ¬Monovary (f ∘ ⇑σ) g


@[simp]
theorem interior_inter : interior (s ∩ t) = interior s ∩ interior t

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


theorem toΓSpecCApp_spec : toOpen _ (basicOpen r) ≫ X.toΓSpecCApp r = X.toToΓSpecMapBasicOpen r

(r : ↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))

CategoryTheory.CategoryStruct.comp
    (AlgebraicGeometry.StructureSheaf.toOpen (↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))
      (PrimeSpectrum.basicOpen r))
    (X.toΓSpecCApp r) =
  X.toToΓSpecMapBasicOpen r


@[simp]
theorem coe_toNonUnitalSubsemiring (s : NonUnitalSubring R) :
    (s.toNonUnitalSubsemiring : Set R) = s

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


@[simp]
theorem relabel_bot (g : α → β ⊕ (Fin n)) {k} : (⊥ : L.BoundedFormula α k).relabel g = ⊥

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{n : ℕ}
(g : α → β ⊕ Fin n)
{k : ℕ}

FirstOrder.Language.BoundedFormula.relabel g ⊥ = ⊥


@[simp, norm_cast]
theorem coe_mul (x y : Ioo (0 : α) 1) : ↑(x * y) = (x * y : α)

{α : Type u_1}
[StrictOrderedSemiring α]
(x y : ↑(Set.Ioo 0 1))


theorem comp_hasStrictFDerivAt_iff {f : G → E} {x : G} {f' : G →L[𝕜] E} :
    HasStrictFDerivAt (iso ∘ f) ((iso : E →L[𝕜] F).comp f') x ↔ HasStrictFDerivAt f f' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}
{x : G}
{f' : G →L[𝕜] E}

HasStrictFDerivAt (⇑iso ∘ f)
    ((↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }).comp f') x ↔
  HasStrictFDerivAt f f' x


/-- Two biproducts which differ by an equivalence in the indexing type,
and up to isomorphism in the factors, are isomorphic.

Unfortunately there are two natural ways to define each direction of this isomorphism
(because it is true for both products and coproducts separately).
We give the alternative definitions as lemmas below.
-/
@[simps]
def biproduct.whiskerEquiv {f : J → C} {g : K → C} (e : J ≃ K) (w : ∀ j, g (e j) ≅ f j)
    [HasBiproduct f] [HasBiproduct g] : ⨁ f ≅ ⨁ g

(CategoryTheory.Limits.biproduct.whiskerEquiv e w).hom =
  CategoryTheory.Limits.biproduct.desc fun j => (w j).inv ≫ CategoryTheory.Limits.biproduct.ι g (e j)


theorem ae_tendsto_lintegral_nnnorm_sub_div_of_integrable {f : α → E} (hf : Integrable f μ) :
    ∀ᵐ x ∂μ, Tendsto (fun a => (∫⁻ y in a, ‖f y - f x‖₊ ∂μ) / μ a) (v.filterAt x) (𝓝 0)

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => (∫⁻ (y : α) in a, ↑‖f y - f x‖₊ ∂μ) / μ a) (v.filterAt x) (𝓝 0)


theorem Algebra.adjoin_nat {R : Type*} [Semiring R] (s : Set R) :
    adjoin ℕ s = subalgebraOfSubsemiring (Subsemiring.closure s)

Algebra.adjoin ℕ s = subalgebraOfSubsemiring (Subsemiring.closure s)


theorem extract_gcd' (s t : Multiset α) (hs : ∃ x, x ∈ s ∧ x ≠ (0 : α))
    (ht : s = t.map (s.gcd * ·)) : t.gcd = 1

(ht : s = Multiset.map (fun x => s.gcd * x) t)


theorem preimage (hs : IsStrongAntichain r s) {f : β → α} (hf : Injective f)
    (h : ∀ a b, r' a b → r (f a) (f b)) : IsStrongAntichain r' (f ⁻¹' s)

(h : ∀ (a b : β), r' a b → r (f a) (f b))


@[simp]
theorem realize_functions_apply₂ {f : L.Functions 2} {t₁ t₂ : L.Term α} {v : α → M} :
    (f.apply₂ t₁ t₂).realize v = funMap f ![t₁.realize v, t₂.realize v]

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{f : L.Functions 2}
{t₁ t₂ : L.Term α}
{v : α → M}

FirstOrder.Language.Term.realize v (f.apply₂ t₁ t₂) =
  FirstOrder.Language.Structure.funMap f ![FirstOrder.Language.Term.realize v t₁, FirstOrder.Language.Term.realize v t₂]


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.mul' [MeasurableMul₂ M] (hf : Measurable f) (hg : Measurable g) :
    Measurable (f * g)

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Add M]
{m : MeasurableSpace α}
{f g : α → M}
[MeasurableAdd₂ M]
(hf : Measurable f)
(hg : Measurable g)


theorem hasDerivAt_of_tendstoUniformlyOn [NeBot l] {s : Set 𝕜} (hs : IsOpen s)
    (hf' : TendstoUniformlyOn f' g' l s)
    (hf : ∀ᶠ n in l, ∀ x : 𝕜, x ∈ s → HasDerivAt (f n) (f' n x) x)
    (hfg : ∀ x : 𝕜, x ∈ s → Tendsto (fun n => f n x) l (𝓝 (g x))) :
    ∀ x : 𝕜, x ∈ s → HasDerivAt g (g' x) x

(hf : ∀ᶠ (n : ι) in l, ∀ x ∈ s, HasDerivAt (f n) (f' n x) x)

(hfg : ∀ x ∈ s, Filter.Tendsto (fun n => f n x) l (𝓝 (g x)))


/-- Given an exact short complex `S` and a limit kernel fork `kf` for `S.g`, this is the
left homology data for `S` with `K := kf.pt` and `H := 0`. -/
@[simps]
noncomputable def Exact.leftHomologyDataOfIsLimitKernelFork
    (hS : S.Exact) [HasZeroObject C] (kf : KernelFork S.g) (hkf : IsLimit kf) :
    S.LeftHomologyData

(kf : CategoryTheory.Limits.KernelFork S.g)

(hkf : CategoryTheory.Limits.IsLimit kf)

(hS.leftHomologyDataOfIsLimitKernelFork kf hkf).i = CategoryTheory.Limits.Fork.ι kf


@[to_additive]
theorem apply_coe_mem_map (f : G →* N) (K : Subgroup G) (x : K) : f x ∈ K.map f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
(K : Subgroup G)
(x : ↥K)


@[to_additive (attr := simp)]
theorem preimage_mul_left_singleton : (a * ·) ⁻¹' {b} = {a⁻¹ * b}


theorem isCountablyGenerated_biInf_principal {B : Set (Set α)} (h : B.Countable) :
    IsCountablyGenerated (⨅ s ∈ B, 𝓟 s)

{α : Type u_1}
{B : Set (Set α)}
(h : B.Countable)


/-- Convolution of a measure μ with the dirac measure at 1 returns μ. -/
@[to_additive (attr := simp)]
theorem mconv_dirac_one [MeasurableMul₂ M]
    (μ : Measure M) [SFinite μ] : μ ∗ (Measure.dirac 1) = μ

{M : Type u_1}
[AddMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
(μ : MeasureTheory.Measure M)
[MeasureTheory.SFinite μ]

μ.conv (MeasureTheory.Measure.dirac 0) = μ


theorem coe_pow : ∀ n : ℕ, ⇑(f ^ n) = f^[n]


theorem HasFDerivAt.cosh (hf : HasFDerivAt f f' x) :
    HasFDerivAt (fun x => Real.cosh (f x)) (Real.sinh (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
(hf : HasFDerivAt f f' x)


theorem isBigO_of_degree_le (h : P.degree ≤ Q.degree) :
    (fun x => eval x P) =O[atTop] fun x => eval x Q

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P Q : 𝕜[X])
[OrderTopology 𝕜]
(h : P.degree ≤ Q.degree)

(fun x => Polynomial.eval x P) =O[Filter.atTop] fun x => Polynomial.eval x Q


theorem degree_add_divByMonic (hq : Monic q) (h : degree q ≤ degree p) :
    degree q + degree (p /ₘ q) = degree p

{R : Type u}
[Ring R]
{p q : R[X]}
(hq : q.Monic)
(h : q.degree ≤ p.degree)


theorem toIocDiv_eq_sub (a b : α) : toIocDiv hp a b = toIocDiv hp 0 (b - a)

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


/-- A variant of `Cardinal.lift_mk_eq` with specialized universes.
Because Lean often can not realize it should use this specialization itself,
we provide this statement separately so you don't have to solve the specialization problem either.
-/
theorem lift_mk_eq' {α : Type u} {β : Type v} : lift.{v} #α = lift.{u} #β ↔ Nonempty (α ≃ β)

Cardinal.lift.{v, u} (Cardinal.mk α) = Cardinal.lift.{u, v} (Cardinal.mk β) ↔ Nonempty (α ≃ β)


/-- The limit of a functor from a finite diagram into a `SemilatticeInf` with `OrderTop` is the
infimum of the objects in the image.
-/
theorem finite_limit_eq_finset_univ_inf [SemilatticeInf α] [OrderTop α] (F : J ⥤ α) :
    limit F = Finset.univ.inf F.obj

{α : Type u}
{J : Type w}
[CategoryTheory.SmallCategory J]
[CategoryTheory.FinCategory J]
[SemilatticeInf α]
[OrderTop α]
(F : J ⥤ α)

CategoryTheory.Limits.limit F = Finset.univ.inf F.obj


@[simp]
theorem preimage_ball (x : E) (r : ℝ) : f ⁻¹' Metric.ball (f x) r = Metric.ball x r

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(f : E →ₛₗᵢ[σ₁₂] E₂)
(x : E)
(r : ℝ)

⇑f ⁻¹' Metric.ball (f x) r = Metric.ball x r


@[to_additive]
theorem TendstoUniformlyOnFilter.mul (hf : TendstoUniformlyOnFilter f g l l')
    (hf' : TendstoUniformlyOnFilter f' g' l l') : TendstoUniformlyOnFilter (f * f') (g * g') l l'

TendstoUniformlyOnFilter (f + f') (g + g') l l'


@[simp]
theorem zmodEquivZPowers_symm_apply_zpow (i : ℤ) :
    h.zmodEquivZPowers.symm (Additive.ofMul (⟨ζ ^ i, i, rfl⟩ : Subgroup.zpowers ζ)) = i

{R : Type u_4}
{k : ℕ}
[CommRing R]
{ζ : Rˣ}
(h : IsPrimitiveRoot ζ k)
(i : ℤ)

h.zmodEquivZPowers.symm (Additive.ofMul ⟨ζ ^ i, ⋯⟩) = ↑i


theorem one_lt_rpow_iff_of_pos (hx : 0 < x) : 1 < x ^ y ↔ 1 < x ∧ 0 < y ∨ x < 1 ∧ y < 0


@[simp] lemma ofMon_obj (M : Mon_ (C ⥤ C)) (X : C) : (ofMon M).obj X = M.X.obj X

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

(CategoryTheory.Monad.ofMon M).obj X = M.X.obj X


@[simp]
theorem mul_imK : (a * b).imK = a.re * b.imK + a.imI * b.imJ - a.imJ * b.imI + a.imK * b.re

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])


@[simp]
theorem diagonal_eq_diagonal_iff [Zero α] {d₁ d₂ : n → α} :
    diagonal d₁ = diagonal d₂ ↔ ∀ i, d₁ i = d₂ i

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
{d₁ d₂ : n → α}

Matrix.diagonal d₁ = Matrix.diagonal d₂ ↔ ∀ (i : n), d₁ i = d₂ i


theorem gcd_greatest {α : Type*} [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α] {a b d : α}
    (hda : d ∣ a) (hdb : d ∣ b) (hd : ∀ e : α, e ∣ a → e ∣ b → e ∣ d) :
    GCDMonoid.gcd a b = normalize d

{α : Type u_2}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{a b d : α}
(hda : d ∣ a)
(hdb : d ∣ b)
(hd : ∀ (e : α), e ∣ a → e ∣ b → e ∣ d)


@[to_additive (attr := simp)]
lemma UniformOnFun.toFun_inv [Inv β] (f : α →ᵤ[𝔖] β) : toFun 𝔖 (f⁻¹) = (toFun 𝔖 f)⁻¹

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[Neg β]
(f : α →ᵤ[𝔖] β)

(UniformOnFun.toFun 𝔖) (-f) = -(UniformOnFun.toFun 𝔖) f


@[simp] theorem sub_imK : (a - b).imK = a.imK - b.imK

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


theorem exists_gcd_one' {m n : ℤ} (H : 0 < gcd m n) :
    ∃ (g : ℕ) (m' n' : ℤ), 0 < g ∧ gcd m' n' = 1 ∧ m = m' * g ∧ n = n' * g

∃ g m' n', 0 < g ∧ m'.gcd n' = 1 ∧ m = m' * ↑g ∧ n = n' * ↑g


theorem and_intro : ∀ {a b : Bool}, a → b → a && b


theorem CondIndepSets.iInter {s : ι → Set (Set Ω)} {s' : Set (Set Ω)}
    (h : ∃ n, CondIndepSets m' hm' (s n) s' μ) :
    CondIndepSets m' hm' (⋂ n, s n) s' μ

(h : ∃ n, ProbabilityTheory.CondIndepSets m' hm' (s n) s' μ)

ProbabilityTheory.CondIndepSets m' hm' (⋂ n, s n) s' μ


@[simp]
theorem comap_apply {β} (f : α → β) (m : OuterMeasure β) (s : Set α) : comap f m s = m (f '' s)

{α : Type u_1}
{β : Type u_3}
(f : α → β)
(m : MeasureTheory.OuterMeasure β)
(s : Set α)

((MeasureTheory.OuterMeasure.comap f) m) s = m (f '' s)


theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
    !![a₁₁, a₁₂;
       a₂₁, a₂₂] * !![b₁₁, b₁₂;
                      b₂₁, b₂₂] = !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
                                     a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂]

{α : Type u}
[AddCommMonoid α]
[Mul α]
(a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α)


theorem edgeFinset_ssubset_edgeFinset : G₁.edgeFinset ⊂ G₂.edgeFinset ↔ G₁ < G₂

{V : Type u_1}
{G₁ G₂ : SimpleGraph V}
[Fintype ↑G₁.edgeSet]
[Fintype ↑G₂.edgeSet]


/--
The theorem `PowerSeries.mk_one_mul_one_sub_eq_one` implies that `1 - X` is a unit in `S⟦X⟧`
whose inverse is the power series `1 + X + X^2 + ...`. This theorem states that for any `d : ℕ`,
`PowerSeries.invOneSubPow d` is equal to `(1 - X)⁻¹ ^ (d + 1)`.
-/
theorem invOneSubPow_eq_inv_one_sub_pow :
    invOneSubPow d = (Units.mkOfMulEqOne (1 - X) (mk 1 : S⟦X⟧)
    <| Eq.trans (mul_comm _ _) mk_one_mul_one_sub_eq_one)⁻¹ ^ (d + 1)

PowerSeries.invOneSubPow d = (Units.mkOfMulEqOne (1 - PowerSeries.X) (PowerSeries.mk 1) ⋯)⁻¹ ^ (d + 1)


theorem Submodule.le_topologicalClosure (s : Submodule R M) : s ≤ s.topologicalClosure

{R : Type u}
{M : Type v}
[Semiring R]
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
[ContinuousConstSMul R M]
[ContinuousAdd M]
(s : Submodule R M)


theorem sub_const (hf : DiffContOnCl 𝕜 f s) (c : F) : DiffContOnCl 𝕜 (fun x => f x - c) s

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


/-- When `d` is positive and not a square, then the group of solutions to the Pell equation
`x^2 - d*y^2 = 1` has a unique positive generator (up to sign). -/
theorem existsUnique_pos_generator (h₀ : 0 < d) (hd : ¬IsSquare d) :
    ∃! a₁ : Solution₁ d,
      1 < a₁.x ∧ 0 < a₁.y ∧ ∀ a : Solution₁ d, ∃ n : ℤ, a = a₁ ^ n ∨ a = -a₁ ^ n

∃! a₁, 1 < a₁.x ∧ 0 < a₁.y ∧ ∀ (a : Pell.Solution₁ d), ∃ n, a = a₁ ^ n ∨ a = -a₁ ^ n


/-- Lemmas showing projection is the inverse of product. -/
@[simp]
theorem projLeft_prod : projLeft (prod q₁ q₂) = q₁

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{a₁ a₂ : α}
{b₁ b₂ : β}
(q₁ : Path.Homotopic.Quotient a₁ a₂)
(q₂ : Path.Homotopic.Quotient b₁ b₂)

Path.Homotopic.projLeft (Path.Homotopic.prod q₁ q₂) = q₁


protected theorem nndist_eq {α β : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β] (h : α ≃ᵢ β)
    (x y : α) : nndist (h x) (h y) = nndist x y

{α : Type u_2}
{β : Type u_3}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
(h : α ≃ᵢ β)
(x y : α)


/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f` has a finite
limit `c` almost surely at `a`, then the derivative of `u ↦ ∫ x in u..b, f x` at `a` equals `-c`. -/
theorem deriv_integral_of_tendsto_ae_left (hf : IntervalIntegrable f volume a b)
    (hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (hb : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 c)) :
    deriv (fun u => ∫ x in u..b, f x) a = -c

(hf : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas : StronglyMeasurableAtFilter f (𝓝 a) MeasureTheory.volume)

(hb : Filter.Tendsto f (𝓝 a ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 c))

deriv (fun u => ∫ (x : ℝ) in u..b, f x) a = -c


theorem X_pow_sub_C_splits_of_isPrimitiveRoot
    {n : ℕ} {ζ : K} (hζ : IsPrimitiveRoot ζ n) {α a : K} (e : α ^ n = a) :
    (X ^ n - C a).Splits (RingHom.id _)

{K : Type u}
[Field K]
{n : ℕ}
{ζ : K}
(hζ : IsPrimitiveRoot ζ n)
{α a : K}
(e : α ^ n = a)

Polynomial.Splits (RingHom.id K) (Polynomial.X ^ n - Polynomial.C a)


/-- The canonical map `Φ.LeftResolution X₂ → Φ.op.RightResolution (Opposite.op X₂)`. -/
@[simps]
def LeftResolution.op {X₂ : C₂} (L : Φ.LeftResolution X₂) :
    Φ.op.RightResolution (Opposite.op X₂)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}


theorem liftPropWithinAt_of_liftPropAt_of_mem_nhds (h : LiftPropAt P g x) (hs : s ∈ 𝓝 x) :
    LiftPropWithinAt P g s x

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{g : M → M'}
{s : Set M}
{x : M}
(hG : G.LocalInvariantProp G' P)
(h : ChartedSpace.LiftPropAt P g x)
(hs : s ∈ 𝓝 x)


@[simp]
theorem reflect_zero {N : ℕ} : reflect N (0 : R[X]) = 0


@[to_additive] theorem toIsCancelMul [UniqueProds G] : IsCancelMul G


theorem DifferentiableOn.congr (h : DifferentiableOn 𝕜 f s) (h' : ∀ x ∈ s, f₁ x = f x) :
    DifferentiableOn 𝕜 f₁ s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{s : Set E}
(h : DifferentiableOn 𝕜 f s)
(h' : ∀ x ∈ s, f₁ x = f x)


@[simp]
theorem cancel_left {g : BoundedOrderHom β γ} {f₁ f₂ : BoundedOrderHom α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
{g : BoundedOrderHom β γ}
{f₁ f₂ : BoundedOrderHom α β}
(hg : Function.Injective ⇑g)


@[simp]
theorem centralizer_eq_top_iff_subset {R} [NonUnitalSemiring R] {s : Set R} :
    centralizer s = ⊤ ↔ s ⊆ center R

{R : Type u_1}
[NonUnitalSemiring R]
{s : Set R}

NonUnitalSubsemiring.centralizer s = ⊤ ↔ s ⊆ ↑(NonUnitalSubsemiring.center R)


@[to_additive (attr := simp)]
theorem mem_carrier {s : Subsemigroup M} {x : M} : x ∈ s.carrier ↔ x ∈ s

{M : Type u_1}
[Add M]
{s : AddSubsemigroup M}
{x : M}


theorem image₂_inter_union_subset {f : α → α → β} {s t : Finset α} (hf : ∀ a b, f a b = f b a) :
    image₂ f (s ∩ t) (s ∪ t) ⊆ image₂ f s t

{α : Type u_1}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
{f : α → α → β}
{s t : Finset α}
(hf : ∀ (a b : α), f a b = f b a)

Finset.image₂ f (s ∩ t) (s ∪ t) ⊆ Finset.image₂ f s t


@[to_additive]
theorem of_leftInverse [MonoidHomClass G N M] {f : F} {x : M} (g : G)
    (hfg : Function.LeftInverse g f) (h : IsUnit (f x)) : IsUnit x

{F : Type u_1}
{G : Type u_2}
{M : Type u_4}
{N : Type u_5}
[FunLike F M N]
[FunLike G N M]
[AddMonoid M]
[AddMonoid N]
[AddMonoidHomClass G N M]
{f : F}
{x : M}
(g : G)
(hfg : Function.LeftInverse ⇑g ⇑f)
(h : IsAddUnit (f x))


protected lemma mul_lt_mul_of_lt_of_lt [PosMulStrictMono α] (hab : a < b) (hcd : c < d) :
    a * c < b * d

{α : Type u}
[CanonicallyOrderedCommSemiring α]
{a b c d : α}
[PosMulStrictMono α]
(hab : a < b)
(hcd : c < d)


theorem lt_of_succ_le {n m : Nat} (h : succ n ≤ m) : n < m


theorem ne_zero_iff {p : MvPolynomial σ R} : p ≠ 0 ↔ ∃ d, coeff d p ≠ 0

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


@[simp]
theorem frontier_Ioi' {a : α} (ha : (Ioi a).Nonempty) : frontier (Ioi a) = {a}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(ha : (Set.Ioi a).Nonempty)


theorem hom_left_act_hom' :
    (P.tensorBimod (regular S)).actLeft ≫ hom P = (R.X ◁ hom P) ≫ P.actLeft

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

(P.tensorBimod (Bimod.regular S)).actLeft ≫ Bimod.RightUnitorBimod.hom P =
  R.X ◁ Bimod.RightUnitorBimod.hom P ≫ P.actLeft


theorem Infinite.mul {x y : ℝ*} : Infinite x → Infinite y → Infinite (x * y)

x.Infinite → y.Infinite → (x * y).Infinite


theorem integral_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (hf : ∀ᵐ x ∂μ, f x < ∞) :
    ∫ a, (f a).toReal ∂μ = (∫⁻ a, f a ∂μ).toReal

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hfm : AEMeasurable f μ)
(hf : ∀ᵐ (x : α) ∂μ, f x < ⊤)

∫ (a : α), (f a).toReal ∂μ = (∫⁻ (a : α), f a ∂μ).toReal


@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type*} [DecidableEq α] [OrderedCommMonoid γ]
    [CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
    (hdf : 1 < f d) : ∏ m ∈ s.erase d, f m < ∏ m ∈ s, f m

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


@[reassoc (attr := simp)]
theorem biproduct_ι_comp_leftDistributor_inv {J : Type} [Fintype J] (X : C) (f : J → C) (j : J) :
    biproduct.ι _ j ≫ (leftDistributor X f).inv = X ◁ biproduct.ι _ j

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.biproduct.ι (fun j => CategoryTheory.MonoidalCategory.tensorObj X (f j)) j)
    (CategoryTheory.leftDistributor X f).inv =
  CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.Limits.biproduct.ι f j)


@[simp]
theorem isLittleO_principal {s : Set α} : f'' =o[𝓟 s] g' ↔ ∀ x ∈ s, f'' x = 0

{α : Type u_1}
{F' : Type u_7}
{E'' : Type u_9}
[SeminormedAddCommGroup F']
[NormedAddCommGroup E'']
{g' : α → F'}
{f'' : α → E''}
{s : Set α}


@[to_additive]
theorem Multipliable.tprod_vanishing (hf : Multipliable f) ⦃e : Set G⦄ (he : e ∈ 𝓝 1) :
    ∃ s : Finset α, ∀ t : Set α, Disjoint t s → (∏' b : t, f b) ∈ e

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[CommGroup G]
[TopologicalGroup G]
{f : α → G}
(hf : Multipliable f)
⦃e : Set G⦄
(he : e ∈ 𝓝 1)

∃ s, ∀ (t : Set α), Disjoint t ↑s → ∏' (b : ↑t), f ↑b ∈ e


lemma conductor_dvd_level : conductor χ ∣ n

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)


theorem iUnionNotConvergentSeq_measurableSet (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))) :
    MeasurableSet <| iUnionNotConvergentSeq hε hf hg hsm hs hfg

{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)))

MeasurableSet (MeasureTheory.Egorov.iUnionNotConvergentSeq hε hf hg hsm hs hfg)


/-- Differentiation under integral of `x ↦ ∫ F x a` at a given point `x₀`, assuming `F x₀` is
integrable, `‖F x a - F x₀ a‖ ≤ bound a * ‖x - x₀‖` for `x` in a ball around `x₀` for ae `a` with
integrable Lipschitz bound `bound` (with a ball radius independent of `a`), and `F x` is
ae-measurable for `x` in the same ball. See `hasFDerivAt_integral_of_dominated_loc_of_lip` for a
slightly less general but usually more useful version. -/
theorem hasFDerivAt_integral_of_dominated_loc_of_lip' {F' : α → H →L[𝕜] E} (ε_pos : 0 < ε)
    (hF_meas : ∀ x ∈ ball x₀ ε, AEStronglyMeasurable (F x) μ) (hF_int : Integrable (F x₀) μ)
    (hF'_meas : AEStronglyMeasurable F' μ)
    (h_lipsch : ∀ᵐ a ∂μ, ∀ x ∈ ball x₀ ε, ‖F x a - F x₀ a‖ ≤ bound a * ‖x - x₀‖)
    (bound_integrable : Integrable (bound : α → ℝ) μ)
    (h_diff : ∀ᵐ a ∂μ, HasFDerivAt (F · a) (F' a) x₀) :
    Integrable F' μ ∧ HasFDerivAt (fun x ↦ ∫ a, F x a ∂μ) (∫ a, F' a ∂μ) x₀

(hF_meas : ∀ x ∈ Metric.ball x₀ ε, MeasureTheory.AEStronglyMeasurable (F x) μ)

(hF_int : MeasureTheory.Integrable (F x₀) μ)

(hF'_meas : MeasureTheory.AEStronglyMeasurable F' μ)

(h_lipsch : ∀ᵐ (a : α) ∂μ, ∀ x ∈ Metric.ball x₀ ε, ‖F x a - F x₀ a‖ ≤ bound a * ‖x - x₀‖)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_diff : ∀ᵐ (a : α) ∂μ, HasFDerivAt (fun x => F x a) (F' a) x₀)

MeasureTheory.Integrable F' μ ∧ HasFDerivAt (fun x => ∫ (a : α), F x a ∂μ) (∫ (a : α), F' a ∂μ) x₀


@[simp, norm_cast] lemma coe_himp (s t : Clopens α) : ↑(s ⇨ t) = (s ⇨ t : Set α)

{α : Type u_2}
[TopologicalSpace α]
(s t : TopologicalSpace.Clopens α)


@[to_additive]
theorem Function.Injective.hasProd_range_iff {g : γ → β} (hg : Injective g) :
    HasProd (fun x : Set.range g ↦ f x) a ↔ HasProd (f ∘ g) a

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

HasProd (fun x => f ↑x) a ↔ HasProd (f ∘ g) a


theorem ext_iff' {η : Kernel α β} :
    κ = η ↔ ∀ a s, MeasurableSet s → κ a s = η a s

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ η : ProbabilityTheory.Kernel α β}

κ = η ↔ ∀ (a : α) (s : Set β), MeasurableSet s → (κ a) s = (η a) s


/-- A generalization of Van der Waerden's theorem: if `M` is a finitely colored commutative
monoid, and `S` is a finite subset, then there exists a monochromatic homothetic copy of `S`. -/
theorem exists_mono_homothetic_copy {M κ : Type*} [AddCommMonoid M] (S : Finset M) [Finite κ]
    (C : M → κ) : ∃ a > 0, ∃ (b : M) (c : κ), ∀ s ∈ S, C (a • s + b) = c

{M : Type u_5}
{κ : Type u_6}
[AddCommMonoid M]
(S : Finset M)
[Finite κ]
(C : M → κ)

∃ a > 0, ∃ b c, ∀ s ∈ S, C (a • s + b) = c


/-- Distances `r₁` `r₂` of `p` from two different points `c₁` `c₂` determine at
most two points `p₁` `p₂` in two-dimensional space (two circles intersect in at
most two points). -/
theorem eq_of_dist_eq_of_dist_eq_of_finrank_eq_two [FiniteDimensional ℝ V] (hd : finrank ℝ V = 2)
    {c₁ c₂ p₁ p₂ p : P} {r₁ r₂ : ℝ} (hc : c₁ ≠ c₂) (hp : p₁ ≠ p₂) (hp₁c₁ : dist p₁ c₁ = r₁)
    (hp₂c₁ : dist p₂ c₁ = r₁) (hpc₁ : dist p c₁ = r₁) (hp₁c₂ : dist p₁ c₂ = r₂)
    (hp₂c₂ : dist p₂ c₂ = r₂) (hpc₂ : dist p c₂ = r₂) : p = p₁ ∨ p = p₂

(hd : FiniteDimensional.finrank ℝ V = 2)


/-- `Function.const` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`Function.const` as an `AddMonoidHom`."]
def Pi.constMonoidHom (α β : Type*) [MulOneClass β] : β →* α → β

(α : Type u_3)
(β : Type u_4)
[MulOneClass β]
(a : β)

∀ (a_1 : α), (Pi.constMonoidHom α β) a a_1 = Function.const α a a_1


@[to_additive addOrderOf_eq_prime_pow]
theorem orderOf_eq_prime_pow (hnot : ¬x ^ p ^ n = 1) (hfin : x ^ p ^ (n + 1) = 1) :
    orderOf x = p ^ (n + 1)

{G : Type u_1}
[AddMonoid G]
{x : G}
{n p : ℕ}
[hp : Fact (Nat.Prime p)]
(hnot : ¬p ^ n • x = 0)
(hfin : p ^ (n + 1) • x = 0)


theorem zero : (0 : NormedAddGroupHom V₁ V₂).NormNoninc

{V₁ : Type u_3}
{V₂ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]


lemma alexandrovDiscrete_iSup {t : ι → TopologicalSpace α} (_ : ∀ i, @AlexandrovDiscrete α (t i)) :
    @AlexandrovDiscrete α (⨆ i, t i)

{ι : Sort u_1}
{α : Type u_3}
{t : ι → TopologicalSpace α}

(∀ (i : ι), AlexandrovDiscrete α) → AlexandrovDiscrete α


/-- The forgetful functor from comonoid objects to the ambient category. -/
@[simps]
def forget : Comon_ C ⥤ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
(A : Comon_ C)


protected theorem IsSuccLimit.isMax (h : IsSuccLimit (succ a)) : IsMax a

{α : Type u_1}
[Preorder α]
{a : α}
[SuccOrder α]
(h : Order.IsSuccLimit (Order.succ a))


@[simp]
theorem toDual_total_right (f : ι →₀ R) (i : ι) :
    b.toDual (b i) (Finsupp.total ι M R b f) = f i

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

(b.toDual (b i)) ((Finsupp.total ι M R ⇑b) f) = f i


/-- `SatisfiesM` distributes over `mapConst`, general version. -/
protected theorem mapConst [Functor m] [LawfulFunctor m] {x : m α}
    (hx : SatisfiesM q x) (ha : ∀ {b}, q b → p a) : SatisfiesM p (Functor.mapConst a x)

{m : Type u_1 → Type u_2}
{α : Type u_1}
{q : α → Prop}

∀ {α_1 : Type u_1} {p : α_1 → Prop} {a : α_1} [inst : Functor m] [inst_1 : LawfulFunctor m] {x : m α},
  SatisfiesM q x → (∀ {b : α}, q b → p a) → SatisfiesM p (Functor.mapConst a x)


@[simp] lemma lift_eq_ofENat {x : Cardinal.{v}} {m : ℕ∞} : lift.{u} x = m ↔ x = m


@[to_additive (attr := simp)]
theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) :
    𝓝 a * 𝓝 1 = 𝓝 a

{M : Type u_6}
[MulOneClass M]
[TopologicalSpace M]
[ContinuousMul M]
(a : M)


theorem inf_biInf {p : ι → Prop} {f : ∀ i, p i → α} {a : α} (h : ∃ i, p i) :
    (a ⊓ ⨅ (i) (h : p i), f i h) = ⨅ (i) (h : p i), a ⊓ f i h

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{p : ι → Prop}
{f : (i : ι) → p i → α}
{a : α}
(h : ∃ i, p i)

a ⊓ ⨅ i, ⨅ (h : p i), f i h = ⨅ i, ⨅ (h : p i), a ⊓ f i h


theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f ∈ 𝓝 (f x)) :
    ContinuousAt (g ∘ f) x ↔ ContinuousAt g (f x)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hf : Inducing f)
{x : X}
(h : Set.range f ∈ 𝓝 (f x))


@[gcongr]
theorem rpow_le_rpow_of_exponent_le (hx : 1 ≤ x) (hyz : y ≤ z) : x ^ y ≤ x ^ z