l3lab/ntp-mathlib huggingface dataset:
theorem toLinearMap_symm_comp_eq (f : M₃ →ₛₗ[σ₃₁] M₁) (g : M₃ →ₛₗ[σ₃₂] M₂) :
    e₁₂.symm.toLinearMap.comp g = f ↔ g = e₁₂.toLinearMap.comp f := by
  constructor <;> intro H <;> ext
  · simp [← H, ← e₁₂.toEquiv.symm_comp_eq f g]
  · 

Proof state:
case mpr.h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
f : M₃ →ₛₗ[σ₃₁] M₁
g : M₃ →ₛₗ[σ₃₂] M₂
H : g = LinearMap.comp (↑e₁₂) f
x✝ : M₃
⊢ (LinearMap.comp (↑(symm e₁₂)) g) x✝ = f x✝

Next tactic:
simp [H, e₁₂.toEquiv.symm_comp_eq f g]
@[simp]
theorem self_trans_symm (f : M₁ ≃ₛₗ[σ₁₂] M₂) : f.trans f.symm = LinearEquiv.refl R₁ M₁ := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
f : M₁ ≃ₛₗ[σ₁₂] M₂
⊢ trans f (symm f) = refl R₁ M₁

Next tactic:
ext x
@[simp]
theorem self_trans_symm (f : M₁ ≃ₛₗ[σ₁₂] M₂) : f.trans f.symm = LinearEquiv.refl R₁ M₁ := by
  ext x
  

Proof state:
case h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
f : M₁ ≃ₛₗ[σ₁₂] M₂
x : M₁
⊢ (trans f (symm f)) x = (refl R₁ M₁) x

Next tactic:
simp
@[simp]
theorem symm_trans_self (f : M₁ ≃ₛₗ[σ₁₂] M₂) : f.symm.trans f = LinearEquiv.refl R₂ M₂ := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
f : M₁ ≃ₛₗ[σ₁₂] M₂
⊢ trans (symm f) f = refl R₂ M₂

Next tactic:
ext x
@[simp]
theorem symm_trans_self (f : M₁ ≃ₛₗ[σ₁₂] M₂) : f.symm.trans f = LinearEquiv.refl R₂ M₂ := by
  ext x
  

Proof state:
case h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
f : M₁ ≃ₛₗ[σ₁₂] M₂
x : M₂
⊢ (trans (symm f) f) x = (refl R₂ M₂) x

Next tactic:
simp
@[simp]
theorem symm_symm (e : M ≃ₛₗ[σ] M₂) : e.symm.symm = e := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e✝ e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
e : M ≃ₛₗ[σ] M₂
⊢ symm (symm e) = e

Next tactic:
cases e
@[simp]
theorem symm_symm (e : M ≃ₛₗ[σ] M₂) : e.symm.symm = e := by
  cases e
  

Proof state:
case mk
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹⁷ : Semiring R
inst✝¹⁶ : Semiring S
inst✝¹⁵ : Semiring R₁
inst✝¹⁴ : Semiring R₂
inst✝¹³ : Semiring R₃
inst✝¹² : AddCommMonoid M
inst✝¹¹ : AddCommMonoid M₁
inst✝¹⁰ : AddCommMonoid M₂
inst✝⁹ : AddCommMonoid M₃
inst✝⁸ : AddCommMonoid M₄
inst✝⁷ : AddCommMonoid N₁
inst✝⁶ : AddCommMonoid N₂
module_M : Module R M
module_S_M₂ : Module S M₂
σ : R →+* S
σ' : S →+* R
re₁ : RingHomInvPair σ σ'
re₂ : RingHomInvPair σ' σ
e e' : M ≃ₛₗ[σ] M₂
module_M₁ : Module R₁ M₁
module_M₂ : Module R₂ M₂
module_M₃ : Module R₃ M₃
module_N₁ : Module R₁ N₁
module_N₂ : Module R₁ N₂
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
σ₂₁ : R₂ →+* R₁
σ₃₂ : R₃ →+* R₂
σ₃₁ : R₃ →+* R₁
inst✝⁵ : RingHomCompTriple σ₁₂ σ₂₃ σ₁₃
inst✝⁴ : RingHomCompTriple σ₃₂ σ₂₁ σ₃₁
re₁₂ : RingHomInvPair σ₁₂ σ₂₁
re₂₃ : RingHomInvPair σ₂₃ σ₃₂
inst✝³ : RingHomInvPair σ₁₃ σ₃₁
re₂₁ : RingHomInvPair σ₂₁ σ₁₂
re₃₂ : RingHomInvPair σ₃₂ σ₂₃
inst✝² : RingHomInvPair σ₃₁ σ₁₃
e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂
e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃
inst✝¹ : RingHomCompTriple σ₂₁ σ₁₃ σ₂₃
inst✝ : RingHomCompTriple σ₃₁ σ₁₂ σ₃₂
toLinearMap✝ : M →ₛₗ[σ] M₂
invFun✝ : M₂ → M
left_inv✝ : LeftInverse invFun✝ toLinearMap✝.toFun
right_inv✝ : Function.RightInverse invFun✝ toLinearMap✝.toFun
⊢ symm (symm { toLinearMap := toLinearMap✝, invFun := invFun✝, left_inv := left_inv✝, right_inv := right_inv✝ }) =
    { toLinearMap := toLinearMap✝, invFun := invFun✝, left_inv := left_inv✝, right_inv := right_inv✝ }

Next tactic:
rfl
@[simp]
lemma coe_toLinearMap_mul {e₁ e₂ : M ≃ₗ[R] M} :
    (↑(e₁ * e₂) : M →ₗ[R] M) = (e₁ : M →ₗ[R] M) * (e₂ : M →ₗ[R] M) := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝⁸ : Semiring R
inst✝⁷ : Semiring S
inst✝⁶ : Semiring R₁
inst✝⁵ : Semiring R₂
inst✝⁴ : Semiring R₃
inst✝³ : AddCommMonoid M
inst✝² : AddCommMonoid M₁
inst✝¹ : AddCommMonoid M₂
inst✝ : Module R M
e₁ e₂ : M ≃ₗ[R] M
⊢ ↑(e₁ * e₂) = ↑e₁ * ↑e₂

Next tactic:
rfl
@[simp]
theorem ofSubsingleton_self : ofSubsingleton M M = refl R M := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹¹ : Semiring R
inst✝¹⁰ : Semiring S
inst✝⁹ : Semiring R₁
inst✝⁸ : Semiring R₂
inst✝⁷ : Semiring R₃
inst✝⁶ : AddCommMonoid M
inst✝⁵ : AddCommMonoid M₁
inst✝⁴ : AddCommMonoid M₂
inst✝³ : Module R M
inst✝² : Module R M₂
inst✝¹ : Subsingleton M
inst✝ : Subsingleton M₂
⊢ ofSubsingleton M M = refl R M

Next tactic:
ext
@[simp]
theorem ofSubsingleton_self : ofSubsingleton M M = refl R M := by
  ext
  

Proof state:
case h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
M₄ : Type u_16
inst✝¹¹ : Semiring R
inst✝¹⁰ : Semiring S
inst✝⁹ : Semiring R₁
inst✝⁸ : Semiring R₂
inst✝⁷ : Semiring R₃
inst✝⁶ : AddCommMonoid M
inst✝⁵ : AddCommMonoid M₁
inst✝⁴ : AddCommMonoid M₂
inst✝³ : Module R M
inst✝² : Module R M₂
inst✝¹ : Subsingleton M
inst✝ : Subsingleton M₂
x✝ : M
⊢ (ofSubsingleton M M) x✝ = (refl R M) x✝

Next tactic:
simp [eq_iff_true_of_subsingleton]
/-- An additive equivalence between commutative additive monoids is a linear equivalence between
ℕ-modules -/
def toNatLinearEquiv : M ≃ₗ[ℕ] M₂ :=
  e.toLinearEquiv fun c a => by
    

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M
inst✝³ : AddCommMonoid M₂
inst✝² : AddCommMonoid M₃
inst✝¹ : Module R M
inst✝ : Module R M₂
e : M ≃+ M₂
c : ℕ
a : M
⊢ e (c • a) = c • e a

Next tactic:
erw [e.toAddMonoidHom.map_nsmul]
/-- An additive equivalence between commutative additive monoids is a linear equivalence between
ℕ-modules -/
def toNatLinearEquiv : M ≃ₗ[ℕ] M₂ :=
  e.toLinearEquiv fun c a => by
    erw [e.toAddMonoidHom.map_nsmul]
    

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M
inst✝³ : AddCommMonoid M₂
inst✝² : AddCommMonoid M₃
inst✝¹ : Module R M
inst✝ : Module R M₂
e : M ≃+ M₂
c : ℕ
a : M
⊢ c • (toAddMonoidHom e) a = c • e a

Next tactic:
rfl
@[simp]
theorem toNatLinearEquiv_toAddEquiv : ↑e.toNatLinearEquiv = e := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M
inst✝³ : AddCommMonoid M₂
inst✝² : AddCommMonoid M₃
inst✝¹ : Module R M
inst✝ : Module R M₂
e : M ≃+ M₂
⊢ ↑(toNatLinearEquiv e) = e

Next tactic:
ext
@[simp]
theorem toNatLinearEquiv_toAddEquiv : ↑e.toNatLinearEquiv = e := by
  ext
  

Proof state:
case h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M
inst✝³ : AddCommMonoid M₂
inst✝² : AddCommMonoid M₃
inst✝¹ : Module R M
inst✝ : Module R M₂
e : M ≃+ M₂
x✝ : M
⊢ ↑(toNatLinearEquiv e) x✝ = e x✝

Next tactic:
rfl
@[simp]
theorem toIntLinearEquiv_toAddEquiv : ↑e.toIntLinearEquiv = e := by
  

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝² : AddCommGroup M
inst✝¹ : AddCommGroup M₂
inst✝ : AddCommGroup M₃
e : M ≃+ M₂
⊢ ↑(toIntLinearEquiv e) = e

Next tactic:
ext
@[simp]
theorem toIntLinearEquiv_toAddEquiv : ↑e.toIntLinearEquiv = e := by
  ext
  

Proof state:
case h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝² : AddCommGroup M
inst✝¹ : AddCommGroup M₂
inst✝ : AddCommGroup M₃
e : M ≃+ M₂
x✝ : M
⊢ ↑(toIntLinearEquiv e) x✝ = e x✝

Next tactic:
rfl
/-- The equivalence between R-linear maps from `R` to `M`, and points of `M` itself.
This says that the forgetful functor from `R`-modules to types is representable, by `R`.

This is an `S`-linear equivalence, under the assumption that `S` acts on `M` commuting with `R`.
When `R` is commutative, we can take this to be the usual action with `S = R`.
Otherwise, `S = ℕ` shows that the equivalence is additive.
See note [bundled maps over different rings].
-/
@[simps]
def ringLmapEquivSelf [Module S M] [SMulCommClass R S M] : (R →ₗ[R] M) ≃ₗ[S] M :=
  { applyₗ' S (1 : R) with
    toFun := fun f => f 1
    invFun := smulRight (1 : R →ₗ[R] R)
    left_inv := fun f => by
      

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : Semiring S
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
src✝ : (R →ₗ[R] M) →ₗ[S] M := (applyₗ' S) 1
f : R →ₗ[R] M
⊢ smulRight 1
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => f 1,
                map_add' :=
                  (_ :
                    ∀ (x y : R →ₗ[R] M),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : S) (x : R →ₗ[R] M),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        f) =
    f

Next tactic:
ext
/-- The equivalence between R-linear maps from `R` to `M`, and points of `M` itself.
This says that the forgetful functor from `R`-modules to types is representable, by `R`.

This is an `S`-linear equivalence, under the assumption that `S` acts on `M` commuting with `R`.
When `R` is commutative, we can take this to be the usual action with `S = R`.
Otherwise, `S = ℕ` shows that the equivalence is additive.
See note [bundled maps over different rings].
-/
@[simps]
def ringLmapEquivSelf [Module S M] [SMulCommClass R S M] : (R →ₗ[R] M) ≃ₗ[S] M :=
  { applyₗ' S (1 : R) with
    toFun := fun f => f 1
    invFun := smulRight (1 : R →ₗ[R] R)
    left_inv := fun f => by
      ext
      

Proof state:
case h
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : Semiring S
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
src✝ : (R →ₗ[R] M) →ₗ[S] M := (applyₗ' S) 1
f : R →ₗ[R] M
⊢ (smulRight 1
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => f 1,
                  map_add' :=
                    (_ :
                      ∀ (x y : R →ₗ[R] M),
                        AddHom.toFun src✝.toAddHom (x + y) =
                          AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
              map_smul' :=
                (_ :
                  ∀ (r : S) (x : R →ₗ[R] M),
                    AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
          f))
      1 =
    f 1

Next tactic:
simp only [coe_smulRight, one_apply, smul_eq_mul, ← map_smul f, mul_one]
/-- The equivalence between R-linear maps from `R` to `M`, and points of `M` itself.
This says that the forgetful functor from `R`-modules to types is representable, by `R`.

This is an `S`-linear equivalence, under the assumption that `S` acts on `M` commuting with `R`.
When `R` is commutative, we can take this to be the usual action with `S = R`.
Otherwise, `S = ℕ` shows that the equivalence is additive.
See note [bundled maps over different rings].
-/
@[simps]
def ringLmapEquivSelf [Module S M] [SMulCommClass R S M] : (R →ₗ[R] M) ≃ₗ[S] M :=
  { applyₗ' S (1 : R) with
    toFun := fun f => f 1
    invFun := smulRight (1 : R →ₗ[R] R)
    left_inv := fun f => by
      ext
      simp only [coe_smulRight, one_apply, smul_eq_mul, ← map_smul f, mul_one]
    right_inv := fun x => by 

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
M : Type u_7
M₁ : Type u_8
M₂ : Type u_9
M₃ : Type u_10
N₁ : Type u_11
N₂ : Type u_12
N₃ : Type u_13
N₄ : Type u_14
ι : Type u_15
inst✝⁵ : Semiring R
inst✝⁴ : Semiring S
inst✝³ : AddCommMonoid M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : SMulCommClass R S M
src✝ : (R →ₗ[R] M) →ₗ[S] M := (applyₗ' S) 1
x : M
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun f => f 1,
              map_add' :=
                (_ :
                  ∀ (x y : R →ₗ[R] M),
                    AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
          map_smul' :=
            (_ :
              ∀ (r : S) (x : R →ₗ[R] M),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      (smulRight 1 x) =
    x

Next tactic:
simp
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  

Proof state:
n : ℕ
⊢ Nat.IsSqrt n (sqrt n)

Next tactic:
match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => simp [IsSqrt, sqrt]
  | n + 2 =>
    have h : ¬ (n + 2) ≤ 1 := by simp
    simp only [IsSqrt, sqrt, h, ite_false]
    refine ⟨sqrt.iter_sq_le _ _, sqrt.lt_iter_succ_sq _ _ ?_⟩
    simp only [mul_add, add_mul, one_mul, mul_one, ← add_assoc]
    rw [lt_add_one_iff, add_assoc, ← mul_two]
    refine le_trans (div_add_mod' (n + 2) 2).ge ?_
    rw [add_comm, add_le_add_iff_right, add_mod_right]
    simp only [zero_lt_two, add_div_right, succ_mul_succ_eq]
    refine le_trans (b := 1) ?_ ?_
    · exact (lt_succ.1 $ mod_lt n zero_lt_two)
    · simp only [le_add_iff_nonneg_left]; exact zero_le _
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => 

Proof state:
n : ℕ
⊢ Nat.IsSqrt 0 (sqrt 0)

Next tactic:
simp [IsSqrt, sqrt]
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => 

Proof state:
n : ℕ
⊢ Nat.IsSqrt 1 (sqrt 1)

Next tactic:
simp [IsSqrt, sqrt]
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => simp [IsSqrt, sqrt]
  | n + 2 =>
    

Proof state:
n✝ n : ℕ
⊢ Nat.IsSqrt (n + 2) (sqrt (n + 2))

Next tactic:
have h : ¬ (n + 2) ≤ 1 := by simp
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => simp [IsSqrt, sqrt]
  | n + 2 =>
    have h : ¬ (n + 2) ≤ 1 := by 

Proof state:
n✝ n : ℕ
⊢ ¬n + 2 ≤ 1

Next tactic:
simp
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => simp [IsSqrt, sqrt]
  | n + 2 =>
    have h : ¬ (n + 2) ≤ 1 := by simp
    

Proof state:
n✝ n : ℕ
h : ¬n + 2 ≤ 1
⊢ Nat.IsSqrt (n + 2) (sqrt (n + 2))

Next tactic:
simp only [IsSqrt, sqrt, h, ite_false]
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => simp [IsSqrt, sqrt]
  | n + 2 =>
    have h : ¬ (n + 2) ≤ 1 := by simp
    simp only [IsSqrt, sqrt, h, ite_false]
    

Proof state:
n✝ n : ℕ
h : ¬n + 2 ≤ 1
⊢ sqrt.iter (n + 2) ((n + 2) / 2) * sqrt.iter (n + 2) ((n + 2) / 2) ≤ n + 2 ∧
    n + 2 < (sqrt.iter (n + 2) ((n + 2) / 2) + 1) * (sqrt.iter (n + 2) ((n + 2) / 2) + 1)

Next tactic:
refine ⟨sqrt.iter_sq_le _ _, sqrt.lt_iter_succ_sq _ _ ?_⟩
private theorem sqrt_isSqrt (n : ℕ) : IsSqrt n (sqrt n) := by
  match n with
  | 0 => simp [IsSqrt, sqrt]
  | 1 => simp [IsSqrt, sqrt]
  | n + 2 =>
    have h : ¬ (n + 2) ≤ 1 := by simp
    simp only [IsSqrt, sqrt, h, ite_false]
    refine ⟨sqrt.iter_sq_le _ _, sqrt.lt_iter_succ_sq _ _ ?_⟩
    

Proof state:
n✝ n : ℕ
h : ¬n + 2 ≤ 1
⊢ n + 2 < ((n + 2) / 2 + 1) * ((n + 2) / 2 + 1)

Next tactic:
simp only [mul_add, add_mul, one_mul, mul_one, ← add_assoc]