l3lab/ntp-mathlib huggingface dataset:
/-- A family of continuous linear maps is `C^n` on `s` if all its applications are. -/
theorem contDiffOn_clm_apply {n : ℕ∞} {f : E → F →L[𝕜] G} {s : Set E} [FiniteDimensional 𝕜 F] :
    ContDiffOn 𝕜 n f s ↔ ∀ y, ContDiffOn 𝕜 n (fun x => f x y) s := by
  refine' ⟨fun h y => h.clm_apply contDiffOn_const, fun h => _⟩
  let d := finrank 𝕜 F
  have hd : d = finrank 𝕜 (Fin d → 𝕜) := (finrank_fin_fun 𝕜).symm
  let e₁ := ContinuousLinearEquiv.ofFinrankEq hd
  let e₂ := (e₁.arrowCongr (1 : G ≃L[𝕜] G)).trans (ContinuousLinearEquiv.piRing (Fin d))
  rw [← comp.left_id f, ← e₂.symm_comp_self]
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
inst✝¹ : CompleteSpace 𝕜
n : ℕ∞
f : E → F →L[𝕜] G
s : Set E
inst✝ : FiniteDimensional 𝕜 F
h : ∀ (y : F), ContDiffOn 𝕜 n (fun x => (f x) y) s
d : ℕ := finrank 𝕜 F
hd : d = finrank 𝕜 (Fin d → 𝕜)
e₁ : F ≃L[𝕜] Fin d → 𝕜 := ContinuousLinearEquiv.ofFinrankEq hd
e₂ : (F →L[𝕜] G) ≃L[𝕜] Fin d → G :=
  ContinuousLinearEquiv.trans (ContinuousLinearEquiv.arrowCongr e₁ 1) (ContinuousLinearEquiv.piRing (Fin d))
⊢ ContDiffOn 𝕜 n ((⇑(ContinuousLinearEquiv.symm e₂) ∘ ⇑e₂) ∘ f) s

Next tactic:
exact e₂.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _)
theorem contDiff_clm_apply_iff {n : ℕ∞} {f : E → F →L[𝕜] G} [FiniteDimensional 𝕜 F] :
    ContDiff 𝕜 n f ↔ ∀ y, ContDiff 𝕜 n fun x => f x y := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
inst✝¹ : CompleteSpace 𝕜
n : ℕ∞
f : E → F →L[𝕜] G
inst✝ : FiniteDimensional 𝕜 F
⊢ ContDiff 𝕜 n f ↔ ∀ (y : F), ContDiff 𝕜 n fun x => (f x) y

Next tactic:
simp_rw [← contDiffOn_univ, contDiffOn_clm_apply]
/-- This is a useful lemma to prove that a certain operation preserves functions being `C^n`.
When you do induction on `n`, this gives a useful characterization of a function being `C^(n+1)`,
assuming you have already computed the derivative. The advantage of this version over
`contDiff_succ_iff_fderiv` is that both occurrences of `ContDiff` are for functions with the same
domain and codomain (`E` and `F`). This is not the case for `contDiff_succ_iff_fderiv`, which
often requires an inconvenient need to generalize `F`, which results in universe issues
(see the discussion in the section of `ContDiff.comp`).

This lemma avoids these universe issues, but only applies for finite dimensional `E`. -/
theorem contDiff_succ_iff_fderiv_apply [FiniteDimensional 𝕜 E] {n : ℕ} {f : E → F} :
    ContDiff 𝕜 (n + 1 : ℕ) f ↔ Differentiable 𝕜 f ∧ ∀ y, ContDiff 𝕜 n fun x => fderiv 𝕜 f x y := by
  

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
inst✝¹ : CompleteSpace 𝕜
inst✝ : FiniteDimensional 𝕜 E
n : ℕ
f : E → F
⊢ ContDiff 𝕜 (↑(n + 1)) f ↔ Differentiable 𝕜 f ∧ ∀ (y : E), ContDiff 𝕜 ↑n fun x => (fderiv 𝕜 f x) y

Next tactic:
rw [contDiff_succ_iff_fderiv, contDiff_clm_apply_iff]
theorem contDiffOn_succ_iff_fderiv_apply [FiniteDimensional 𝕜 E] {n : ℕ} {f : E → F} {s : Set E}
    (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 (n + 1 : ℕ) f s ↔
      DifferentiableOn 𝕜 f s ∧ ∀ y, ContDiffOn 𝕜 n (fun x => fderivWithin 𝕜 f s x y) s :=
  by 

Proof state:
𝕜 : Type u_1
inst✝¹⁰ : NontriviallyNormedField 𝕜
D : Type uD
inst✝⁹ : NormedAddCommGroup D
inst✝⁸ : NormedSpace 𝕜 D
E : Type uE
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace 𝕜 E
F : Type uF
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
G : Type uG
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace 𝕜 G
inst✝¹ : CompleteSpace 𝕜
inst✝ : FiniteDimensional 𝕜 E
n : ℕ
f : E → F
s : Set E
hs : UniqueDiffOn 𝕜 s
⊢ ContDiffOn 𝕜 (↑(n + 1)) f s ↔
    DifferentiableOn 𝕜 f s ∧ ∀ (y : E), ContDiffOn 𝕜 (↑n) (fun x => (fderivWithin 𝕜 f s x) y) s

Next tactic:
rw [contDiffOn_succ_iff_fderivWithin hs, contDiffOn_clm_apply]
/-- A non-unital subsemiring of a `NonUnitalNonAssocSemiring` inherits a
`NonUnitalNonAssocSemiring` structure -/
instance (priority := 75) toNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring s :=
  Subtype.coe_injective.nonUnitalNonAssocSemiring (↑) rfl (by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : SetLike S R
inst✝ : NonUnitalSubsemiringClass S R
s : S
⊢ ∀ (x y : ↥s), ↑(x + y) = ↑x + ↑y

Next tactic:
simp
/-- A non-unital subsemiring of a `NonUnitalSemiring` is a `NonUnitalSemiring`. -/
instance toNonUnitalSemiring {R} [NonUnitalSemiring R] [SetLike S R]
    [NonUnitalSubsemiringClass S R] : NonUnitalSemiring s :=
  Subtype.coe_injective.nonUnitalSemiring (↑) rfl (by 

Proof state:
R✝ : Type u
S : Type v
T : Type w
inst✝⁵ : NonUnitalNonAssocSemiring R✝
M : Subsemigroup R✝
inst✝⁴ : SetLike S R✝
inst✝³ : NonUnitalSubsemiringClass S R✝
s : S
R : Type ?u.23490
inst✝² : NonUnitalSemiring R
inst✝¹ : SetLike S R
inst✝ : NonUnitalSubsemiringClass S R
⊢ ∀ (x y : ↥s), ↑(x + y) = ↑x + ↑y

Next tactic:
simp
/-- A non-unital subsemiring of a `NonUnitalCommSemiring` is a `NonUnitalCommSemiring`. -/
instance toNonUnitalCommSemiring {R} [NonUnitalCommSemiring R] [SetLike S R]
    [NonUnitalSubsemiringClass S R] : NonUnitalCommSemiring s :=
  Subtype.coe_injective.nonUnitalCommSemiring (↑) rfl (by 

Proof state:
R✝ : Type u
S : Type v
T : Type w
inst✝⁵ : NonUnitalNonAssocSemiring R✝
M : Subsemigroup R✝
inst✝⁴ : SetLike S R✝
inst✝³ : NonUnitalSubsemiringClass S R✝
s : S
R : Type ?u.29601
inst✝² : NonUnitalCommSemiring R
inst✝¹ : SetLike S R
inst✝ : NonUnitalSubsemiringClass S R
⊢ ∀ (x y : ↥s), ↑(x + y) = ↑x + ↑y

Next tactic:
simp
instance : SetLike (NonUnitalSubsemiring R) R where
  coe s := s.carrier
  coe_injective' p q h := by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
p q : NonUnitalSubsemiring R
h : (fun s => s.carrier) p = (fun s => s.carrier) q
⊢ p = q

Next tactic:
cases p
instance : SetLike (NonUnitalSubsemiring R) R where
  coe s := s.carrier
  coe_injective' p q h := by cases p; 

Proof state:
case mk
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
q : NonUnitalSubsemiring R
toAddSubmonoid✝ : AddSubmonoid R
mul_mem'✝ : ∀ {a b : R}, a ∈ toAddSubmonoid✝.carrier → b ∈ toAddSubmonoid✝.carrier → a * b ∈ toAddSubmonoid✝.carrier
h : (fun s => s.carrier) { toAddSubmonoid := toAddSubmonoid✝, mul_mem' := mul_mem'✝ } = (fun s => s.carrier) q
⊢ { toAddSubmonoid := toAddSubmonoid✝, mul_mem' := mul_mem'✝ } = q

Next tactic:
cases q
instance : SetLike (NonUnitalSubsemiring R) R where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; 

Proof state:
case mk.mk
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
toAddSubmonoid✝¹ : AddSubmonoid R
mul_mem'✝¹ : ∀ {a b : R}, a ∈ toAddSubmonoid✝¹.carrier → b ∈ toAddSubmonoid✝¹.carrier → a * b ∈ toAddSubmonoid✝¹.carrier
toAddSubmonoid✝ : AddSubmonoid R
mul_mem'✝ : ∀ {a b : R}, a ∈ toAddSubmonoid✝.carrier → b ∈ toAddSubmonoid✝.carrier → a * b ∈ toAddSubmonoid✝.carrier
h :
  (fun s => s.carrier) { toAddSubmonoid := toAddSubmonoid✝¹, mul_mem' := mul_mem'✝¹ } =
    (fun s => s.carrier) { toAddSubmonoid := toAddSubmonoid✝, mul_mem' := mul_mem'✝ }
⊢ { toAddSubmonoid := toAddSubmonoid✝¹, mul_mem' := mul_mem'✝¹ } =
    { toAddSubmonoid := toAddSubmonoid✝, mul_mem' := mul_mem'✝ }

Next tactic:
congr
instance : SetLike (NonUnitalSubsemiring R) R where
  coe s := s.carrier
  coe_injective' p q h := by cases p; cases q; congr; 

Proof state:
case mk.mk.e_toAddSubmonoid
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
toAddSubmonoid✝¹ : AddSubmonoid R
mul_mem'✝¹ : ∀ {a b : R}, a ∈ toAddSubmonoid✝¹.carrier → b ∈ toAddSubmonoid✝¹.carrier → a * b ∈ toAddSubmonoid✝¹.carrier
toAddSubmonoid✝ : AddSubmonoid R
mul_mem'✝ : ∀ {a b : R}, a ∈ toAddSubmonoid✝.carrier → b ∈ toAddSubmonoid✝.carrier → a * b ∈ toAddSubmonoid✝.carrier
h :
  (fun s => s.carrier) { toAddSubmonoid := toAddSubmonoid✝¹, mul_mem' := mul_mem'✝¹ } =
    (fun s => s.carrier) { toAddSubmonoid := toAddSubmonoid✝, mul_mem' := mul_mem'✝ }
⊢ toAddSubmonoid✝¹ = toAddSubmonoid✝

Next tactic:
exact SetLike.coe_injective' h
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by subst ha; exact sa.zero_mem
  add_mem' := by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
s : Set R
sg : Subsemigroup R
hg : ↑sg = s
sa : AddSubmonoid R
ha : ↑sa = s
⊢ ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s

Next tactic:
subst ha
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by subst ha; exact sa.zero_mem
  add_mem' := by subst ha; 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
sg : Subsemigroup R
sa : AddSubmonoid R
hg : ↑sg = ↑sa
⊢ ∀ {a b : R}, a ∈ ↑sa → b ∈ ↑sa → a + b ∈ ↑sa

Next tactic:
exact sa.add_mem
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
s : Set R
sg : Subsemigroup R
hg : ↑sg = s
sa : AddSubmonoid R
ha : ↑sa = s
⊢ 0 ∈ { carrier := s, add_mem' := (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) }.carrier

Next tactic:
subst ha
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by subst ha; 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
sg : Subsemigroup R
sa : AddSubmonoid R
hg : ↑sg = ↑sa
⊢ 0 ∈ { carrier := ↑sa, add_mem' := (_ : ∀ {a b : R}, a ∈ ↑sa → b ∈ ↑sa → a + b ∈ ↑sa) }.carrier

Next tactic:
exact sa.zero_mem
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by subst ha; exact sa.zero_mem
  add_mem' := by subst ha; exact sa.add_mem
  mul_mem' := by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
s : Set R
sg : Subsemigroup R
hg : ↑sg = s
sa : AddSubmonoid R
ha : ↑sa = s
⊢ ∀ {a b : R},
    a ∈
        { toAddSubsemigroup := { carrier := s, add_mem' := (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := s,
                        add_mem' :=
                          (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) }.carrier) }.toAddSubsemigroup.carrier →
      b ∈
          { toAddSubsemigroup := { carrier := s, add_mem' := (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) },
                zero_mem' :=
                  (_ :
                    0 ∈
                      { carrier := s,
                          add_mem' :=
                            (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) }.carrier) }.toAddSubsemigroup.carrier →
        a * b ∈
          { toAddSubsemigroup := { carrier := s, add_mem' := (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) },
                zero_mem' :=
                  (_ :
                    0 ∈
                      { carrier := s,
                          add_mem' :=
                            (_ : ∀ {a b : R}, a ∈ s → b ∈ s → a + b ∈ s) }.carrier) }.toAddSubsemigroup.carrier

Next tactic:
subst hg
/-- Construct a `NonUnitalSubsemiring R` from a set `s`, a subsemigroup `sg`, and an additive
submonoid `sa` such that `x ∈ s ↔ x ∈ sg ↔ x ∈ sa`. -/
protected def mk' (s : Set R) (sg : Subsemigroup R) (hg : ↑sg = s) (sa : AddSubmonoid R)
    (ha : ↑sa = s) : NonUnitalSubsemiring R where
  carrier := s
  zero_mem' := by subst ha; exact sa.zero_mem
  add_mem' := by subst ha; exact sa.add_mem
  mul_mem' := by subst hg; 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
sg : Subsemigroup R
sa : AddSubmonoid R
ha : ↑sa = ↑sg
⊢ ∀ {a b : R},
    a ∈
        { toAddSubsemigroup := { carrier := ↑sg, add_mem' := (_ : ∀ {a b : R}, a ∈ ↑sg → b ∈ ↑sg → a + b ∈ ↑sg) },
              zero_mem' :=
                (_ :
                  0 ∈
                    { carrier := ↑sg,
                        add_mem' :=
                          (_ : ∀ {a b : R}, a ∈ ↑sg → b ∈ ↑sg → a + b ∈ ↑sg) }.carrier) }.toAddSubsemigroup.carrier →
      b ∈
          { toAddSubsemigroup := { carrier := ↑sg, add_mem' := (_ : ∀ {a b : R}, a ∈ ↑sg → b ∈ ↑sg → a + b ∈ ↑sg) },
                zero_mem' :=
                  (_ :
                    0 ∈
                      { carrier := ↑sg,
                          add_mem' :=
                            (_ : ∀ {a b : R}, a ∈ ↑sg → b ∈ ↑sg → a + b ∈ ↑sg) }.carrier) }.toAddSubsemigroup.carrier →
        a * b ∈
          { toAddSubsemigroup := { carrier := ↑sg, add_mem' := (_ : ∀ {a b : R}, a ∈ ↑sg → b ∈ ↑sg → a + b ∈ ↑sg) },
                zero_mem' :=
                  (_ :
                    0 ∈
                      { carrier := ↑sg,
                          add_mem' :=
                            (_ : ∀ {a b : R}, a ∈ ↑sg → b ∈ ↑sg → a + b ∈ ↑sg) }.carrier) }.toAddSubsemigroup.carrier

Next tactic:
exact sg.mul_mem
@[simp]
theorem mem_map {f : F} {s : NonUnitalSubsemiring R} {y : S} : y ∈ s.map f ↔ ∃ x ∈ s, f x = y := by
  

Proof state:
R : Type u
S : Type v
T : Type w
inst✝⁴ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝³ : NonUnitalNonAssocSemiring S
inst✝² : NonUnitalNonAssocSemiring T
F : Type u_1
G : Type u_2
inst✝¹ : NonUnitalRingHomClass F R S
inst✝ : NonUnitalRingHomClass G S T
s✝ : NonUnitalSubsemiring R
f : F
s : NonUnitalSubsemiring R
y : S
⊢ y ∈ map f s ↔ ∃ x ∈ s, f x = y

Next tactic:
convert Set.mem_image_iff_bex
@[simp]
theorem mem_map {f : F} {s : NonUnitalSubsemiring R} {y : S} : y ∈ s.map f ↔ ∃ x ∈ s, f x = y := by
  convert Set.mem_image_iff_bex
  

Proof state:
case h.e'_2.h.e'_2.h.a
R : Type u
S : Type v
T : Type w
inst✝⁴ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝³ : NonUnitalNonAssocSemiring S
inst✝² : NonUnitalNonAssocSemiring T
F : Type u_1
G : Type u_2
inst✝¹ : NonUnitalRingHomClass F R S
inst✝ : NonUnitalRingHomClass G S T
s✝ : NonUnitalSubsemiring R
f : F
s : NonUnitalSubsemiring R
y : S
x✝ : R
⊢ x✝ ∈ s ∧ f x✝ = y ↔ ∃ (_ : x✝ ∈ ↑s), f x✝ = y

Next tactic:
simp
theorem srange_eq_map : @srange R S _ _ _ _ f = (⊤ : NonUnitalSubsemiring R).map f := by
  

Proof state:
R : Type u
S : Type v
T : Type w
inst✝⁴ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝³ : NonUnitalNonAssocSemiring S
inst✝² : NonUnitalNonAssocSemiring T
F : Type u_1
G : Type u_2
inst✝¹ : NonUnitalRingHomClass F R S
inst✝ : NonUnitalRingHomClass G S T
f : F
g : G
⊢ srange f = map f ⊤

Next tactic:
ext
theorem srange_eq_map : @srange R S _ _ _ _ f = (⊤ : NonUnitalSubsemiring R).map f := by
  ext
  

Proof state:
case h
R : Type u
S : Type v
T : Type w
inst✝⁴ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝³ : NonUnitalNonAssocSemiring S
inst✝² : NonUnitalNonAssocSemiring T
F : Type u_1
G : Type u_2
inst✝¹ : NonUnitalRingHomClass F R S
inst✝ : NonUnitalRingHomClass G S T
f : F
g : G
x✝ : S
⊢ x✝ ∈ srange f ↔ x✝ ∈ map f ⊤

Next tactic:
simp
theorem map_srange (g : S →ₙ+* T) (f : R →ₙ+* S) : map g (srange f) = srange (g.comp f) := by
  

Proof state:
R : Type u
S : Type v
T : Type w
inst✝⁴ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝³ : NonUnitalNonAssocSemiring S
inst✝² : NonUnitalNonAssocSemiring T
F : Type u_1
G : Type u_2
inst✝¹ : NonUnitalRingHomClass F R S
inst✝ : NonUnitalRingHomClass G S T
f✝ : F
g✝ : G
g : S →ₙ+* T
f : R →ₙ+* S
⊢ map g (srange f) = srange (comp g f)

Next tactic:
simpa only [srange_eq_map] using (⊤ : NonUnitalSubsemiring R).map_map g f
instance : Bot (NonUnitalSubsemiring R) :=
  ⟨{  carrier := {0}
      add_mem' := fun _ _ => by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
a✝ b✝ : R
x✝¹ : a✝ ∈ {0}
x✝ : b✝ ∈ {0}
⊢ a✝ + b✝ ∈ {0}

Next tactic:
simp_all
instance : Bot (NonUnitalSubsemiring R) :=
  ⟨{  carrier := {0}
      add_mem' := fun _ _ => by simp_all
      zero_mem' := Set.mem_singleton 0
      mul_mem' := fun _ _ => by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
a✝ b✝ : R
x✝¹ :
  a✝ ∈
    { toAddSubsemigroup := { carrier := {0}, add_mem' := (_ : ∀ {a b : R}, a ∈ {0} → b ∈ {0} → a + b ∈ {0}) },
          zero_mem' := (_ : 0 ∈ {0}) }.toAddSubsemigroup.carrier
x✝ :
  b✝ ∈
    { toAddSubsemigroup := { carrier := {0}, add_mem' := (_ : ∀ {a b : R}, a ∈ {0} → b ∈ {0} → a + b ∈ {0}) },
          zero_mem' := (_ : 0 ∈ {0}) }.toAddSubsemigroup.carrier
⊢ a✝ * b✝ ∈
    { toAddSubsemigroup := { carrier := {0}, add_mem' := (_ : ∀ {a b : R}, a ∈ {0} → b ∈ {0} → a + b ∈ {0}) },
          zero_mem' := (_ : 0 ∈ {0}) }.toAddSubsemigroup.carrier

Next tactic:
simp_all
instance : InfSet (NonUnitalSubsemiring R) :=
  ⟨fun s =>
    NonUnitalSubsemiring.mk' (⋂ t ∈ s, ↑t) (⨅ t ∈ s, NonUnitalSubsemiring.toSubsemigroup t)
      (by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
s : Set (NonUnitalSubsemiring R)
⊢ ↑(⨅ t ∈ s, toSubsemigroup t) = ⋂ t ∈ s, ↑t

Next tactic:
simp
instance : InfSet (NonUnitalSubsemiring R) :=
  ⟨fun s =>
    NonUnitalSubsemiring.mk' (⋂ t ∈ s, ↑t) (⨅ t ∈ s, NonUnitalSubsemiring.toSubsemigroup t)
      (by simp) (⨅ t ∈ s, NonUnitalSubsemiring.toAddSubmonoid t) (by 

Proof state:
R : Type u
S : Type v
T : Type w
inst✝² : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝¹ : NonUnitalNonAssocSemiring S
inst✝ : NonUnitalNonAssocSemiring T
s : Set (NonUnitalSubsemiring R)
⊢ ↑(⨅ t ∈ s, t.toAddSubmonoid) = ⋂ t ∈ s, ↑t

Next tactic:
simp
/-- A point-free means of proving membership in the center, for a non-associative ring.

This can be helpful when working with types that have ext lemmas for `R →+ R`. -/
lemma _root_.Set.mem_center_iff_addMonoidHom (a : R) :
    a ∈ Set.center R ↔
      AddMonoidHom.mulLeft a = .mulRight a ∧
      AddMonoidHom.compr₂ .mul (.mulLeft a) = .comp .mul (.mulLeft a) ∧
      AddMonoidHom.comp .mul (.mulRight a) = .compl₂ .mul (.mulLeft a) ∧
      AddMonoidHom.compr₂ .mul (.mulRight a) = .compl₂ .mul (.mulRight a) := by
  

Proof state:
R : Type u
S : Type v
T : Type w
inst✝³ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝² : NonUnitalNonAssocSemiring S
inst✝¹ : NonUnitalNonAssocSemiring T
inst✝ : NonUnitalNonAssocSemiring R
a : R
⊢ a ∈ Set.center R ↔
    AddMonoidHom.mulLeft a = AddMonoidHom.mulRight a ∧
      AddMonoidHom.compr₂ AddMonoidHom.mul (AddMonoidHom.mulLeft a) =
          AddMonoidHom.comp AddMonoidHom.mul (AddMonoidHom.mulLeft a) ∧
        AddMonoidHom.comp AddMonoidHom.mul (AddMonoidHom.mulRight a) =
            AddMonoidHom.compl₂ AddMonoidHom.mul (AddMonoidHom.mulLeft a) ∧
          AddMonoidHom.compr₂ AddMonoidHom.mul (AddMonoidHom.mulRight a) =
            AddMonoidHom.compl₂ AddMonoidHom.mul (AddMonoidHom.mulRight a)

Next tactic:
rw [Set.mem_center_iff, isMulCentral_iff]
/-- A point-free means of proving membership in the center, for a non-associative ring.

This can be helpful when working with types that have ext lemmas for `R →+ R`. -/
lemma _root_.Set.mem_center_iff_addMonoidHom (a : R) :
    a ∈ Set.center R ↔
      AddMonoidHom.mulLeft a = .mulRight a ∧
      AddMonoidHom.compr₂ .mul (.mulLeft a) = .comp .mul (.mulLeft a) ∧
      AddMonoidHom.comp .mul (.mulRight a) = .compl₂ .mul (.mulLeft a) ∧
      AddMonoidHom.compr₂ .mul (.mulRight a) = .compl₂ .mul (.mulRight a) := by
  rw [Set.mem_center_iff, isMulCentral_iff]
  

Proof state:
R : Type u
S : Type v
T : Type w
inst✝³ : NonUnitalNonAssocSemiring R
M : Subsemigroup R
inst✝² : NonUnitalNonAssocSemiring S
inst✝¹ : NonUnitalNonAssocSemiring T
inst✝ : NonUnitalNonAssocSemiring R
a : R
⊢ ((∀ (a_1 : R), a * a_1 = a_1 * a) ∧
      (∀ (b c : R), a * (b * c) = a * b * c) ∧
        (∀ (a_1 c : R), a_1 * a * c = a_1 * (a * c)) ∧ ∀ (a_1 b : R), a_1 * b * a = a_1 * (b * a)) ↔
    AddMonoidHom.mulLeft a = AddMonoidHom.mulRight a ∧
      AddMonoidHom.compr₂ AddMonoidHom.mul (AddMonoidHom.mulLeft a) =
          AddMonoidHom.comp AddMonoidHom.mul (AddMonoidHom.mulLeft a) ∧
        AddMonoidHom.comp AddMonoidHom.mul (AddMonoidHom.mulRight a) =
            AddMonoidHom.compl₂ AddMonoidHom.mul (AddMonoidHom.mulLeft a) ∧
          AddMonoidHom.compr₂ AddMonoidHom.mul (AddMonoidHom.mulRight a) =
            AddMonoidHom.compl₂ AddMonoidHom.mul (AddMonoidHom.mulRight a)

Next tactic:
simp_rw [FunLike.ext_iff]