l3lab/ntp-mathlib huggingface dataset:
theorem injective_or_eq_zero [IsSimpleModule R M] (f : M →ₗ[R] N) :
    Function.Injective f ∨ f = 0 := by
  

Proof state:
R : Type u_1
inst✝⁵ : Ring R
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
m : Submodule R M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsSimpleModule R M
f : M →ₗ[R] N
⊢ Function.Injective ⇑f ∨ f = 0

Next tactic:
rw [← ker_eq_bot, ← ker_eq_top]
theorem injective_or_eq_zero [IsSimpleModule R M] (f : M →ₗ[R] N) :
    Function.Injective f ∨ f = 0 := by
  rw [← ker_eq_bot, ← ker_eq_top]
  

Proof state:
R : Type u_1
inst✝⁵ : Ring R
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
m : Submodule R M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsSimpleModule R M
f : M →ₗ[R] N
⊢ ker f = ⊥ ∨ ker f = ⊤

Next tactic:
apply eq_bot_or_eq_top
theorem surjective_or_eq_zero [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Surjective f ∨ f = 0 := by
  

Proof state:
R : Type u_1
inst✝⁵ : Ring R
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
m : Submodule R M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
⊢ Function.Surjective ⇑f ∨ f = 0

Next tactic:
rw [← range_eq_top, ← range_eq_bot, or_comm]
theorem surjective_or_eq_zero [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Surjective f ∨ f = 0 := by
  rw [← range_eq_top, ← range_eq_bot, or_comm]
  

Proof state:
R : Type u_1
inst✝⁵ : Ring R
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
m : Submodule R M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
⊢ range f = ⊥ ∨ range f = ⊤

Next tactic:
apply eq_bot_or_eq_top
/-- **Schur's Lemma** for linear maps between (possibly distinct) simple modules -/
theorem bijective_or_eq_zero [IsSimpleModule R M] [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Bijective f ∨ f = 0 := by
  

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : IsSimpleModule R M
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
⊢ Function.Bijective ⇑f ∨ f = 0

Next tactic:
by_cases h : f = 0
/-- **Schur's Lemma** for linear maps between (possibly distinct) simple modules -/
theorem bijective_or_eq_zero [IsSimpleModule R M] [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Bijective f ∨ f = 0 := by
  by_cases h : f = 0
  · 

Proof state:
case pos
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : IsSimpleModule R M
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
h : f = 0
⊢ Function.Bijective ⇑f ∨ f = 0

Next tactic:
right
/-- **Schur's Lemma** for linear maps between (possibly distinct) simple modules -/
theorem bijective_or_eq_zero [IsSimpleModule R M] [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Bijective f ∨ f = 0 := by
  by_cases h : f = 0
  · right
    

Proof state:
case pos.h
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : IsSimpleModule R M
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
h : f = 0
⊢ f = 0

Next tactic:
exact h
/-- **Schur's Lemma** for linear maps between (possibly distinct) simple modules -/
theorem bijective_or_eq_zero [IsSimpleModule R M] [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Bijective f ∨ f = 0 := by
  by_cases h : f = 0
  · right
    exact h
  

Proof state:
case neg
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : IsSimpleModule R M
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
h : ¬f = 0
⊢ Function.Bijective ⇑f ∨ f = 0

Next tactic:
exact Or.intro_left _ ⟨injective_of_ne_zero h, surjective_of_ne_zero h⟩
theorem isCoatom_ker_of_surjective [IsSimpleModule R N] {f : M →ₗ[R] N}
    (hf : Function.Surjective f) : IsCoatom (LinearMap.ker f) := by
  

Proof state:
R : Type u_1
inst✝⁵ : Ring R
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
m : Submodule R M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
hf : Function.Surjective ⇑f
⊢ IsCoatom (ker f)

Next tactic:
rw [← isSimpleModule_iff_isCoatom]
theorem isCoatom_ker_of_surjective [IsSimpleModule R N] {f : M →ₗ[R] N}
    (hf : Function.Surjective f) : IsCoatom (LinearMap.ker f) := by
  rw [← isSimpleModule_iff_isCoatom]
  

Proof state:
R : Type u_1
inst✝⁵ : Ring R
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
m : Submodule R M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsSimpleModule R N
f : M →ₗ[R] N
hf : Function.Surjective ⇑f
⊢ IsSimpleModule R (M ⧸ ker f)

Next tactic:
exact IsSimpleModule.congr (f.quotKerEquivOfSurjective hf)
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
⊢ 0 ≠ 1

Next tactic:
haveI := IsSimpleModule.nontrivial R M
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
this : Nontrivial M
⊢ 0 ≠ 1

Next tactic:
have h := exists_pair_ne M
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
this : Nontrivial M
h : ∃ x y, x ≠ y
⊢ 0 ≠ 1

Next tactic:
contrapose! h
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
this : Nontrivial M
h : 0 = 1
⊢ ∀ (x y : M), x = y

Next tactic:
intro x y
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
this : Nontrivial M
h : 0 = 1
x y : M
⊢ x = y

Next tactic:
simp_rw [ext_iff, one_apply, zero_apply] at h
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        simp_rw [ext_iff, one_apply, zero_apply] at h
        

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
this : Nontrivial M
x y : M
h : ∀ (x : M), 0 = x
⊢ x = y

Next tactic:
rw [← h x, h y]
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        simp_rw [ext_iff, one_apply, zero_apply] at h
        rw [← h x, h y]⟩
    mul_inv_cancel := by
      

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
⊢ ∀ (a : Module.End R M), a ≠ 0 → a * a⁻¹ = 1

Next tactic:
intro a a0
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        simp_rw [ext_iff, one_apply, zero_apply] at h
        rw [← h x, h y]⟩
    mul_inv_cancel := by
      intro a a0
      

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
a : Module.End R M
a0 : a ≠ 0
⊢ a * a⁻¹ = 1

Next tactic:
change a * dite _ _ _ = 1
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        simp_rw [ext_iff, one_apply, zero_apply] at h
        rw [← h x, h y]⟩
    mul_inv_cancel := by
      intro a a0
      change a * dite _ _ _ = 1
      

Proof state:
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
a : Module.End R M
a0 : a ≠ 0
⊢ (a *
      if h : a = 0 then 0
      else
        inverse a (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
          (_ :
            Function.LeftInverse (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
              (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).toFun)
          (_ :
            Function.RightInverse (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
              (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).toFun)) =
    1

Next tactic:
ext x
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        simp_rw [ext_iff, one_apply, zero_apply] at h
        rw [← h x, h y]⟩
    mul_inv_cancel := by
      intro a a0
      change a * dite _ _ _ = 1
      ext x
      

Proof state:
case h
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
a : Module.End R M
a0 : a ≠ 0
x : M
⊢ (a *
        if h : a = 0 then 0
        else
          inverse a (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
            (_ :
              Function.LeftInverse (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
                (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).toFun)
            (_ :
              Function.RightInverse (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
                (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).toFun))
      x =
    1 x

Next tactic:
rw [dif_neg a0, mul_eq_comp, one_apply, comp_apply]
/-- Schur's Lemma makes the endomorphism ring of a simple module a division ring. -/
noncomputable instance _root_.Module.End.divisionRing
    [DecidableEq (Module.End R M)] [IsSimpleModule R M] : DivisionRing (Module.End R M) :=
  {
    (Module.End.ring :
      Ring
        (Module.End R
          M)) with
    inv := fun f =>
      if h : f = 0 then 0
      else
        LinearMap.inverse f (Equiv.ofBijective _ (bijective_of_ne_zero h)).invFun
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).left_inv
          (Equiv.ofBijective _ (bijective_of_ne_zero h)).right_inv
    exists_pair_ne :=
      ⟨0, 1, by
        haveI := IsSimpleModule.nontrivial R M
        have h := exists_pair_ne M
        contrapose! h
        intro x y
        simp_rw [ext_iff, one_apply, zero_apply] at h
        rw [← h x, h y]⟩
    mul_inv_cancel := by
      intro a a0
      change a * dite _ _ _ = 1
      ext x
      rw [dif_neg a0, mul_eq_comp, one_apply, comp_apply]
      

Proof state:
case h
R : Type u_1
inst✝⁶ : Ring R
M : Type u_2
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
m : Submodule R M
N : Type u_3
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : DecidableEq (Module.End R M)
inst✝ : IsSimpleModule R M
src✝ : Ring (Module.End R M) := Module.End.ring
a : Module.End R M
a0 : a ≠ 0
x : M
⊢ a
      ((inverse a (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
          (_ :
            Function.LeftInverse (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
              (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).toFun)
          (_ :
            Function.RightInverse (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).invFun
              (Equiv.ofBijective ⇑a (_ : Function.Bijective ⇑a)).toFun))
        x) =
    x

Next tactic:
exact (Equiv.ofBijective _ (bijective_of_ne_zero a0)).right_inv x
@[nolint unusedArguments]
theorem second_iso {X Y : Submodule R M} (_ : X ⋖ X ⊔ Y) :
    Iso (X,X ⊔ Y) (X ⊓ Y,Y) := by
  

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
m : Submodule R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
X Y : Submodule R M
x✝ : X ⋖ X ⊔ Y
⊢ Iso (X, X ⊔ Y) (X ⊓ Y, Y)

Next tactic:
constructor
@[nolint unusedArguments]
theorem second_iso {X Y : Submodule R M} (_ : X ⋖ X ⊔ Y) :
    Iso (X,X ⊔ Y) (X ⊓ Y,Y) := by
  constructor
  

Proof state:
case val
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
m : Submodule R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
X Y : Submodule R M
x✝ : X ⋖ X ⊔ Y
⊢ (↥(X, X ⊔ Y).2 ⧸ Submodule.comap (Submodule.subtype (X, X ⊔ Y).2) (X, X ⊔ Y).1) ≃ₗ[R]
    ↥(X ⊓ Y, Y).2 ⧸ Submodule.comap (Submodule.subtype (X ⊓ Y, Y).2) (X ⊓ Y, Y).1

Next tactic:
rw [sup_comm, inf_comm]
@[nolint unusedArguments]
theorem second_iso {X Y : Submodule R M} (_ : X ⋖ X ⊔ Y) :
    Iso (X,X ⊔ Y) (X ⊓ Y,Y) := by
  constructor
  rw [sup_comm, inf_comm]
  

Proof state:
case val
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
m : Submodule R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
X Y : Submodule R M
x✝ : X ⋖ X ⊔ Y
⊢ (↥(X, Y ⊔ X).2 ⧸ Submodule.comap (Submodule.subtype (X, Y ⊔ X).2) (X, Y ⊔ X).1) ≃ₗ[R]
    ↥(Y ⊓ X, Y).2 ⧸ Submodule.comap (Submodule.subtype (Y ⊓ X, Y).2) (Y ⊓ X, Y).1

Next tactic:
dsimp
@[nolint unusedArguments]
theorem second_iso {X Y : Submodule R M} (_ : X ⋖ X ⊔ Y) :
    Iso (X,X ⊔ Y) (X ⊓ Y,Y) := by
  constructor
  rw [sup_comm, inf_comm]
  dsimp
  

Proof state:
case val
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
m : Submodule R M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
X Y : Submodule R M
x✝ : X ⋖ X ⊔ Y
⊢ (↥(Y ⊔ X) ⧸ Submodule.comap (Submodule.subtype (Y ⊔ X)) X) ≃ₗ[R]
    ↥Y ⧸ Submodule.comap (Submodule.subtype Y) Y ⊓ Submodule.comap (Submodule.subtype Y) X

Next tactic:
exact (LinearMap.quotientInfEquivSupQuotient Y X).symm
instance [Finite α] : Finite (Additive α) :=
  Finite.of_equiv α (by 

Proof state:
α : Type u
β : Type v
inst✝ : Finite α
⊢ α ≃ Additive α

Next tactic:
rfl
instance [Finite α] : Finite (Multiplicative α) :=
  Finite.of_equiv α (by 

Proof state:
α : Type u
β : Type v
inst✝ : Finite α
⊢ α ≃ Multiplicative α

Next tactic:
rfl
protected theorem ext_iff : f = g ↔ ∀ s, s ∈ f ↔ s ∈ g := by
  

Proof state:
α : Type u
f g : Filter α
s t : Set α
⊢ f = g ↔ ∀ (s : Set α), s ∈ f ↔ s ∈ g

Next tactic:
simp only [filter_eq_iff, ext_iff, Filter.mem_sets]
@[simp]
theorem biInter_mem {β : Type v} {s : β → Set α} {is : Set β} (hf : is.Finite) :
    (⋂ i ∈ is, s i) ∈ f ↔ ∀ i ∈ is, s i ∈ f :=
  Finite.induction_on hf (by 

Proof state:
α : Type u
f g : Filter α
s✝ t : Set α
β : Type v
s : β → Set α
is : Set β
hf : Set.Finite is
⊢ ⋂ i ∈ ∅, s i ∈ f ↔ ∀ i ∈ ∅, s i ∈ f

Next tactic:
simp
@[simp]
theorem biInter_mem {β : Type v} {s : β → Set α} {is : Set β} (hf : is.Finite) :
    (⋂ i ∈ is, s i) ∈ f ↔ ∀ i ∈ is, s i ∈ f :=
  Finite.induction_on hf (by simp) fun _ _ hs => by 

Proof state:
α : Type u
f g : Filter α
s✝¹ t : Set α
β : Type v
s : β → Set α
is : Set β
hf : Set.Finite is
a✝ : β
s✝ : Set β
x✝¹ : a✝ ∉ s✝
x✝ : Set.Finite s✝
hs : ⋂ i ∈ s✝, s i ∈ f ↔ ∀ i ∈ s✝, s i ∈ f
⊢ ⋂ i ∈ insert a✝ s✝, s i ∈ f ↔ ∀ i ∈ insert a✝ s✝, s i ∈ f

Next tactic:
simp [hs]
@[simp]
theorem sInter_mem {s : Set (Set α)} (hfin : s.Finite) : ⋂₀ s ∈ f ↔ ∀ U ∈ s, U ∈ f := by
  

Proof state:
α : Type u
f g : Filter α
s✝ t : Set α
s : Set (Set α)
hfin : Set.Finite s
⊢ ⋂₀ s ∈ f ↔ ∀ U ∈ s, U ∈ f

Next tactic:
rw [sInter_eq_biInter, biInter_mem hfin]
theorem exists_mem_and_iff {P : Set α → Prop} {Q : Set α → Prop} (hP : Antitone P)
    (hQ : Antitone Q) : ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) ↔ ∃ u ∈ f, P u ∧ Q u := by
  

Proof state:
α : Type u
f g : Filter α
s t : Set α
P Q : Set α → Prop
hP : Antitone P
hQ : Antitone Q
⊢ ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) ↔ ∃ u ∈ f, P u ∧ Q u

Next tactic:
constructor
theorem exists_mem_and_iff {P : Set α → Prop} {Q : Set α → Prop} (hP : Antitone P)
    (hQ : Antitone Q) : ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) ↔ ∃ u ∈ f, P u ∧ Q u := by
  constructor
  · 

Proof state:
case mp
α : Type u
f g : Filter α
s t : Set α
P Q : Set α → Prop
hP : Antitone P
hQ : Antitone Q
⊢ ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) → ∃ u ∈ f, P u ∧ Q u

Next tactic:
rintro ⟨⟨u, huf, hPu⟩, v, hvf, hQv⟩
theorem exists_mem_and_iff {P : Set α → Prop} {Q : Set α → Prop} (hP : Antitone P)
    (hQ : Antitone Q) : ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) ↔ ∃ u ∈ f, P u ∧ Q u := by
  constructor
  · rintro ⟨⟨u, huf, hPu⟩, v, hvf, hQv⟩
    

Proof state:
case mp.intro.intro.intro.intro.intro
α : Type u
f g : Filter α
s t : Set α
P Q : Set α → Prop
hP : Antitone P
hQ : Antitone Q
u : Set α
huf : u ∈ f
hPu : P u
v : Set α
hvf : v ∈ f
hQv : Q v
⊢ ∃ u ∈ f, P u ∧ Q u

Next tactic:
exact
      ⟨u ∩ v, inter_mem huf hvf, hP (inter_subset_left _ _) hPu, hQ (inter_subset_right _ _) hQv⟩