l3lab/ntp-mathlib huggingface dataset:
@[simp]
lemma map_dualCoannihilator_linearEquiv_flip (p : Submodule R (Dual R M)) :
    p.dualCoannihilator.map e.flip = (p.map e.symm).dualAnnihilator := by
  have : IsReflexive R N := e.isReflexive_of_equiv_dual_of_isReflexive
  suffices (p.map e.symm).dualAnnihilator.map e.flip.symm =
      (p.dualCoannihilator.map e.flip).map e.flip.symm by
    

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsReflexive R M
e : N ≃ₗ[R] Dual R M
p : Submodule R (Dual R M)
this✝ : IsReflexive R N
this :
  map (LinearEquiv.symm (LinearEquiv.flip e)) (dualAnnihilator (map (LinearEquiv.symm e) p)) =
    map (LinearEquiv.symm (LinearEquiv.flip e)) (map (LinearEquiv.flip e) (dualCoannihilator p))
⊢ map (LinearEquiv.flip e) (dualCoannihilator p) = dualAnnihilator (map (LinearEquiv.symm e) p)

Next tactic:
exact (Submodule.map_injective_of_injective e.flip.symm.injective this).symm
@[simp]
lemma map_dualCoannihilator_linearEquiv_flip (p : Submodule R (Dual R M)) :
    p.dualCoannihilator.map e.flip = (p.map e.symm).dualAnnihilator := by
  have : IsReflexive R N := e.isReflexive_of_equiv_dual_of_isReflexive
  suffices (p.map e.symm).dualAnnihilator.map e.flip.symm =
      (p.dualCoannihilator.map e.flip).map e.flip.symm by
    exact (Submodule.map_injective_of_injective e.flip.symm.injective this).symm
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsReflexive R M
e : N ≃ₗ[R] Dual R M
p : Submodule R (Dual R M)
this : IsReflexive R N
⊢ map (LinearEquiv.symm (LinearEquiv.flip e)) (dualAnnihilator (map (LinearEquiv.symm e) p)) =
    map (LinearEquiv.symm (LinearEquiv.flip e)) (map (LinearEquiv.flip e) (dualCoannihilator p))

Next tactic:
erw [← dualCoannihilator_map_linearEquiv_flip, flip_flip, ← map_comp, ← map_comp]
@[simp]
lemma map_dualCoannihilator_linearEquiv_flip (p : Submodule R (Dual R M)) :
    p.dualCoannihilator.map e.flip = (p.map e.symm).dualAnnihilator := by
  have : IsReflexive R N := e.isReflexive_of_equiv_dual_of_isReflexive
  suffices (p.map e.symm).dualAnnihilator.map e.flip.symm =
      (p.dualCoannihilator.map e.flip).map e.flip.symm by
    exact (Submodule.map_injective_of_injective e.flip.symm.injective this).symm
  erw [← dualCoannihilator_map_linearEquiv_flip, flip_flip, ← map_comp, ← map_comp]
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsReflexive R M
e : N ≃ₗ[R] Dual R M
p : Submodule R (Dual R M)
this : IsReflexive R N
⊢ dualCoannihilator (map (↑e ∘ₗ ↑(LinearEquiv.symm e)) p) =
    map (↑(LinearEquiv.symm (LinearEquiv.flip e)) ∘ₗ ↑(LinearEquiv.flip e)) (dualCoannihilator p)

Next tactic:
simp [-coe_toLinearMap_flip]
@[simp]
lemma dualAnnihilator_map_linearEquiv_flip_symm (p : Submodule R (Dual R N)) :
    (p.map e.flip.symm).dualAnnihilator = p.dualCoannihilator.map e := by
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsReflexive R M
e : N ≃ₗ[R] Dual R M
p : Submodule R (Dual R N)
⊢ dualAnnihilator (map (LinearEquiv.symm (LinearEquiv.flip e)) p) = map e (dualCoannihilator p)

Next tactic:
have : IsReflexive R N := e.isReflexive_of_equiv_dual_of_isReflexive
@[simp]
lemma dualAnnihilator_map_linearEquiv_flip_symm (p : Submodule R (Dual R N)) :
    (p.map e.flip.symm).dualAnnihilator = p.dualCoannihilator.map e := by
  have : IsReflexive R N := e.isReflexive_of_equiv_dual_of_isReflexive
  

Proof state:
R : Type u_1
M : Type u_2
N : Type u_3
inst✝⁵ : CommRing R
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : AddCommGroup N
inst✝¹ : Module R N
inst✝ : IsReflexive R M
e : N ≃ₗ[R] Dual R M
p : Submodule R (Dual R N)
this : IsReflexive R N
⊢ dualAnnihilator (map (LinearEquiv.symm (LinearEquiv.flip e)) p) = map e (dualCoannihilator p)

Next tactic:
rw [← map_dualCoannihilator_linearEquiv_flip, flip_flip]
@[reassoc]
theorem leftUnitor_tensor' (X Y : C) :
    (α_ (𝟙_ C) X Y).hom ≫ (λ_ (X ⊗ Y)).hom = (λ_ X).hom ⊗ 𝟙 Y := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
X Y : C
⊢ (α_ (𝟙_ C) X Y).hom ≫ (λ_ (X ⊗ Y)).hom = (λ_ X).hom ⊗ 𝟙 Y

Next tactic:
coherence
@[reassoc, simp]
theorem leftUnitor_tensor (X Y : C) :
    (λ_ (X ⊗ Y)).hom = (α_ (𝟙_ C) X Y).inv ≫ ((λ_ X).hom ⊗ 𝟙 Y) := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
X Y : C
⊢ (λ_ (X ⊗ Y)).hom = (α_ (𝟙_ C) X Y).inv ≫ ((λ_ X).hom ⊗ 𝟙 Y)

Next tactic:
coherence
@[reassoc]
theorem leftUnitor_tensor_inv (X Y : C) :
    (λ_ (X ⊗ Y)).inv = ((λ_ X).inv ⊗ 𝟙 Y) ≫ (α_ (𝟙_ C) X Y).hom := by 

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
X Y : C
⊢ (λ_ (X ⊗ Y)).inv = ((λ_ X).inv ⊗ 𝟙 Y) ≫ (α_ (𝟙_ C) X Y).hom

Next tactic:
coherence
@[reassoc]
theorem id_tensor_rightUnitor_inv (X Y : C) : 𝟙 X ⊗ (ρ_ Y).inv = (ρ_ _).inv ≫ (α_ _ _ _).hom := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
X Y : C
⊢ 𝟙 X ⊗ (ρ_ Y).inv = (ρ_ (X ⊗ Y)).inv ≫ (α_ X Y (𝟙_ C)).hom

Next tactic:
coherence
@[reassoc]
theorem leftUnitor_inv_tensor_id (X Y : C) : (λ_ X).inv ⊗ 𝟙 Y = (λ_ _).inv ≫ (α_ _ _ _).inv := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
X Y : C
⊢ (λ_ X).inv ⊗ 𝟙 Y = (λ_ (X ⊗ Y)).inv ≫ (α_ (𝟙_ C) X Y).inv

Next tactic:
coherence
@[reassoc]
theorem pentagon_inv_inv_hom (W X Y Z : C) :
    (α_ W (X ⊗ Y) Z).inv ≫ ((α_ W X Y).inv ⊗ 𝟙 Z) ≫ (α_ (W ⊗ X) Y Z).hom =
      (𝟙 W ⊗ (α_ X Y Z).hom) ≫ (α_ W X (Y ⊗ Z)).inv := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
W X Y Z : C
⊢ (α_ W (X ⊗ Y) Z).inv ≫ ((α_ W X Y).inv ⊗ 𝟙 Z) ≫ (α_ (W ⊗ X) Y Z).hom = (𝟙 W ⊗ (α_ X Y Z).hom) ≫ (α_ W X (Y ⊗ Z)).inv

Next tactic:
coherence
@[reassoc (attr := simp)]
theorem triangle_assoc_comp_right_inv (X Y : C) :
    ((ρ_ X).inv ⊗ 𝟙 Y) ≫ (α_ X (𝟙_ C) Y).hom = 𝟙 X ⊗ (λ_ Y).inv := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
X Y : C
⊢ ((ρ_ X).inv ⊗ 𝟙 Y) ≫ (α_ X (𝟙_ C) Y).hom = 𝟙 X ⊗ (λ_ Y).inv

Next tactic:
coherence
theorem unitors_equal : (λ_ (𝟙_ C)).hom = (ρ_ (𝟙_ C)).hom := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
⊢ (λ_ (𝟙_ C)).hom = (ρ_ (𝟙_ C)).hom

Next tactic:
coherence
theorem unitors_inv_equal : (λ_ (𝟙_ C)).inv = (ρ_ (𝟙_ C)).inv := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
⊢ (λ_ (𝟙_ C)).inv = (ρ_ (𝟙_ C)).inv

Next tactic:
coherence
@[reassoc]
theorem pentagon_hom_inv {W X Y Z : C} :
    (α_ W X (Y ⊗ Z)).hom ≫ (𝟙 W ⊗ (α_ X Y Z).inv) =
      (α_ (W ⊗ X) Y Z).inv ≫ ((α_ W X Y).hom ⊗ 𝟙 Z) ≫ (α_ W (X ⊗ Y) Z).hom := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
W X Y Z : C
⊢ (α_ W X (Y ⊗ Z)).hom ≫ (𝟙 W ⊗ (α_ X Y Z).inv) = (α_ (W ⊗ X) Y Z).inv ≫ ((α_ W X Y).hom ⊗ 𝟙 Z) ≫ (α_ W (X ⊗ Y) Z).hom

Next tactic:
coherence
@[reassoc]
theorem pentagon_inv_hom (W X Y Z : C) :
    (α_ (W ⊗ X) Y Z).inv ≫ ((α_ W X Y).hom ⊗ 𝟙 Z) =
      (α_ W X (Y ⊗ Z)).hom ≫ (𝟙 W ⊗ (α_ X Y Z).inv) ≫ (α_ W (X ⊗ Y) Z).inv := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{u_2, u_1} C
inst✝ : MonoidalCategory C
W X Y Z : C
⊢ (α_ (W ⊗ X) Y Z).inv ≫ ((α_ W X Y).hom ⊗ 𝟙 Z) = (α_ W X (Y ⊗ Z)).hom ≫ (𝟙 W ⊗ (α_ X Y Z).inv) ≫ (α_ W (X ⊗ Y) Z).inv

Next tactic:
coherence
instance Module.Free.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Free R (M →ₗ[R] N) := by
  

Proof state:
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
⊢ Free R (M →ₗ[R] N)

Next tactic:
cases subsingleton_or_nontrivial R
instance Module.Free.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Free R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · 

Proof state:
case inl
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Subsingleton R
⊢ Free R (M →ₗ[R] N)

Next tactic:
apply Module.Free.of_subsingleton'
instance Module.Free.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Free R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · apply Module.Free.of_subsingleton'
  

Proof state:
case inr
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Nontrivial R
⊢ Free R (M →ₗ[R] N)

Next tactic:
classical exact
      Module.Free.of_equiv (LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)).symm
instance Module.Free.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Free R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · apply Module.Free.of_subsingleton'
  classical 

Proof state:
case inr
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Nontrivial R
⊢ Free R (M →ₗ[R] N)

Next tactic:
exact
      Module.Free.of_equiv (LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)).symm
instance Module.Finite.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Finite R (M →ₗ[R] N) := by
  

Proof state:
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
⊢ Finite R (M →ₗ[R] N)

Next tactic:
cases subsingleton_or_nontrivial R
instance Module.Finite.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Finite R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · 

Proof state:
case inl
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Subsingleton R
⊢ Finite R (M →ₗ[R] N)

Next tactic:
infer_instance
instance Module.Finite.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Finite R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · infer_instance
  

Proof state:
case inr
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Nontrivial R
⊢ Finite R (M →ₗ[R] N)

Next tactic:
classical
    have f := (LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)).symm
    exact Module.Finite.of_surjective f.toLinearMap (LinearEquiv.surjective f)
instance Module.Finite.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Finite R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · infer_instance
  classical
    

Proof state:
case inr
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Nontrivial R
⊢ Finite R (M →ₗ[R] N)

Next tactic:
have f := (LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)).symm
instance Module.Finite.linearMap [Module.Finite R M] [Module.Finite R N] :
    Module.Finite R (M →ₗ[R] N) := by
  cases subsingleton_or_nontrivial R
  · infer_instance
  classical
    have f := (LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)).symm
    

Proof state:
case inr
R : Type u
M : Type v
N : Type w
inst✝⁸ : CommRing R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Free R M
inst✝⁴ : AddCommGroup N
inst✝³ : Module R N
inst✝² : Free R N
inst✝¹ : Finite R M
inst✝ : Finite R N
h✝ : Nontrivial R
f : Matrix (Free.ChooseBasisIndex R N) (Free.ChooseBasisIndex R M) R ≃ₗ[R] M →ₗ[R] N
⊢ Finite R (M →ₗ[R] N)

Next tactic:
exact Module.Finite.of_surjective f.toLinearMap (LinearEquiv.surjective f)
/-- The finrank of `M →ₗ[R] N` is `(finrank R M) * (finrank R N)`. -/
theorem FiniteDimensional.finrank_linearMap :
    finrank R (M →ₗ[R] N) = finrank R M * finrank R N := by
  

Proof state:
R : Type u
M : Type v
N : Type w
inst✝⁹ : CommRing R
inst✝⁸ : StrongRankCondition R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Module.Free R M
inst✝⁴ : Module.Finite R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : Module.Free R N
inst✝ : Module.Finite R N
⊢ finrank R (M →ₗ[R] N) = finrank R M * finrank R N

Next tactic:
classical
    letI := nontrivial_of_invariantBasisNumber R
    have h := LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)
    simp_rw [h.finrank_eq, FiniteDimensional.finrank_matrix,
      FiniteDimensional.finrank_eq_card_chooseBasisIndex, mul_comm]
/-- The finrank of `M →ₗ[R] N` is `(finrank R M) * (finrank R N)`. -/
theorem FiniteDimensional.finrank_linearMap :
    finrank R (M →ₗ[R] N) = finrank R M * finrank R N := by
  classical
    

Proof state:
R : Type u
M : Type v
N : Type w
inst✝⁹ : CommRing R
inst✝⁸ : StrongRankCondition R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Module.Free R M
inst✝⁴ : Module.Finite R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : Module.Free R N
inst✝ : Module.Finite R N
⊢ finrank R (M →ₗ[R] N) = finrank R M * finrank R N

Next tactic:
letI := nontrivial_of_invariantBasisNumber R
/-- The finrank of `M →ₗ[R] N` is `(finrank R M) * (finrank R N)`. -/
theorem FiniteDimensional.finrank_linearMap :
    finrank R (M →ₗ[R] N) = finrank R M * finrank R N := by
  classical
    letI := nontrivial_of_invariantBasisNumber R
    

Proof state:
R : Type u
M : Type v
N : Type w
inst✝⁹ : CommRing R
inst✝⁸ : StrongRankCondition R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Module.Free R M
inst✝⁴ : Module.Finite R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : Module.Free R N
inst✝ : Module.Finite R N
this : Nontrivial R := nontrivial_of_invariantBasisNumber R
⊢ finrank R (M →ₗ[R] N) = finrank R M * finrank R N

Next tactic:
have h := LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)
/-- The finrank of `M →ₗ[R] N` is `(finrank R M) * (finrank R N)`. -/
theorem FiniteDimensional.finrank_linearMap :
    finrank R (M →ₗ[R] N) = finrank R M * finrank R N := by
  classical
    letI := nontrivial_of_invariantBasisNumber R
    have h := LinearMap.toMatrix (chooseBasis R M) (chooseBasis R N)
    

Proof state:
R : Type u
M : Type v
N : Type w
inst✝⁹ : CommRing R
inst✝⁸ : StrongRankCondition R
inst✝⁷ : AddCommGroup M
inst✝⁶ : Module R M
inst✝⁵ : Module.Free R M
inst✝⁴ : Module.Finite R M
inst✝³ : AddCommGroup N
inst✝² : Module R N
inst✝¹ : Module.Free R N
inst✝ : Module.Finite R N
this : Nontrivial R := nontrivial_of_invariantBasisNumber R
h : (M →ₗ[R] N) ≃ₗ[R] Matrix (Module.Free.ChooseBasisIndex R N) (Module.Free.ChooseBasisIndex R M) R
⊢ finrank R (M →ₗ[R] N) = finrank R M * finrank R N

Next tactic:
simp_rw [h.finrank_eq, FiniteDimensional.finrank_matrix,
      FiniteDimensional.finrank_eq_card_chooseBasisIndex, mul_comm]
theorem Matrix.rank_vecMulVec {K m n : Type u} [CommRing K] [StrongRankCondition K] [Fintype n]
    [DecidableEq n] (w : m → K) (v : n → K) : (Matrix.vecMulVec w v).toLin'.rank ≤ 1 := by
  

Proof state:
R : Type u
M : Type v
N : Type w
K m n : Type u
inst✝³ : CommRing K
inst✝² : StrongRankCondition K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
w : m → K
v : n → K
⊢ LinearMap.rank (toLin' (vecMulVec w v)) ≤ 1

Next tactic:
rw [Matrix.vecMulVec_eq, Matrix.toLin'_mul]
theorem Matrix.rank_vecMulVec {K m n : Type u} [CommRing K] [StrongRankCondition K] [Fintype n]
    [DecidableEq n] (w : m → K) (v : n → K) : (Matrix.vecMulVec w v).toLin'.rank ≤ 1 := by
  rw [Matrix.vecMulVec_eq, Matrix.toLin'_mul]
  

Proof state:
R : Type u
M : Type v
N : Type w
K m n : Type u
inst✝³ : CommRing K
inst✝² : StrongRankCondition K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
w : m → K
v : n → K
⊢ LinearMap.rank (toLin' (col w) ∘ₗ toLin' (row v)) ≤ 1

Next tactic:
refine' le_trans (LinearMap.rank_comp_le_left _ _) _
theorem Matrix.rank_vecMulVec {K m n : Type u} [CommRing K] [StrongRankCondition K] [Fintype n]
    [DecidableEq n] (w : m → K) (v : n → K) : (Matrix.vecMulVec w v).toLin'.rank ≤ 1 := by
  rw [Matrix.vecMulVec_eq, Matrix.toLin'_mul]
  refine' le_trans (LinearMap.rank_comp_le_left _ _) _
  

Proof state:
R : Type u
M : Type v
N : Type w
K m n : Type u
inst✝³ : CommRing K
inst✝² : StrongRankCondition K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
w : m → K
v : n → K
⊢ LinearMap.rank (toLin' (col w)) ≤ 1

Next tactic:
refine' (LinearMap.rank_le_domain _).trans_eq _
theorem Matrix.rank_vecMulVec {K m n : Type u} [CommRing K] [StrongRankCondition K] [Fintype n]
    [DecidableEq n] (w : m → K) (v : n → K) : (Matrix.vecMulVec w v).toLin'.rank ≤ 1 := by
  rw [Matrix.vecMulVec_eq, Matrix.toLin'_mul]
  refine' le_trans (LinearMap.rank_comp_le_left _ _) _
  refine' (LinearMap.rank_le_domain _).trans_eq _
  

Proof state:
R : Type u
M : Type v
N : Type w
K m n : Type u
inst✝³ : CommRing K
inst✝² : StrongRankCondition K
inst✝¹ : Fintype n
inst✝ : DecidableEq n
w : m → K
v : n → K
⊢ Module.rank K (Unit → K) = 1

Next tactic:
rw [rank_fun', Fintype.card_unit, Nat.cast_one]
@[to_additive]
theorem le_map_mul_map_div [Group α] [CommSemigroup β] [LE β] [SubmultiplicativeHomClass F α β]
    (f : F) (a b : α) : f a ≤ f b * f (a / b) := by
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝³ : Group α
inst✝² : CommSemigroup β
inst✝¹ : LE β
inst✝ : SubmultiplicativeHomClass F α β
f : F
a b : α
⊢ f a ≤ f b * f (a / b)

Next tactic:
simpa only [mul_comm, div_mul_cancel'] using map_mul_le_mul f (a / b) b
@[to_additive existing]
theorem le_map_add_map_div [Group α] [AddCommSemigroup β] [LE β] [MulLEAddHomClass F α β] (f : F)
    (a b : α) : f a ≤ f b + f (a / b) := by
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝³ : Group α
inst✝² : AddCommSemigroup β
inst✝¹ : LE β
inst✝ : MulLEAddHomClass F α β
f : F
a b : α
⊢ f a ≤ f b + f (a / b)

Next tactic:
simpa only [add_comm, div_mul_cancel'] using map_mul_le_add f (a / b) b
@[to_additive]
theorem le_map_div_mul_map_div [Group α] [CommSemigroup β] [LE β] [SubmultiplicativeHomClass F α β]
    (f : F) (a b c : α) : f (a / c) ≤ f (a / b) * f (b / c) := by
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝³ : Group α
inst✝² : CommSemigroup β
inst✝¹ : LE β
inst✝ : SubmultiplicativeHomClass F α β
f : F
a b c : α
⊢ f (a / c) ≤ f (a / b) * f (b / c)

Next tactic:
simpa only [div_mul_div_cancel'] using map_mul_le_mul f (a / b) (b / c)
@[to_additive existing]
theorem le_map_div_add_map_div [Group α] [AddCommSemigroup β] [LE β] [MulLEAddHomClass F α β]
    (f : F) (a b c : α) : f (a / c) ≤ f (a / b) + f (b / c) := by
    

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝³ : Group α
inst✝² : AddCommSemigroup β
inst✝¹ : LE β
inst✝ : MulLEAddHomClass F α β
f : F
a b c : α
⊢ f (a / c) ≤ f (a / b) + f (b / c)

Next tactic:
simpa only [div_mul_div_cancel'] using map_mul_le_add f (a / b) (b / c)
@[to_additive]
theorem map_div_le_add : f (x / y) ≤ f x + f y := by
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : OrderedAddCommMonoid β
inst✝ : GroupSeminormClass F α β
f : F
x y : α
⊢ f (x / y) ≤ f x + f y

Next tactic:
rw [div_eq_mul_inv, ← map_inv_eq_map f y]
@[to_additive]
theorem map_div_le_add : f (x / y) ≤ f x + f y := by
  rw [div_eq_mul_inv, ← map_inv_eq_map f y]
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : OrderedAddCommMonoid β
inst✝ : GroupSeminormClass F α β
f : F
x y : α
⊢ f (x * y⁻¹) ≤ f x + f y⁻¹

Next tactic:
exact map_mul_le_add _ _ _
@[to_additive]
theorem map_div_rev : f (x / y) = f (y / x) := by 

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : OrderedAddCommMonoid β
inst✝ : GroupSeminormClass F α β
f : F
x y : α
⊢ f (x / y) = f (y / x)

Next tactic:
rw [← inv_div, map_inv_eq_map]
@[to_additive]
theorem le_map_add_map_div' : f x ≤ f y + f (y / x) := by
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : OrderedAddCommMonoid β
inst✝ : GroupSeminormClass F α β
f : F
x y : α
⊢ f x ≤ f y + f (y / x)

Next tactic:
simpa only [add_comm, map_div_rev, div_mul_cancel'] using map_mul_le_add f (x / y) y
@[to_additive]
theorem abs_sub_map_le_div [Group α] [LinearOrderedAddCommGroup β] [GroupSeminormClass F α β]
    (f : F) (x y : α) : |f x - f y| ≤ f (x / y) := by
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : LinearOrderedAddCommGroup β
inst✝ : GroupSeminormClass F α β
f : F
x y : α
⊢ |f x - f y| ≤ f (x / y)

Next tactic:
rw [abs_sub_le_iff, sub_le_iff_le_add', sub_le_iff_le_add']
@[to_additive]
theorem abs_sub_map_le_div [Group α] [LinearOrderedAddCommGroup β] [GroupSeminormClass F α β]
    (f : F) (x y : α) : |f x - f y| ≤ f (x / y) := by
  rw [abs_sub_le_iff, sub_le_iff_le_add', sub_le_iff_le_add']
  

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : LinearOrderedAddCommGroup β
inst✝ : GroupSeminormClass F α β
f : F
x y : α
⊢ f x ≤ f y + f (x / y) ∧ f y ≤ f x + f (x / y)

Next tactic:
exact ⟨le_map_add_map_div _ _ _, le_map_add_map_div' _ _ _⟩
@[to_additive]
instance (priority := 100) GroupSeminormClass.toNonnegHomClass [Group α]
    [LinearOrderedAddCommMonoid β] [GroupSeminormClass F α β] : NonnegHomClass F α β :=
  { ‹GroupSeminormClass F α β› with
    map_nonneg := fun f a =>
      (nsmul_nonneg_iff two_ne_zero).1 <| by
        

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : LinearOrderedAddCommMonoid β
inst✝ : GroupSeminormClass F α β
src✝ : GroupSeminormClass F α β := inst✝
f : F
a : α
⊢ 0 ≤ 2 • f a

Next tactic:
rw [two_nsmul, ← map_one_eq_zero f, ← div_self' a]
@[to_additive]
instance (priority := 100) GroupSeminormClass.toNonnegHomClass [Group α]
    [LinearOrderedAddCommMonoid β] [GroupSeminormClass F α β] : NonnegHomClass F α β :=
  { ‹GroupSeminormClass F α β› with
    map_nonneg := fun f a =>
      (nsmul_nonneg_iff two_ne_zero).1 <| by
        rw [two_nsmul, ← map_one_eq_zero f, ← div_self' a]
        

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : LinearOrderedAddCommMonoid β
inst✝ : GroupSeminormClass F α β
src✝ : GroupSeminormClass F α β := inst✝
f : F
a : α
⊢ f (a / a) ≤ f a + f a

Next tactic:
exact map_div_le_add _ _ _
@[to_additive (attr := simp)]
theorem map_eq_zero_iff_eq_one : f x = 0 ↔ x = 1 :=
  ⟨eq_one_of_map_eq_zero _, by
    

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : OrderedAddCommMonoid β
inst✝ : GroupNormClass F α β
f : F
x : α
⊢ x = 1 → f x = 0

Next tactic:
rintro rfl
@[to_additive (attr := simp)]
theorem map_eq_zero_iff_eq_one : f x = 0 ↔ x = 1 :=
  ⟨eq_one_of_map_eq_zero _, by
    rintro rfl
    

Proof state:
ι : Type u_1
F : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
δ : Type u_6
inst✝² : Group α
inst✝¹ : OrderedAddCommMonoid β
inst✝ : GroupNormClass F α β
f : F
⊢ f 1 = 0

Next tactic:
exact map_one_eq_zero _