l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem zeroRootSubalgebra_normalizer_eq_self :
    (zeroRootSubalgebra R L H).normalizer = zeroRootSubalgebra R L H := by
  refine' le_antisymm _ (LieSubalgebra.le_normalizer _)
  intro x hx
  rw [LieSubalgebra.mem_normalizer_iff] at hx
  rw [mem_zeroRootSubalgebra]
  rintro ⟨y, hy⟩
  specialize hx y (le_zeroRootSubalgebra R L H hy)
  rw [mem_zeroRootSubalgebra] at hx
  obtain ⟨k, hk⟩ := hx ⟨y, hy⟩
  rw [← lie_skew, LinearMap.map_neg, neg_eq_zero] at hk
  use k + 1
  

Proof state:
case h
R : Type u_1
L : Type u_2
inst✝⁷ : CommRing R
inst✝⁶ : LieRing L
inst✝⁵ : LieAlgebra R L
H : LieSubalgebra R L
inst✝⁴ : IsNilpotent R ↥H
M : Type u_3
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : LieRingModule L M
inst✝ : LieModule R L M
x y : L
hy : y ∈ H
hx : ∀ (y_1 : ↥H), ∃ k, ((toEndomorphism R (↥H) L) y_1 ^ k) ⁅x, y⁆ = 0
k : ℕ
hk : ((toEndomorphism R (↥H) L) { val := y, property := hy } ^ k) ⁅y, x⁆ = 0
⊢ ((toEndomorphism R (↥H) L) { val := y, property := hy } ^ (k + 1)) x = 0

Next tactic:
rw [LinearMap.iterate_succ, LinearMap.coe_comp, Function.comp_apply, toEndomorphism_apply_apply,
    LieSubalgebra.coe_bracket_of_module, Submodule.coe_mk, hk]
/-- If the zero root subalgebra of a nilpotent Lie subalgebra `H` is just `H` then `H` is a Cartan
subalgebra.

When `L` is Noetherian, it follows from Engel's theorem that the converse holds. See
`LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan` -/
theorem is_cartan_of_zeroRootSubalgebra_eq (h : zeroRootSubalgebra R L H = H) :
    H.IsCartanSubalgebra :=
  { nilpotent := inferInstance
    self_normalizing := by 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁷ : CommRing R
inst✝⁶ : LieRing L
inst✝⁵ : LieAlgebra R L
H : LieSubalgebra R L
inst✝⁴ : IsNilpotent R ↥H
M : Type u_3
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : LieRingModule L M
inst✝ : LieModule R L M
h : zeroRootSubalgebra R L H = H
⊢ LieSubalgebra.normalizer H = H

Next tactic:
rw [← h]
/-- If the zero root subalgebra of a nilpotent Lie subalgebra `H` is just `H` then `H` is a Cartan
subalgebra.

When `L` is Noetherian, it follows from Engel's theorem that the converse holds. See
`LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan` -/
theorem is_cartan_of_zeroRootSubalgebra_eq (h : zeroRootSubalgebra R L H = H) :
    H.IsCartanSubalgebra :=
  { nilpotent := inferInstance
    self_normalizing := by rw [← h]; 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁷ : CommRing R
inst✝⁶ : LieRing L
inst✝⁵ : LieAlgebra R L
H : LieSubalgebra R L
inst✝⁴ : IsNilpotent R ↥H
M : Type u_3
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : LieRingModule L M
inst✝ : LieModule R L M
h : zeroRootSubalgebra R L H = H
⊢ LieSubalgebra.normalizer (zeroRootSubalgebra R L H) = zeroRootSubalgebra R L H

Next tactic:
exact zeroRootSubalgebra_normalizer_eq_self R L H
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
⊢ zeroRootSubalgebra R L H = H

Next tactic:
refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
  

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
⊢ zeroRootSubalgebra R L H ≤ H

Next tactic:
suffices rootSpace H 0 ≤ H.toLieSubmodule by exact fun x hx => this hx
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
  suffices rootSpace H 0 ≤ H.toLieSubmodule by 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
this : rootSpace H 0 ≤ LieSubalgebra.toLieSubmodule H
⊢ zeroRootSubalgebra R L H ≤ H

Next tactic:
exact fun x hx => this hx
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
  suffices rootSpace H 0 ≤ H.toLieSubmodule by exact fun x hx => this hx
  

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
⊢ rootSpace H 0 ≤ LieSubalgebra.toLieSubmodule H

Next tactic:
obtain ⟨k, hk⟩ := (rootSpace H 0).isNilpotent_iff_exists_self_le_ucs.mp (by infer_instance)
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
  suffices rootSpace H 0 ≤ H.toLieSubmodule by exact fun x hx => this hx
  obtain ⟨k, hk⟩ := (rootSpace H 0).isNilpotent_iff_exists_self_le_ucs.mp (by 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
⊢ LieModule.IsNilpotent R ↥H ↥↑(rootSpace H 0)

Next tactic:
infer_instance
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
  suffices rootSpace H 0 ≤ H.toLieSubmodule by exact fun x hx => this hx
  obtain ⟨k, hk⟩ := (rootSpace H 0).isNilpotent_iff_exists_self_le_ucs.mp (by infer_instance)
  

Proof state:
case intro
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
k : ℕ
hk : rootSpace H 0 ≤ LieSubmodule.ucs k ⊥
⊢ rootSpace H 0 ≤ LieSubalgebra.toLieSubmodule H

Next tactic:
exact hk.trans (LieSubmodule.ucs_le_of_normalizer_eq_self (by simp) k)
@[simp]
theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
  suffices rootSpace H 0 ≤ H.toLieSubmodule by exact fun x hx => this hx
  obtain ⟨k, hk⟩ := (rootSpace H 0).isNilpotent_iff_exists_self_le_ucs.mp (by infer_instance)
  exact hk.trans (LieSubmodule.ucs_le_of_normalizer_eq_self (by 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
k : ℕ
hk : rootSpace H 0 ≤ LieSubmodule.ucs k ⊥
⊢ LieSubmodule.normalizer (LieSubalgebra.toLieSubmodule H) = LieSubalgebra.toLieSubmodule H

Next tactic:
simp
theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
    zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra :=
  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
H : LieSubalgebra R L
inst✝⁵ : IsNilpotent R ↥H
M : Type u_3
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : IsNoetherian R L
⊢ LieSubalgebra.IsCartanSubalgebra H → zeroRootSubalgebra R L H = H

Next tactic:
intros
theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
    zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra :=
  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by intros; 

Proof state:
R : Type u_1
L : Type u_2
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
H : LieSubalgebra R L
inst✝⁵ : IsNilpotent R ↥H
M : Type u_3
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : IsNoetherian R L
a✝ : LieSubalgebra.IsCartanSubalgebra H
⊢ zeroRootSubalgebra R L H = H

Next tactic:
simp
@[simp]
theorem rootSpace_zero_eq (H : LieSubalgebra R L) [H.IsCartanSubalgebra] [IsNoetherian R L] :
    rootSpace H 0 = H.toLieSubmodule := by
  

Proof state:
R : Type u_1
L : Type u_2
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
H✝ : LieSubalgebra R L
inst✝⁶ : IsNilpotent R ↥H✝
M : Type u_3
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : LieRingModule L M
inst✝² : LieModule R L M
H : LieSubalgebra R L
inst✝¹ : LieSubalgebra.IsCartanSubalgebra H
inst✝ : IsNoetherian R L
⊢ rootSpace H 0 = LieSubalgebra.toLieSubmodule H

Next tactic:
rw [← LieSubmodule.coe_toSubmodule_eq_iff, ← coe_zeroRootSubalgebra,
    zeroRootSubalgebra_eq_of_is_cartan R L H, LieSubalgebra.coe_toLieSubmodule]
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ IsSemiringHom _root_.id

Next tactic:
refine' { .. }
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ _root_.id 0 = 0

Next tactic:
intros
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_2
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ _root_.id 1 = 1

Next tactic:
intros
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_3
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ ∀ (x y : α), _root_.id (x + y) = _root_.id x + _root_.id y

Next tactic:
intros
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_4
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ ∀ (x y : α), _root_.id (x * y) = _root_.id x * _root_.id y

Next tactic:
intros
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ _root_.id 0 = 0

Next tactic:
rfl
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_2
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y : α
⊢ _root_.id 1 = 1

Next tactic:
rfl
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_3
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y x✝ y✝ : α
⊢ _root_.id (x✝ + y✝) = _root_.id x✝ + _root_.id y✝

Next tactic:
rfl
/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_4
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf : IsSemiringHom f
x y x✝ y✝ : α
⊢ _root_.id (x✝ * y✝) = _root_.id x✝ * _root_.id y✝

Next tactic:
rfl
/-- The composition of two semiring homomorphisms is a semiring homomorphism. -/
theorem comp (hf : IsSemiringHom f) {γ} [Semiring γ] {g : β → γ} (hg : IsSemiringHom g) :
    IsSemiringHom (g ∘ f) :=
  { map_zero := by 

Proof state:
α : Type u
β : Type v
inst✝² : Semiring α
inst✝¹ : Semiring β
f : α → β
hf✝ : IsSemiringHom f
x y : α
hf : IsSemiringHom f
γ : Type u_1
inst✝ : Semiring γ
g : β → γ
hg : IsSemiringHom g
⊢ (g ∘ f) 0 = 0

Next tactic:
simpa [map_zero hf] using map_zero hg
/-- The composition of two semiring homomorphisms is a semiring homomorphism. -/
theorem comp (hf : IsSemiringHom f) {γ} [Semiring γ] {g : β → γ} (hg : IsSemiringHom g) :
    IsSemiringHom (g ∘ f) :=
  { map_zero := by simpa [map_zero hf] using map_zero hg
    map_one := by 

Proof state:
α : Type u
β : Type v
inst✝² : Semiring α
inst✝¹ : Semiring β
f : α → β
hf✝ : IsSemiringHom f
x y : α
hf : IsSemiringHom f
γ : Type u_1
inst✝ : Semiring γ
g : β → γ
hg : IsSemiringHom g
⊢ (g ∘ f) 1 = 1

Next tactic:
simpa [map_one hf] using map_one hg
/-- The composition of two semiring homomorphisms is a semiring homomorphism. -/
theorem comp (hf : IsSemiringHom f) {γ} [Semiring γ] {g : β → γ} (hg : IsSemiringHom g) :
    IsSemiringHom (g ∘ f) :=
  { map_zero := by simpa [map_zero hf] using map_zero hg
    map_one := by simpa [map_one hf] using map_one hg
    map_add := fun {x y} => by 

Proof state:
α : Type u
β : Type v
inst✝² : Semiring α
inst✝¹ : Semiring β
f : α → β
hf✝ : IsSemiringHom f
x✝ y✝ : α
hf : IsSemiringHom f
γ : Type u_1
inst✝ : Semiring γ
g : β → γ
hg : IsSemiringHom g
x y : α
⊢ (g ∘ f) (x + y) = (g ∘ f) x + (g ∘ f) y

Next tactic:
simp [map_add hf, map_add hg]
/-- The composition of two semiring homomorphisms is a semiring homomorphism. -/
theorem comp (hf : IsSemiringHom f) {γ} [Semiring γ] {g : β → γ} (hg : IsSemiringHom g) :
    IsSemiringHom (g ∘ f) :=
  { map_zero := by simpa [map_zero hf] using map_zero hg
    map_one := by simpa [map_one hf] using map_one hg
    map_add := fun {x y} => by simp [map_add hf, map_add hg]
    map_mul := fun {x y} => by 

Proof state:
α : Type u
β : Type v
inst✝² : Semiring α
inst✝¹ : Semiring β
f : α → β
hf✝ : IsSemiringHom f
x✝ y✝ : α
hf : IsSemiringHom f
γ : Type u_1
inst✝ : Semiring γ
g : β → γ
hg : IsSemiringHom g
x y : α
⊢ (g ∘ f) (x * y) = (g ∘ f) x * (g ∘ f) y

Next tactic:
simp [map_mul hf, map_mul hg]
/-- A semiring homomorphism is an additive monoid homomorphism. -/
theorem to_isAddMonoidHom (hf : IsSemiringHom f) : IsAddMonoidHom f :=
  { ‹IsSemiringHom f› with map_add := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Semiring α
inst✝ : Semiring β
f : α → β
hf✝ : IsSemiringHom f
x y : α
hf : IsSemiringHom f
src✝ : IsSemiringHom f := hf
⊢ ∀ (x y : α), f (x + y) = f x + f y

Next tactic:
apply @‹IsSemiringHom f›.map_add
/-- Ring homomorphisms map zero to zero. -/
theorem map_zero (hf : IsRingHom f) : f 0 = 0 :=
  calc
    f 0 = f (0 + 0) - f 0 := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f 0 = f (0 + 0) - f 0

Next tactic:
rw [hf.map_add]
/-- Ring homomorphisms map zero to zero. -/
theorem map_zero (hf : IsRingHom f) : f 0 = 0 :=
  calc
    f 0 = f (0 + 0) - f 0 := by rw [hf.map_add]; 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f 0 = f 0 + f 0 - f 0

Next tactic:
simp
/-- Ring homomorphisms map zero to zero. -/
theorem map_zero (hf : IsRingHom f) : f 0 = 0 :=
  calc
    f 0 = f (0 + 0) - f 0 := by rw [hf.map_add]; simp
    _ = 0 := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f (0 + 0) - f 0 = 0

Next tactic:
simp
/-- Ring homomorphisms preserve additive inverses. -/
theorem map_neg (hf : IsRingHom f) : f (-x) = -f x :=
  calc
    f (-x) = f (-x + x) - f x := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f (-x) = f (-x + x) - f x

Next tactic:
rw [hf.map_add]
/-- Ring homomorphisms preserve additive inverses. -/
theorem map_neg (hf : IsRingHom f) : f (-x) = -f x :=
  calc
    f (-x) = f (-x + x) - f x := by rw [hf.map_add]; 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f (-x) = f (-x) + f x - f x

Next tactic:
simp
/-- Ring homomorphisms preserve additive inverses. -/
theorem map_neg (hf : IsRingHom f) : f (-x) = -f x :=
  calc
    f (-x) = f (-x + x) - f x := by rw [hf.map_add]; simp
    _ = -f x := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f (-x + x) - f x = -f x

Next tactic:
simp [hf.map_zero]
/-- Ring homomorphisms preserve subtraction. -/
theorem map_sub (hf : IsRingHom f) : f (x - y) = f x - f y := by
  

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
⊢ f (x - y) = f x - f y

Next tactic:
simp [sub_eq_add_neg, hf.map_add, hf.map_neg]
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by 

Proof state:
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y : α
⊢ IsRingHom _root_.id

Next tactic:
refine' { .. }
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y : α
⊢ _root_.id 1 = 1

Next tactic:
intros
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_2
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y : α
⊢ ∀ (x y : α), _root_.id (x * y) = _root_.id x * _root_.id y

Next tactic:
intros
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by refine' { .. } <;> 

Proof state:
case refine'_3
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y : α
⊢ ∀ (x y : α), _root_.id (x + y) = _root_.id x + _root_.id y

Next tactic:
intros
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_1
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y : α
⊢ _root_.id 1 = 1

Next tactic:
rfl
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_2
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y x✝ y✝ : α
⊢ _root_.id (x✝ * y✝) = _root_.id x✝ * _root_.id y✝

Next tactic:
rfl
/-- The identity map is a ring homomorphism. -/
theorem id : IsRingHom (@id α) := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_3
α : Type u
β : Type v
inst✝¹ : Ring α
inst✝ : Ring β
f : α → β
hf : IsRingHom f
x y x✝ y✝ : α
⊢ _root_.id (x✝ + y✝) = _root_.id x✝ + _root_.id y✝

Next tactic:
rfl
/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f) :=
  { map_add := fun x y => by simp [map_add hf]; rw [map_add hg]
    map_mul := fun x y => by simp [map_mul hf]; rw [map_mul hg]
    map_one := by 

Proof state:
α : Type u
β : Type v
inst✝² : Ring α
inst✝¹ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
γ : Type u_1
inst✝ : Ring γ
g : β → γ
hg : IsRingHom g
⊢ (g ∘ f) 1 = 1

Next tactic:
simp [map_one hf]
/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f) :=
  { map_add := fun x y => by simp [map_add hf]; rw [map_add hg]
    map_mul := fun x y => by simp [map_mul hf]; rw [map_mul hg]
    map_one := by simp [map_one hf]; 

Proof state:
α : Type u
β : Type v
inst✝² : Ring α
inst✝¹ : Ring β
f : α → β
hf✝ : IsRingHom f
x y : α
hf : IsRingHom f
γ : Type u_1
inst✝ : Ring γ
g : β → γ
hg : IsRingHom g
⊢ g 1 = 1

Next tactic:
exact map_one hg
/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f) :=
  { map_add := fun x y => by simp [map_add hf]; rw [map_add hg]
    map_mul := fun x y => by 

Proof state:
α : Type u
β : Type v
inst✝² : Ring α
inst✝¹ : Ring β
f : α → β
hf✝ : IsRingHom f
x✝ y✝ : α
hf : IsRingHom f
γ : Type u_1
inst✝ : Ring γ
g : β → γ
hg : IsRingHom g
x y : α
⊢ (g ∘ f) (x * y) = (g ∘ f) x * (g ∘ f) y

Next tactic:
simp [map_mul hf]
/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f) :=
  { map_add := fun x y => by simp [map_add hf]; rw [map_add hg]
    map_mul := fun x y => by simp [map_mul hf]; 

Proof state:
α : Type u
β : Type v
inst✝² : Ring α
inst✝¹ : Ring β
f : α → β
hf✝ : IsRingHom f
x✝ y✝ : α
hf : IsRingHom f
γ : Type u_1
inst✝ : Ring γ
g : β → γ
hg : IsRingHom g
x y : α
⊢ g (f x * f y) = g (f x) * g (f y)

Next tactic:
rw [map_mul hg]
/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f) :=
  { map_add := fun x y => by 

Proof state:
α : Type u
β : Type v
inst✝² : Ring α
inst✝¹ : Ring β
f : α → β
hf✝ : IsRingHom f
x✝ y✝ : α
hf : IsRingHom f
γ : Type u_1
inst✝ : Ring γ
g : β → γ
hg : IsRingHom g
x y : α
⊢ (g ∘ f) (x + y) = (g ∘ f) x + (g ∘ f) y

Next tactic:
simp [map_add hf]
/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f) :=
  { map_add := fun x y => by simp [map_add hf]; 

Proof state:
α : Type u
β : Type v
inst✝² : Ring α
inst✝¹ : Ring β
f : α → β
hf✝ : IsRingHom f
x✝ y✝ : α
hf : IsRingHom f
γ : Type u_1
inst✝ : Ring γ
g : β → γ
hg : IsRingHom g
x y : α
⊢ g (f x + f y) = g (f x) + g (f y)

Next tactic:
rw [map_add hg]
/-- Duplicate of `Eq.subset'`, which currently has elaboration problems. -/
theorem Eq.subset {α} {s t : Set α} : s = t → s ⊆ t :=
  fun h₁ _ h₂ => by 

Proof state:
α : Type u_1
s t : Set α
h₁ : s = t
x✝ : α
h₂ : x✝ ∈ s
⊢ x✝ ∈ t

Next tactic:
rw [← h₁]
/-- Duplicate of `Eq.subset'`, which currently has elaboration problems. -/
theorem Eq.subset {α} {s t : Set α} : s = t → s ⊆ t :=
  fun h₁ _ h₂ => by rw [← h₁]; 

Proof state:
α : Type u_1
s t : Set α
h₁ : s = t
x✝ : α
h₂ : x✝ ∈ s
⊢ x✝ ∈ s

Next tactic:
exact h₂
theorem ext_iff {s t : Set α} : s = t ↔ ∀ x, x ∈ s ↔ x ∈ t :=
  ⟨fun h x => by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t✝ t₁ t₂ u s t : Set α
h : s = t
x : α
⊢ x ∈ s ↔ x ∈ t

Next tactic:
rw [h]
theorem forall_in_swap {p : α → β → Prop} : (∀ a ∈ s, ∀ (b), p a b) ↔ ∀ (b), ∀ a ∈ s, p a b := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
p : α → β → Prop
⊢ (∀ a ∈ s, ∀ (b : β), p a b) ↔ ∀ (b : β), ∀ a ∈ s, p a b

Next tactic:
tauto
instance : IsRefl (Set α) (· ⊆ ·) :=
  show IsRefl (Set α) (· ≤ ·) by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ IsRefl (Set α) fun x x_1 => x ≤ x_1

Next tactic:
infer_instance