l3lab/ntp-mathlib huggingface dataset:
theorem nonpos : ¬0 < G := fun h => by
  have h' := neg_lt_neg_iff.2 h
  rw [neg_zero, lt_congr_left (Equiv.symm (neg_equiv_self G))] at h'
  

Proof state:
G : PGame
inst✝ : Impartial G
h : 0 < G
h' : G < 0
⊢ False

Next tactic:
exact (h.trans h').false
theorem nonneg : ¬G < 0 := fun h => by
  

Proof state:
G : PGame
inst✝ : Impartial G
h : G < 0
⊢ False

Next tactic:
have h' := neg_lt_neg_iff.2 h
theorem nonneg : ¬G < 0 := fun h => by
  have h' := neg_lt_neg_iff.2 h
  

Proof state:
G : PGame
inst✝ : Impartial G
h : G < 0
h' : -0 < -G
⊢ False

Next tactic:
rw [neg_zero, lt_congr_right (Equiv.symm (neg_equiv_self G))] at h'
theorem nonneg : ¬G < 0 := fun h => by
  have h' := neg_lt_neg_iff.2 h
  rw [neg_zero, lt_congr_right (Equiv.symm (neg_equiv_self G))] at h'
  

Proof state:
G : PGame
inst✝ : Impartial G
h : G < 0
h' : 0 < G
⊢ False

Next tactic:
exact (h.trans h').false
/-- In an impartial game, either the first player always wins, or the second player always wins. -/
theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
  

Proof state:
G : PGame
inst✝ : Impartial G
⊢ G ≈ 0 ∨ G ‖ 0

Next tactic:
rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h)
/-- In an impartial game, either the first player always wins, or the second player always wins. -/
theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
  rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h)
  · 

Proof state:
case inl
G : PGame
inst✝ : Impartial G
h : G < 0
⊢ G ≈ 0 ∨ G ‖ 0

Next tactic:
exact ((nonneg G) h).elim
/-- In an impartial game, either the first player always wins, or the second player always wins. -/
theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
  rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h)
  · exact ((nonneg G) h).elim
  · 

Proof state:
case inr.inl
G : PGame
inst✝ : Impartial G
h : G ≈ 0
⊢ G ≈ 0 ∨ G ‖ 0

Next tactic:
exact Or.inl h
/-- In an impartial game, either the first player always wins, or the second player always wins. -/
theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
  rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h)
  · exact ((nonneg G) h).elim
  · exact Or.inl h
  · 

Proof state:
case inr.inr.inl
G : PGame
inst✝ : Impartial G
h : 0 < G
⊢ G ≈ 0 ∨ G ‖ 0

Next tactic:
exact ((nonpos G) h).elim
/-- In an impartial game, either the first player always wins, or the second player always wins. -/
theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0 := by
  rcases lt_or_equiv_or_gt_or_fuzzy G 0 with (h | h | h | h)
  · exact ((nonneg G) h).elim
  · exact Or.inl h
  · exact ((nonpos G) h).elim
  · 

Proof state:
case inr.inr.inr
G : PGame
inst✝ : Impartial G
h : G ‖ 0
⊢ G ≈ 0 ∨ G ‖ 0

Next tactic:
exact Or.inr h
/-- This lemma doesn't require `H` to be impartial. -/
theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) := by
  

Proof state:
G : PGame
inst✝ : Impartial G
H : PGame
⊢ H ≈ G ↔ H + G ≈ 0

Next tactic:
rw [Game.PGame.equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ ⟦G⟧, mk'_add_self, ← quot_add,
    Game.PGame.equiv_iff_game_eq]
/-- This lemma doesn't require `H` to be impartial. -/
theorem equiv_iff_add_equiv_zero (H : PGame) : (H ≈ G) ↔ (H + G ≈ 0) := by
  rw [Game.PGame.equiv_iff_game_eq, ← @add_right_cancel_iff _ _ _ ⟦G⟧, mk'_add_self, ← quot_add,
    Game.PGame.equiv_iff_game_eq]
  

Proof state:
G : PGame
inst✝ : Impartial G
H : PGame
⊢ ⟦H + G⟧ = 0 ↔ ⟦H + G⟧ = ⟦0⟧

Next tactic:
rfl
/-- This lemma doesn't require `H` to be impartial. -/
theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) := by
  

Proof state:
G : PGame
inst✝ : Impartial G
H : PGame
⊢ G ≈ H ↔ G + H ≈ 0

Next tactic:
rw [Game.PGame.equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ ⟦G⟧, mk'_add_self, ← quot_add,
    Game.PGame.equiv_iff_game_eq]
/-- This lemma doesn't require `H` to be impartial. -/
theorem equiv_iff_add_equiv_zero' (H : PGame) : (G ≈ H) ↔ (G + H ≈ 0) := by
  rw [Game.PGame.equiv_iff_game_eq, ← @add_left_cancel_iff _ _ _ ⟦G⟧, mk'_add_self, ← quot_add,
    Game.PGame.equiv_iff_game_eq]
  

Proof state:
G : PGame
inst✝ : Impartial G
H : PGame
⊢ 0 = ⟦G + H⟧ ↔ ⟦G + H⟧ = ⟦0⟧

Next tactic:
exact ⟨Eq.symm, Eq.symm⟩
theorem le_zero_iff {G : PGame} [G.Impartial] : G ≤ 0 ↔ 0 ≤ G := by
  

Proof state:
G✝ : PGame
inst✝¹ : Impartial G✝
G : PGame
inst✝ : Impartial G
⊢ G ≤ 0 ↔ 0 ≤ G

Next tactic:
rw [← zero_le_neg_iff, le_congr_right (neg_equiv_self G)]
theorem lf_zero_iff {G : PGame} [G.Impartial] : G ⧏ 0 ↔ 0 ⧏ G := by
  

Proof state:
G✝ : PGame
inst✝¹ : Impartial G✝
G : PGame
inst✝ : Impartial G
⊢ G ⧏ 0 ↔ 0 ⧏ G

Next tactic:
rw [← zero_lf_neg_iff, lf_congr_right (neg_equiv_self G)]
theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) := by
  

Proof state:
G : PGame
inst✝ : Impartial G
⊢ (∀ (i : LeftMoves G), moveLeft G i ‖ 0) ↔ G ≈ 0

Next tactic:
refine' ⟨fun hb => _, fun hp i => _⟩
theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · 

Proof state:
case refine'_1
G : PGame
inst✝ : Impartial G
hb : ∀ (i : LeftMoves G), moveLeft G i ‖ 0
⊢ G ≈ 0

Next tactic:
rw [equiv_zero_iff_le G, le_zero_lf]
theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · rw [equiv_zero_iff_le G, le_zero_lf]
    

Proof state:
case refine'_1
G : PGame
inst✝ : Impartial G
hb : ∀ (i : LeftMoves G), moveLeft G i ‖ 0
⊢ ∀ (i : LeftMoves G), moveLeft G i ⧏ 0

Next tactic:
exact fun i => (hb i).1
theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · rw [equiv_zero_iff_le G, le_zero_lf]
    exact fun i => (hb i).1
  · 

Proof state:
case refine'_2
G : PGame
inst✝ : Impartial G
hp : G ≈ 0
i : LeftMoves G
⊢ moveLeft G i ‖ 0

Next tactic:
rw [fuzzy_zero_iff_lf]
theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · rw [equiv_zero_iff_le G, le_zero_lf]
    exact fun i => (hb i).1
  · rw [fuzzy_zero_iff_lf]
    

Proof state:
case refine'_2
G : PGame
inst✝ : Impartial G
hp : G ≈ 0
i : LeftMoves G
⊢ moveLeft G i ⧏ 0

Next tactic:
exact hp.1.moveLeft_lf i
theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) := by
  

Proof state:
G : PGame
inst✝ : Impartial G
⊢ (∀ (j : RightMoves G), moveRight G j ‖ 0) ↔ G ≈ 0

Next tactic:
refine' ⟨fun hb => _, fun hp i => _⟩
theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · 

Proof state:
case refine'_1
G : PGame
inst✝ : Impartial G
hb : ∀ (j : RightMoves G), moveRight G j ‖ 0
⊢ G ≈ 0

Next tactic:
rw [equiv_zero_iff_ge G, zero_le_lf]
theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · rw [equiv_zero_iff_ge G, zero_le_lf]
    

Proof state:
case refine'_1
G : PGame
inst✝ : Impartial G
hb : ∀ (j : RightMoves G), moveRight G j ‖ 0
⊢ ∀ (j : RightMoves G), 0 ⧏ moveRight G j

Next tactic:
exact fun i => (hb i).2
theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · rw [equiv_zero_iff_ge G, zero_le_lf]
    exact fun i => (hb i).2
  · 

Proof state:
case refine'_2
G : PGame
inst✝ : Impartial G
hp : G ≈ 0
i : RightMoves G
⊢ moveRight G i ‖ 0

Next tactic:
rw [fuzzy_zero_iff_gf]
theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0) := by
  refine' ⟨fun hb => _, fun hp i => _⟩
  · rw [equiv_zero_iff_ge G, zero_le_lf]
    exact fun i => (hb i).2
  · rw [fuzzy_zero_iff_gf]
    

Proof state:
case refine'_2
G : PGame
inst✝ : Impartial G
hp : G ≈ 0
i : RightMoves G
⊢ 0 ⧏ moveRight G i

Next tactic:
exact hp.2.lf_moveRight i
theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 := by
  

Proof state:
G : PGame
inst✝ : Impartial G
⊢ (∃ i, moveLeft G i ≈ 0) ↔ G ‖ 0

Next tactic:
refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_moveLeft hi.2), fun hn => _⟩
theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 := by
  refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_moveLeft hi.2), fun hn => _⟩
  

Proof state:
G : PGame
inst✝ : Impartial G
hn : G ‖ 0
⊢ ∃ i, moveLeft G i ≈ 0

Next tactic:
rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 := by
  refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_moveLeft hi.2), fun hn => _⟩
  rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
  

Proof state:
G : PGame
inst✝ : Impartial G
hn : ∃ i, 0 ≤ moveLeft G i
⊢ ∃ i, moveLeft G i ≈ 0

Next tactic:
cases' hn with i hi
theorem exists_left_move_equiv_iff_fuzzy_zero : (∃ i, G.moveLeft i ≈ 0) ↔ G ‖ 0 := by
  refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_gf G).2 (lf_of_le_moveLeft hi.2), fun hn => _⟩
  rw [fuzzy_zero_iff_gf G, zero_lf_le] at hn
  cases' hn with i hi
  

Proof state:
case intro
G : PGame
inst✝ : Impartial G
i : LeftMoves G
hi : 0 ≤ moveLeft G i
⊢ ∃ i, moveLeft G i ≈ 0

Next tactic:
exact ⟨i, (equiv_zero_iff_ge _).2 hi⟩
theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 := by
  

Proof state:
G : PGame
inst✝ : Impartial G
⊢ (∃ j, moveRight G j ≈ 0) ↔ G ‖ 0

Next tactic:
refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_moveRight_le hi.1), fun hn => _⟩
theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 := by
  refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_moveRight_le hi.1), fun hn => _⟩
  

Proof state:
G : PGame
inst✝ : Impartial G
hn : G ‖ 0
⊢ ∃ j, moveRight G j ≈ 0

Next tactic:
rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 := by
  refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_moveRight_le hi.1), fun hn => _⟩
  rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
  

Proof state:
G : PGame
inst✝ : Impartial G
hn : ∃ j, moveRight G j ≤ 0
⊢ ∃ j, moveRight G j ≈ 0

Next tactic:
cases' hn with i hi
theorem exists_right_move_equiv_iff_fuzzy_zero : (∃ j, G.moveRight j ≈ 0) ↔ G ‖ 0 := by
  refine' ⟨fun ⟨i, hi⟩ => (fuzzy_zero_iff_lf G).2 (lf_of_moveRight_le hi.1), fun hn => _⟩
  rw [fuzzy_zero_iff_lf G, lf_zero_le] at hn
  cases' hn with i hi
  

Proof state:
case intro
G : PGame
inst✝ : Impartial G
i : RightMoves G
hi : moveRight G i ≤ 0
⊢ ∃ j, moveRight G j ≈ 0

Next tactic:
exact ⟨i, (equiv_zero_iff_le _).2 hi⟩
/-- The set `{0}` is the bottom element of the lattice of submodules. -/
instance : Bot (Submodule R M) :=
  ⟨{ (⊥ : AddSubmonoid M) with
      carrier := {0}
      smul_mem' := by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
src✝ : AddSubmonoid M := ⊥
⊢ ∀ (c : R) {x : M},
    x ∈
        {
              toAddSubsemigroup :=
                { carrier := {0},
                  add_mem' := (_ : ∀ {a b : M}, a ∈ src✝.carrier → b ∈ src✝.carrier → a + b ∈ src✝.carrier) },
              zero_mem' := (_ : 0 ∈ src✝.carrier) }.toAddSubsemigroup.carrier →
      c • x ∈
        {
              toAddSubsemigroup :=
                { carrier := {0},
                  add_mem' := (_ : ∀ {a b : M}, a ∈ src✝.carrier → b ∈ src✝.carrier → a + b ∈ src✝.carrier) },
              zero_mem' := (_ : 0 ∈ src✝.carrier) }.toAddSubsemigroup.carrier

Next tactic:
simp
@[simp]
theorem restrictScalars_eq_bot_iff {p : Submodule R M} : restrictScalars S p = ⊥ ↔ p = ⊥ := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q p : Submodule R M
⊢ restrictScalars S p = ⊥ ↔ p = ⊥

Next tactic:
simp [SetLike.ext_iff]
instance : OrderBot (Submodule R M) where
  bot := ⊥
  bot_le p x := by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q p : Submodule R M
x : M
⊢ x ∈ ⊥ → x ∈ p

Next tactic:
simp (config := { contextual := true }) [zero_mem]
@[ext high]
protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
x y : ↥⊥
⊢ x = y

Next tactic:
rcases x with ⟨x, xm⟩
@[ext high]
protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by
  rcases x with ⟨x, xm⟩; 

Proof state:
case mk
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
y : ↥⊥
x : M
xm : x ∈ ⊥
⊢ { val := x, property := xm } = y

Next tactic:
rcases y with ⟨y, ym⟩
@[ext high]
protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by
  rcases x with ⟨x, xm⟩; rcases y with ⟨y, ym⟩; 

Proof state:
case mk.mk
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
x : M
xm : x ∈ ⊥
y : M
ym : y ∈ ⊥
⊢ { val := x, property := xm } = { val := y, property := ym }

Next tactic:
congr
@[ext high]
protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by
  rcases x with ⟨x, xm⟩; rcases y with ⟨y, ym⟩; congr
  

Proof state:
case mk.mk.e_val
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
x : M
xm : x ∈ ⊥
y : M
ym : y ∈ ⊥
⊢ x = y

Next tactic:
rw [(Submodule.eq_bot_iff _).mp rfl x xm]
@[ext high]
protected theorem bot_ext (x y : (⊥ : Submodule R M)) : x = y := by
  rcases x with ⟨x, xm⟩; rcases y with ⟨y, ym⟩; congr
  rw [(Submodule.eq_bot_iff _).mp rfl x xm]
  

Proof state:
case mk.mk.e_val
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
x : M
xm : x ∈ ⊥
y : M
ym : y ∈ ⊥
⊢ 0 = y

Next tactic:
rw [(Submodule.eq_bot_iff _).mp rfl y ym]
protected theorem ne_bot_iff (p : Submodule R M) : p ≠ ⊥ ↔ ∃ x ∈ p, x ≠ (0 : M) := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q p : Submodule R M
⊢ p ≠ ⊥ ↔ ∃ x ∈ p, x ≠ 0

Next tactic:
simp only [ne_eq, p.eq_bot_iff, not_forall, exists_prop]
theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥ := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
⊢ Subsingleton ↥p ↔ p = ⊥

Next tactic:
rw [subsingleton_iff, Submodule.eq_bot_iff]
theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥ := by
  rw [subsingleton_iff, Submodule.eq_bot_iff]
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
⊢ (∀ (x y : ↥p), x = y) ↔ ∀ x ∈ p, x = 0

Next tactic:
refine ⟨fun h x hx ↦ by simpa using h ⟨x, hx⟩ ⟨0, p.zero_mem⟩,
    fun h ⟨x, hx⟩ ⟨y, hy⟩ ↦ by simp [h x hx, h y hy]⟩
theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥ := by
  rw [subsingleton_iff, Submodule.eq_bot_iff]
  refine ⟨fun h x hx ↦ by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
h : ∀ (x y : ↥p), x = y
x : M
hx : x ∈ p
⊢ x = 0

Next tactic:
simpa using h ⟨x, hx⟩ ⟨0, p.zero_mem⟩
theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥ := by
  rw [subsingleton_iff, Submodule.eq_bot_iff]
  refine ⟨fun h x hx ↦ by simpa using h ⟨x, hx⟩ ⟨0, p.zero_mem⟩,
    fun h ⟨x, hx⟩ ⟨y, hy⟩ ↦ by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
h : ∀ x ∈ p, x = 0
x✝¹ x✝ : ↥p
x : M
hx : x ∈ p
y : M
hy : y ∈ p
⊢ { val := x, property := hx } = { val := y, property := hy }

Next tactic:
simp [h x hx, h y hy]
theorem nontrivial_iff_ne_bot : Nontrivial p ↔ p ≠ ⊥ := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
⊢ Nontrivial ↥p ↔ p ≠ ⊥

Next tactic:
rw [iff_not_comm, not_nontrivial_iff_subsingleton, subsingleton_iff_eq_bot]
@[simp]
theorem restrictScalars_eq_top_iff {p : Submodule R M} : restrictScalars S p = ⊤ ↔ p = ⊤ := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q p : Submodule R M
⊢ restrictScalars S p = ⊤ ↔ p = ⊤

Next tactic:
simp [SetLike.ext_iff]
instance : InfSet (Submodule R M) :=
  ⟨fun S ↦
    { carrier := ⋂ s ∈ S, (s : Set M)
      zero_mem' := by simp [zero_mem]
      add_mem' := by 

Proof state:
R : Type u_1
S✝ : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S✝
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S✝ M
inst✝¹ : SMul S✝ R
inst✝ : IsScalarTower S✝ R M
p q : Submodule R M
S : Set (Submodule R M)
⊢ ∀ {a b : M}, a ∈ ⋂ s ∈ S, ↑s → b ∈ ⋂ s ∈ S, ↑s → a + b ∈ ⋂ s ∈ S, ↑s

Next tactic:
simp (config := { contextual := true }) [add_mem]
instance : InfSet (Submodule R M) :=
  ⟨fun S ↦
    { carrier := ⋂ s ∈ S, (s : Set M)
      zero_mem' := by 

Proof state:
R : Type u_1
S✝ : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S✝
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S✝ M
inst✝¹ : SMul S✝ R
inst✝ : IsScalarTower S✝ R M
p q : Submodule R M
S : Set (Submodule R M)
⊢ 0 ∈
    { carrier := ⋂ s ∈ S, ↑s,
        add_mem' := (_ : ∀ (a a_1 : M), a ∈ ⋂ i ∈ S, ↑i → a_1 ∈ ⋂ i ∈ S, ↑i → a + a_1 ∈ ⋂ i ∈ S, ↑i) }.carrier

Next tactic:
simp [zero_mem]
instance : InfSet (Submodule R M) :=
  ⟨fun S ↦
    { carrier := ⋂ s ∈ S, (s : Set M)
      zero_mem' := by simp [zero_mem]
      add_mem' := by simp (config := { contextual := true }) [add_mem]
      smul_mem' := by 

Proof state:
R : Type u_1
S✝ : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S✝
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S✝ M
inst✝¹ : SMul S✝ R
inst✝ : IsScalarTower S✝ R M
p q : Submodule R M
S : Set (Submodule R M)
⊢ ∀ (c : R) {x : M},
    x ∈
        {
              toAddSubsemigroup :=
                { carrier := ⋂ s ∈ S, ↑s,
                  add_mem' := (_ : ∀ (a a_1 : M), a ∈ ⋂ i ∈ S, ↑i → a_1 ∈ ⋂ i ∈ S, ↑i → a + a_1 ∈ ⋂ i ∈ S, ↑i) },
              zero_mem' := (_ : 0 ∈ ⋂ i ∈ S, ↑i) }.toAddSubsemigroup.carrier →
      c • x ∈
        {
              toAddSubsemigroup :=
                { carrier := ⋂ s ∈ S, ↑s,
                  add_mem' := (_ : ∀ (a a_1 : M), a ∈ ⋂ i ∈ S, ↑i → a_1 ∈ ⋂ i ∈ S, ↑i → a + a_1 ∈ ⋂ i ∈ S, ↑i) },
              zero_mem' := (_ : 0 ∈ ⋂ i ∈ S, ↑i) }.toAddSubsemigroup.carrier

Next tactic:
simp (config := { contextual := true }) [smul_mem]
instance : Inf (Submodule R M) :=
  ⟨fun p q ↦
    { carrier := p ∩ q
      zero_mem' := by simp [zero_mem]
      add_mem' := by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q✝ p q : Submodule R M
⊢ ∀ {a b : M}, a ∈ ↑p ∩ ↑q → b ∈ ↑p ∩ ↑q → a + b ∈ ↑p ∩ ↑q

Next tactic:
simp (config := { contextual := true }) [add_mem]
instance : Inf (Submodule R M) :=
  ⟨fun p q ↦
    { carrier := p ∩ q
      zero_mem' := by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q✝ p q : Submodule R M
⊢ 0 ∈ { carrier := ↑p ∩ ↑q, add_mem' := (_ : ∀ (a a_1 : M), a ∈ ↑p ∩ ↑q → a_1 ∈ ↑p ∩ ↑q → a + a_1 ∈ ↑p ∩ ↑q) }.carrier

Next tactic:
simp [zero_mem]
instance : Inf (Submodule R M) :=
  ⟨fun p q ↦
    { carrier := p ∩ q
      zero_mem' := by simp [zero_mem]
      add_mem' := by simp (config := { contextual := true }) [add_mem]
      smul_mem' := by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q✝ p q : Submodule R M
⊢ ∀ (c : R) {x : M},
    x ∈
        {
              toAddSubsemigroup :=
                { carrier := ↑p ∩ ↑q,
                  add_mem' := (_ : ∀ (a a_1 : M), a ∈ ↑p ∩ ↑q → a_1 ∈ ↑p ∩ ↑q → a + a_1 ∈ ↑p ∩ ↑q) },
              zero_mem' := (_ : 0 ∈ ↑p ∩ ↑q) }.toAddSubsemigroup.carrier →
      c • x ∈
        {
              toAddSubsemigroup :=
                { carrier := ↑p ∩ ↑q,
                  add_mem' := (_ : ∀ (a a_1 : M), a ∈ ↑p ∩ ↑q → a_1 ∈ ↑p ∩ ↑q → a + a_1 ∈ ↑p ∩ ↑q) },
              zero_mem' := (_ : 0 ∈ ↑p ∩ ↑q) }.toAddSubsemigroup.carrier

Next tactic:
simp (config := { contextual := true }) [smul_mem]
instance completeLattice : CompleteLattice (Submodule R M) :=
  { (inferInstance : OrderTop (Submodule R M)),
    (inferInstance : OrderBot (Submodule R M)) with
    sup := fun a b ↦ sInf { x | a ≤ x ∧ b ≤ x }
    le_sup_left := fun _ _ ↦ le_sInf' fun _ ⟨h, _⟩ ↦ h
    le_sup_right := fun _ _ ↦ le_sInf' fun _ ⟨_, h⟩ ↦ h
    sup_le := fun _ _ _ h₁ h₂ ↦ sInf_le' ⟨h₁, h₂⟩
    inf := (· ⊓ ·)
    le_inf := fun _ _ _ ↦ Set.subset_inter
    inf_le_left := fun _ _ ↦ Set.inter_subset_left _ _
    inf_le_right := fun _ _ ↦ Set.inter_subset_right _ _
    le_sSup := fun _ _ hs ↦ le_sInf' fun _ hq ↦ by 

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p q : Submodule R M
src✝¹ : OrderTop (Submodule R M) := inferInstance
src✝ : OrderBot (Submodule R M) := inferInstance
x✝² : Set (Submodule R M)
x✝¹ : Submodule R M
hs : x✝¹ ∈ x✝²
x✝ : Submodule R M
hq : x✝ ∈ fun x => ∀ b ∈ x✝², b ≤ x
⊢ x✝¹ ≤ x✝

Next tactic:
exact hq _ hs
@[simp]
theorem finset_inf_coe {ι} (s : Finset ι) (p : ι → Submodule R M) :
    (↑(s.inf p) : Set M) = ⋂ i ∈ s, ↑(p i) := by
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q : Submodule R M
ι : Type u_4
s : Finset ι
p : ι → Submodule R M
⊢ ↑(Finset.inf s p) = ⋂ i ∈ s, ↑(p i)

Next tactic:
letI := Classical.decEq ι
@[simp]
theorem finset_inf_coe {ι} (s : Finset ι) (p : ι → Submodule R M) :
    (↑(s.inf p) : Set M) = ⋂ i ∈ s, ↑(p i) := by
  letI := Classical.decEq ι
  

Proof state:
R : Type u_1
S : Type u_2
M : Type u_3
inst✝⁶ : Semiring R
inst✝⁵ : Semiring S
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : Module S M
inst✝¹ : SMul S R
inst✝ : IsScalarTower S R M
p✝ q : Submodule R M
ι : Type u_4
s : Finset ι
p : ι → Submodule R M
this : DecidableEq ι := Classical.decEq ι
⊢ ↑(Finset.inf s p) = ⋂ i ∈ s, ↑(p i)

Next tactic:
refine' s.induction_on _ fun i s _ ih ↦ _