Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
rank
int64
0
2.4k
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width
Mathlib/Data/Matrix/Rank.lean
71
74
theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by
rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _)
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_left Matrix.rank_mul_le_left
Mathlib/Data/Matrix/Rank.lean
77
81
theorem rank_mul_le_right [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ B.rank := by
rw [rank, rank, mulVecLin_mul] exact finrank_le_finrank_of_rank_le_rank (LinearMap.lift_rank_comp_le_right _ _) (rank_lt_aleph0 _ _)
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_left Matrix.rank_mul_le_left theorem rank_mul_le_right [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ B.rank := by rw [rank, rank, mulVecLin_mul] exact finrank_le_finrank_of_rank_le_rank (LinearMap.lift_rank_comp_le_right _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_right Matrix.rank_mul_le_right theorem rank_mul_le [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ min A.rank B.rank := le_min (rank_mul_le_left _ _) (rank_mul_le_right _ _) #align matrix.rank_mul_le Matrix.rank_mul_le
Mathlib/Data/Matrix/Rank.lean
89
93
theorem rank_unit [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)Λ£) : (A : Matrix n n R).rank = Fintype.card n := by
apply le_antisymm (rank_le_card_width (A : Matrix n n R)) _ have := rank_mul_le_left (A : Matrix n n R) (↑A⁻¹ : Matrix n n R) rwa [← Units.val_mul, mul_inv_self, Units.val_one, rank_one] at this
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_left Matrix.rank_mul_le_left theorem rank_mul_le_right [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ B.rank := by rw [rank, rank, mulVecLin_mul] exact finrank_le_finrank_of_rank_le_rank (LinearMap.lift_rank_comp_le_right _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_right Matrix.rank_mul_le_right theorem rank_mul_le [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ min A.rank B.rank := le_min (rank_mul_le_left _ _) (rank_mul_le_right _ _) #align matrix.rank_mul_le Matrix.rank_mul_le theorem rank_unit [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)Λ£) : (A : Matrix n n R).rank = Fintype.card n := by apply le_antisymm (rank_le_card_width (A : Matrix n n R)) _ have := rank_mul_le_left (A : Matrix n n R) (↑A⁻¹ : Matrix n n R) rwa [← Units.val_mul, mul_inv_self, Units.val_one, rank_one] at this #align matrix.rank_unit Matrix.rank_unit
Mathlib/Data/Matrix/Rank.lean
96
99
theorem rank_of_isUnit [StrongRankCondition R] [DecidableEq n] (A : Matrix n n R) (h : IsUnit A) : A.rank = Fintype.card n := by
obtain ⟨A, rfl⟩ := h exact rank_unit A
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_left Matrix.rank_mul_le_left theorem rank_mul_le_right [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ B.rank := by rw [rank, rank, mulVecLin_mul] exact finrank_le_finrank_of_rank_le_rank (LinearMap.lift_rank_comp_le_right _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_right Matrix.rank_mul_le_right theorem rank_mul_le [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ min A.rank B.rank := le_min (rank_mul_le_left _ _) (rank_mul_le_right _ _) #align matrix.rank_mul_le Matrix.rank_mul_le theorem rank_unit [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)Λ£) : (A : Matrix n n R).rank = Fintype.card n := by apply le_antisymm (rank_le_card_width (A : Matrix n n R)) _ have := rank_mul_le_left (A : Matrix n n R) (↑A⁻¹ : Matrix n n R) rwa [← Units.val_mul, mul_inv_self, Units.val_one, rank_one] at this #align matrix.rank_unit Matrix.rank_unit theorem rank_of_isUnit [StrongRankCondition R] [DecidableEq n] (A : Matrix n n R) (h : IsUnit A) : A.rank = Fintype.card n := by obtain ⟨A, rfl⟩ := h exact rank_unit A #align matrix.rank_of_is_unit Matrix.rank_of_isUnit @[simp] lemma rank_mul_eq_left_of_isUnit_det [DecidableEq n] (A : Matrix n n R) (B : Matrix m n R) (hA : IsUnit A.det) : (B * A).rank = B.rank := by suffices Function.Surjective A.mulVecLin by rw [rank, mulVecLin_mul, LinearMap.range_comp_of_range_eq_top _ (LinearMap.range_eq_top.mpr this), ← rank] intro v exact ⟨(A⁻¹).mulVecLin v, by simp [mul_nonsing_inv _ hA]⟩ @[simp] lemma rank_mul_eq_right_of_isUnit_det [Fintype m] [DecidableEq m] (A : Matrix m m R) (B : Matrix m n R) (hA : IsUnit A.det) : (A * B).rank = B.rank := by let b : Basis m R (m β†’ R) := Pi.basisFun R m replace hA : IsUnit (LinearMap.toMatrix b b A.mulVecLin).det := by convert hA; rw [← LinearEquiv.eq_symm_apply]; rfl have hAB : mulVecLin (A * B) = (LinearEquiv.ofIsUnitDet hA).comp (mulVecLin B) := by ext; simp rw [rank, rank, hAB, LinearMap.range_comp, LinearEquiv.finrank_map_eq]
Mathlib/Data/Matrix/Rank.lean
125
130
theorem rank_submatrix_le [StrongRankCondition R] [Fintype m] (f : n β†’ m) (e : n ≃ m) (A : Matrix m m R) : rank (A.submatrix f e) ≀ rank A := by
rw [rank, rank, mulVecLin_submatrix, LinearMap.range_comp, LinearMap.range_comp, show LinearMap.funLeft R R e.symm = LinearEquiv.funCongrLeft R R e.symm from rfl, LinearEquiv.range, Submodule.map_top] exact Submodule.finrank_map_le _ _
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_left Matrix.rank_mul_le_left theorem rank_mul_le_right [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ B.rank := by rw [rank, rank, mulVecLin_mul] exact finrank_le_finrank_of_rank_le_rank (LinearMap.lift_rank_comp_le_right _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_right Matrix.rank_mul_le_right theorem rank_mul_le [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ min A.rank B.rank := le_min (rank_mul_le_left _ _) (rank_mul_le_right _ _) #align matrix.rank_mul_le Matrix.rank_mul_le theorem rank_unit [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)Λ£) : (A : Matrix n n R).rank = Fintype.card n := by apply le_antisymm (rank_le_card_width (A : Matrix n n R)) _ have := rank_mul_le_left (A : Matrix n n R) (↑A⁻¹ : Matrix n n R) rwa [← Units.val_mul, mul_inv_self, Units.val_one, rank_one] at this #align matrix.rank_unit Matrix.rank_unit theorem rank_of_isUnit [StrongRankCondition R] [DecidableEq n] (A : Matrix n n R) (h : IsUnit A) : A.rank = Fintype.card n := by obtain ⟨A, rfl⟩ := h exact rank_unit A #align matrix.rank_of_is_unit Matrix.rank_of_isUnit @[simp] lemma rank_mul_eq_left_of_isUnit_det [DecidableEq n] (A : Matrix n n R) (B : Matrix m n R) (hA : IsUnit A.det) : (B * A).rank = B.rank := by suffices Function.Surjective A.mulVecLin by rw [rank, mulVecLin_mul, LinearMap.range_comp_of_range_eq_top _ (LinearMap.range_eq_top.mpr this), ← rank] intro v exact ⟨(A⁻¹).mulVecLin v, by simp [mul_nonsing_inv _ hA]⟩ @[simp] lemma rank_mul_eq_right_of_isUnit_det [Fintype m] [DecidableEq m] (A : Matrix m m R) (B : Matrix m n R) (hA : IsUnit A.det) : (A * B).rank = B.rank := by let b : Basis m R (m β†’ R) := Pi.basisFun R m replace hA : IsUnit (LinearMap.toMatrix b b A.mulVecLin).det := by convert hA; rw [← LinearEquiv.eq_symm_apply]; rfl have hAB : mulVecLin (A * B) = (LinearEquiv.ofIsUnitDet hA).comp (mulVecLin B) := by ext; simp rw [rank, rank, hAB, LinearMap.range_comp, LinearEquiv.finrank_map_eq] theorem rank_submatrix_le [StrongRankCondition R] [Fintype m] (f : n β†’ m) (e : n ≃ m) (A : Matrix m m R) : rank (A.submatrix f e) ≀ rank A := by rw [rank, rank, mulVecLin_submatrix, LinearMap.range_comp, LinearMap.range_comp, show LinearMap.funLeft R R e.symm = LinearEquiv.funCongrLeft R R e.symm from rfl, LinearEquiv.range, Submodule.map_top] exact Submodule.finrank_map_le _ _ #align matrix.rank_submatrix_le Matrix.rank_submatrix_le
Mathlib/Data/Matrix/Rank.lean
133
136
theorem rank_reindex [Fintype m] (e₁ eβ‚‚ : m ≃ n) (A : Matrix m m R) : rank (reindex e₁ eβ‚‚ A) = rank A := by
rw [rank, rank, mulVecLin_reindex, LinearMap.range_comp, LinearMap.range_comp, LinearEquiv.range, Submodule.map_top, LinearEquiv.finrank_map_eq]
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section CommRing variable [CommRing R] noncomputable def rank (A : Matrix m n R) : β„• := finrank R <| LinearMap.range A.mulVecLin #align matrix.rank Matrix.rank @[simp] theorem rank_one [StrongRankCondition R] [DecidableEq n] : rank (1 : Matrix n n R) = Fintype.card n := by rw [rank, mulVecLin_one, LinearMap.range_id, finrank_top, finrank_pi] #align matrix.rank_one Matrix.rank_one @[simp] theorem rank_zero [Nontrivial R] : rank (0 : Matrix m n R) = 0 := by rw [rank, mulVecLin_zero, LinearMap.range_zero, finrank_bot] #align matrix.rank_zero Matrix.rank_zero theorem rank_le_card_width [StrongRankCondition R] (A : Matrix m n R) : A.rank ≀ Fintype.card n := by haveI : Module.Finite R (n β†’ R) := Module.Finite.pi haveI : Module.Free R (n β†’ R) := Module.Free.pi _ _ exact A.mulVecLin.finrank_range_le.trans_eq (finrank_pi _) #align matrix.rank_le_card_width Matrix.rank_le_card_width theorem rank_le_width [StrongRankCondition R] {m n : β„•} (A : Matrix (Fin m) (Fin n) R) : A.rank ≀ n := A.rank_le_card_width.trans <| (Fintype.card_fin n).le #align matrix.rank_le_width Matrix.rank_le_width theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ A.rank := by rw [rank, rank, mulVecLin_mul] exact Cardinal.toNat_le_toNat (LinearMap.rank_comp_le_left _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_left Matrix.rank_mul_le_left theorem rank_mul_le_right [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ B.rank := by rw [rank, rank, mulVecLin_mul] exact finrank_le_finrank_of_rank_le_rank (LinearMap.lift_rank_comp_le_right _ _) (rank_lt_aleph0 _ _) #align matrix.rank_mul_le_right Matrix.rank_mul_le_right theorem rank_mul_le [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) : (A * B).rank ≀ min A.rank B.rank := le_min (rank_mul_le_left _ _) (rank_mul_le_right _ _) #align matrix.rank_mul_le Matrix.rank_mul_le theorem rank_unit [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)Λ£) : (A : Matrix n n R).rank = Fintype.card n := by apply le_antisymm (rank_le_card_width (A : Matrix n n R)) _ have := rank_mul_le_left (A : Matrix n n R) (↑A⁻¹ : Matrix n n R) rwa [← Units.val_mul, mul_inv_self, Units.val_one, rank_one] at this #align matrix.rank_unit Matrix.rank_unit theorem rank_of_isUnit [StrongRankCondition R] [DecidableEq n] (A : Matrix n n R) (h : IsUnit A) : A.rank = Fintype.card n := by obtain ⟨A, rfl⟩ := h exact rank_unit A #align matrix.rank_of_is_unit Matrix.rank_of_isUnit @[simp] lemma rank_mul_eq_left_of_isUnit_det [DecidableEq n] (A : Matrix n n R) (B : Matrix m n R) (hA : IsUnit A.det) : (B * A).rank = B.rank := by suffices Function.Surjective A.mulVecLin by rw [rank, mulVecLin_mul, LinearMap.range_comp_of_range_eq_top _ (LinearMap.range_eq_top.mpr this), ← rank] intro v exact ⟨(A⁻¹).mulVecLin v, by simp [mul_nonsing_inv _ hA]⟩ @[simp] lemma rank_mul_eq_right_of_isUnit_det [Fintype m] [DecidableEq m] (A : Matrix m m R) (B : Matrix m n R) (hA : IsUnit A.det) : (A * B).rank = B.rank := by let b : Basis m R (m β†’ R) := Pi.basisFun R m replace hA : IsUnit (LinearMap.toMatrix b b A.mulVecLin).det := by convert hA; rw [← LinearEquiv.eq_symm_apply]; rfl have hAB : mulVecLin (A * B) = (LinearEquiv.ofIsUnitDet hA).comp (mulVecLin B) := by ext; simp rw [rank, rank, hAB, LinearMap.range_comp, LinearEquiv.finrank_map_eq] theorem rank_submatrix_le [StrongRankCondition R] [Fintype m] (f : n β†’ m) (e : n ≃ m) (A : Matrix m m R) : rank (A.submatrix f e) ≀ rank A := by rw [rank, rank, mulVecLin_submatrix, LinearMap.range_comp, LinearMap.range_comp, show LinearMap.funLeft R R e.symm = LinearEquiv.funCongrLeft R R e.symm from rfl, LinearEquiv.range, Submodule.map_top] exact Submodule.finrank_map_le _ _ #align matrix.rank_submatrix_le Matrix.rank_submatrix_le theorem rank_reindex [Fintype m] (e₁ eβ‚‚ : m ≃ n) (A : Matrix m m R) : rank (reindex e₁ eβ‚‚ A) = rank A := by rw [rank, rank, mulVecLin_reindex, LinearMap.range_comp, LinearMap.range_comp, LinearEquiv.range, Submodule.map_top, LinearEquiv.finrank_map_eq] #align matrix.rank_reindex Matrix.rank_reindex @[simp]
Mathlib/Data/Matrix/Rank.lean
140
142
theorem rank_submatrix [Fintype m] (A : Matrix m m R) (e₁ eβ‚‚ : n ≃ m) : rank (A.submatrix e₁ eβ‚‚) = rank A := by
simpa only [reindex_apply] using rank_reindex e₁.symm eβ‚‚.symm A
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section StarOrderedField variable [Fintype m] [Field R] [PartialOrder R] [StarRing R] [StarOrderedRing R]
Mathlib/Data/Matrix/Rank.lean
217
220
theorem ker_mulVecLin_conjTranspose_mul_self (A : Matrix m n R) : LinearMap.ker (Aα΄΄ * A).mulVecLin = LinearMap.ker (mulVecLin A) := by
ext x simp only [LinearMap.mem_ker, mulVecLin_apply, conjTranspose_mul_self_mulVec_eq_zero]
1,847
import Mathlib.LinearAlgebra.Matrix.DotProduct import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal #align_import data.matrix.rank from "leanprover-community/mathlib"@"17219820a8aa8abe85adf5dfde19af1dd1bd8ae7" open Matrix namespace Matrix open FiniteDimensional variable {l m n o R : Type*} [Fintype n] [Fintype o] section LinearOrderedField variable [Fintype m] [LinearOrderedField R]
Mathlib/Data/Matrix/Rank.lean
255
264
theorem ker_mulVecLin_transpose_mul_self (A : Matrix m n R) : LinearMap.ker (Aα΅€ * A).mulVecLin = LinearMap.ker (mulVecLin A) := by
ext x simp only [LinearMap.mem_ker, mulVecLin_apply, ← mulVec_mulVec] constructor Β· intro h replace h := congr_arg (dotProduct x) h rwa [dotProduct_mulVec, dotProduct_zero, vecMul_transpose, dotProduct_self_eq_zero] at h Β· intro h rw [h, mulVec_zero]
1,847
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp]
Mathlib/Analysis/Complex/Isometry.lean
60
62
theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by
ext1 simp
1,848
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans
Mathlib/Analysis/Complex/Isometry.lean
65
71
theorem rotation_ne_conjLIE (a : circle) : rotation a β‰  conjLIE := by
intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI
1,848
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans theorem rotation_ne_conjLIE (a : circle) : rotation a β‰  conjLIE := by intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI #align rotation_ne_conj_lie rotation_ne_conjLIE @[simps] def rotationOf (e : β„‚ ≃ₗᡒ[ℝ] β„‚) : circle := ⟨e 1 / Complex.abs (e 1), by simp⟩ #align rotation_of rotationOf @[simp] theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp #align rotation_of_rotation rotationOf_rotation theorem rotation_injective : Function.Injective rotation := Function.LeftInverse.injective rotationOf_rotation #align rotation_injective rotation_injective
Mathlib/Analysis/Complex/Isometry.lean
90
93
theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : β„‚ β†’β‚—α΅’[ℝ] β„‚) (h₃ : βˆ€ z, z + conj z = f z + conj (f z)) (z : β„‚) : (f z).re = z.re := by
simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul, show (2 : ℝ) β‰  0 by simp [two_ne_zero]] using (h₃ z).symm
1,848
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans theorem rotation_ne_conjLIE (a : circle) : rotation a β‰  conjLIE := by intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI #align rotation_ne_conj_lie rotation_ne_conjLIE @[simps] def rotationOf (e : β„‚ ≃ₗᡒ[ℝ] β„‚) : circle := ⟨e 1 / Complex.abs (e 1), by simp⟩ #align rotation_of rotationOf @[simp] theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp #align rotation_of_rotation rotationOf_rotation theorem rotation_injective : Function.Injective rotation := Function.LeftInverse.injective rotationOf_rotation #align rotation_injective rotation_injective theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : β„‚ β†’β‚—α΅’[ℝ] β„‚) (h₃ : βˆ€ z, z + conj z = f z + conj (f z)) (z : β„‚) : (f z).re = z.re := by simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul, show (2 : ℝ) β‰  0 by simp [two_ne_zero]] using (h₃ z).symm #align linear_isometry.re_apply_eq_re_of_add_conj_eq LinearIsometry.re_apply_eq_re_of_add_conj_eq
Mathlib/Analysis/Complex/Isometry.lean
96
101
theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (hβ‚‚ : βˆ€ z, (f z).re = z.re) (z : β„‚) : (f z).im = z.im ∨ (f z).im = -z.im := by
have h₁ := f.norm_map z simp only [Complex.abs_def, norm_eq_abs] at h₁ rwa [Real.sqrt_inj (normSq_nonneg _) (normSq_nonneg _), normSq_apply (f z), normSq_apply z, hβ‚‚, add_left_cancel_iff, mul_self_eq_mul_self_iff] at h₁
1,848
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans theorem rotation_ne_conjLIE (a : circle) : rotation a β‰  conjLIE := by intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI #align rotation_ne_conj_lie rotation_ne_conjLIE @[simps] def rotationOf (e : β„‚ ≃ₗᡒ[ℝ] β„‚) : circle := ⟨e 1 / Complex.abs (e 1), by simp⟩ #align rotation_of rotationOf @[simp] theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp #align rotation_of_rotation rotationOf_rotation theorem rotation_injective : Function.Injective rotation := Function.LeftInverse.injective rotationOf_rotation #align rotation_injective rotation_injective theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : β„‚ β†’β‚—α΅’[ℝ] β„‚) (h₃ : βˆ€ z, z + conj z = f z + conj (f z)) (z : β„‚) : (f z).re = z.re := by simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul, show (2 : ℝ) β‰  0 by simp [two_ne_zero]] using (h₃ z).symm #align linear_isometry.re_apply_eq_re_of_add_conj_eq LinearIsometry.re_apply_eq_re_of_add_conj_eq theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (hβ‚‚ : βˆ€ z, (f z).re = z.re) (z : β„‚) : (f z).im = z.im ∨ (f z).im = -z.im := by have h₁ := f.norm_map z simp only [Complex.abs_def, norm_eq_abs] at h₁ rwa [Real.sqrt_inj (normSq_nonneg _) (normSq_nonneg _), normSq_apply (f z), normSq_apply z, hβ‚‚, add_left_cancel_iff, mul_self_eq_mul_self_iff] at h₁ #align linear_isometry.im_apply_eq_im_or_neg_of_re_apply_eq_re LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re
Mathlib/Analysis/Complex/Isometry.lean
104
116
theorem LinearIsometry.im_apply_eq_im {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (h : f 1 = 1) (z : β„‚) : z + conj z = f z + conj (f z) := by
have : β€–f z - 1β€– = β€–z - 1β€– := by rw [← f.norm_map (z - 1), f.map_sub, h] apply_fun fun x => x ^ 2 at this simp only [norm_eq_abs, ← normSq_eq_abs] at this rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this rw [RingHom.map_sub, RingHom.map_sub] at this simp only [sub_mul, mul_sub, one_mul, mul_one] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs, LinearIsometry.norm_map] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs] at this simp only [sub_sub, sub_right_inj, mul_one, ofReal_pow, RingHom.map_one, norm_eq_abs] at this simp only [add_sub, sub_left_inj] at this rw [add_comm, ← this, add_comm]
1,848
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans theorem rotation_ne_conjLIE (a : circle) : rotation a β‰  conjLIE := by intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI #align rotation_ne_conj_lie rotation_ne_conjLIE @[simps] def rotationOf (e : β„‚ ≃ₗᡒ[ℝ] β„‚) : circle := ⟨e 1 / Complex.abs (e 1), by simp⟩ #align rotation_of rotationOf @[simp] theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp #align rotation_of_rotation rotationOf_rotation theorem rotation_injective : Function.Injective rotation := Function.LeftInverse.injective rotationOf_rotation #align rotation_injective rotation_injective theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : β„‚ β†’β‚—α΅’[ℝ] β„‚) (h₃ : βˆ€ z, z + conj z = f z + conj (f z)) (z : β„‚) : (f z).re = z.re := by simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul, show (2 : ℝ) β‰  0 by simp [two_ne_zero]] using (h₃ z).symm #align linear_isometry.re_apply_eq_re_of_add_conj_eq LinearIsometry.re_apply_eq_re_of_add_conj_eq theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (hβ‚‚ : βˆ€ z, (f z).re = z.re) (z : β„‚) : (f z).im = z.im ∨ (f z).im = -z.im := by have h₁ := f.norm_map z simp only [Complex.abs_def, norm_eq_abs] at h₁ rwa [Real.sqrt_inj (normSq_nonneg _) (normSq_nonneg _), normSq_apply (f z), normSq_apply z, hβ‚‚, add_left_cancel_iff, mul_self_eq_mul_self_iff] at h₁ #align linear_isometry.im_apply_eq_im_or_neg_of_re_apply_eq_re LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re theorem LinearIsometry.im_apply_eq_im {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (h : f 1 = 1) (z : β„‚) : z + conj z = f z + conj (f z) := by have : β€–f z - 1β€– = β€–z - 1β€– := by rw [← f.norm_map (z - 1), f.map_sub, h] apply_fun fun x => x ^ 2 at this simp only [norm_eq_abs, ← normSq_eq_abs] at this rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this rw [RingHom.map_sub, RingHom.map_sub] at this simp only [sub_mul, mul_sub, one_mul, mul_one] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs, LinearIsometry.norm_map] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs] at this simp only [sub_sub, sub_right_inj, mul_one, ofReal_pow, RingHom.map_one, norm_eq_abs] at this simp only [add_sub, sub_left_inj] at this rw [add_comm, ← this, add_comm] #align linear_isometry.im_apply_eq_im LinearIsometry.im_apply_eq_im
Mathlib/Analysis/Complex/Isometry.lean
119
122
theorem LinearIsometry.re_apply_eq_re {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (h : f 1 = 1) (z : β„‚) : (f z).re = z.re := by
apply LinearIsometry.re_apply_eq_re_of_add_conj_eq intro z apply LinearIsometry.im_apply_eq_im h
1,848
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle β†’* β„‚ ≃ₗᡒ[ℝ] β„‚ where toFun a := { DistribMulAction.toLinearEquiv ℝ β„‚ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : β„‚) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans theorem rotation_ne_conjLIE (a : circle) : rotation a β‰  conjLIE := by intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI #align rotation_ne_conj_lie rotation_ne_conjLIE @[simps] def rotationOf (e : β„‚ ≃ₗᡒ[ℝ] β„‚) : circle := ⟨e 1 / Complex.abs (e 1), by simp⟩ #align rotation_of rotationOf @[simp] theorem rotationOf_rotation (a : circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp #align rotation_of_rotation rotationOf_rotation theorem rotation_injective : Function.Injective rotation := Function.LeftInverse.injective rotationOf_rotation #align rotation_injective rotation_injective theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : β„‚ β†’β‚—α΅’[ℝ] β„‚) (h₃ : βˆ€ z, z + conj z = f z + conj (f z)) (z : β„‚) : (f z).re = z.re := by simpa [ext_iff, add_re, add_im, conj_re, conj_im, ← two_mul, show (2 : ℝ) β‰  0 by simp [two_ne_zero]] using (h₃ z).symm #align linear_isometry.re_apply_eq_re_of_add_conj_eq LinearIsometry.re_apply_eq_re_of_add_conj_eq theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (hβ‚‚ : βˆ€ z, (f z).re = z.re) (z : β„‚) : (f z).im = z.im ∨ (f z).im = -z.im := by have h₁ := f.norm_map z simp only [Complex.abs_def, norm_eq_abs] at h₁ rwa [Real.sqrt_inj (normSq_nonneg _) (normSq_nonneg _), normSq_apply (f z), normSq_apply z, hβ‚‚, add_left_cancel_iff, mul_self_eq_mul_self_iff] at h₁ #align linear_isometry.im_apply_eq_im_or_neg_of_re_apply_eq_re LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re theorem LinearIsometry.im_apply_eq_im {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (h : f 1 = 1) (z : β„‚) : z + conj z = f z + conj (f z) := by have : β€–f z - 1β€– = β€–z - 1β€– := by rw [← f.norm_map (z - 1), f.map_sub, h] apply_fun fun x => x ^ 2 at this simp only [norm_eq_abs, ← normSq_eq_abs] at this rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this rw [RingHom.map_sub, RingHom.map_sub] at this simp only [sub_mul, mul_sub, one_mul, mul_one] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs, LinearIsometry.norm_map] at this rw [mul_conj, normSq_eq_abs, ← norm_eq_abs] at this simp only [sub_sub, sub_right_inj, mul_one, ofReal_pow, RingHom.map_one, norm_eq_abs] at this simp only [add_sub, sub_left_inj] at this rw [add_comm, ← this, add_comm] #align linear_isometry.im_apply_eq_im LinearIsometry.im_apply_eq_im theorem LinearIsometry.re_apply_eq_re {f : β„‚ β†’β‚—α΅’[ℝ] β„‚} (h : f 1 = 1) (z : β„‚) : (f z).re = z.re := by apply LinearIsometry.re_apply_eq_re_of_add_conj_eq intro z apply LinearIsometry.im_apply_eq_im h #align linear_isometry.re_apply_eq_re LinearIsometry.re_apply_eq_re
Mathlib/Analysis/Complex/Isometry.lean
125
139
theorem linear_isometry_complex_aux {f : β„‚ ≃ₗᡒ[ℝ] β„‚} (h : f 1 = 1) : f = LinearIsometryEquiv.refl ℝ β„‚ ∨ f = conjLIE := by
have h0 : f I = I ∨ f I = -I := by simp only [ext_iff, ← and_or_left, neg_re, I_re, neg_im, neg_zero] constructor Β· rw [← I_re] exact @LinearIsometry.re_apply_eq_re f.toLinearIsometry h I Β· apply @LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re f.toLinearIsometry intro z rw [@LinearIsometry.re_apply_eq_re f.toLinearIsometry h] refine h0.imp (fun h' : f I = I => ?_) fun h' : f I = -I => ?_ <;> Β· apply LinearIsometryEquiv.toLinearEquiv_injective apply Complex.basisOneI.ext' intro i fin_cases i <;> simp [h, h']
1,848
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse #align_import linear_algebra.symplectic_group from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Matrix variable {l R : Type*} namespace Matrix variable (l) [DecidableEq l] (R) [CommRing R] section JMatrixLemmas def J : Matrix (Sum l l) (Sum l l) R := Matrix.fromBlocks 0 (-1) 1 0 set_option linter.uppercaseLean3 false in #align matrix.J Matrix.J @[simp]
Mathlib/LinearAlgebra/SymplecticGroup.lean
43
46
theorem J_transpose : (J l R)α΅€ = -J l R := by
rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l βŠ• l) (l βŠ• l) R), fromBlocks_smul, Matrix.transpose_zero, Matrix.transpose_one, transpose_neg] simp [fromBlocks]
1,849
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse #align_import linear_algebra.symplectic_group from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Matrix variable {l R : Type*} namespace Matrix variable (l) [DecidableEq l] (R) [CommRing R] section JMatrixLemmas def J : Matrix (Sum l l) (Sum l l) R := Matrix.fromBlocks 0 (-1) 1 0 set_option linter.uppercaseLean3 false in #align matrix.J Matrix.J @[simp] theorem J_transpose : (J l R)α΅€ = -J l R := by rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l βŠ• l) (l βŠ• l) R), fromBlocks_smul, Matrix.transpose_zero, Matrix.transpose_one, transpose_neg] simp [fromBlocks] set_option linter.uppercaseLean3 false in #align matrix.J_transpose Matrix.J_transpose variable [Fintype l]
Mathlib/LinearAlgebra/SymplecticGroup.lean
52
55
theorem J_squared : J l R * J l R = -1 := by
rw [J, fromBlocks_multiply] simp only [Matrix.zero_mul, Matrix.neg_mul, zero_add, neg_zero, Matrix.one_mul, add_zero] rw [← neg_zero, ← Matrix.fromBlocks_neg, ← fromBlocks_one]
1,849
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse #align_import linear_algebra.symplectic_group from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Matrix variable {l R : Type*} namespace Matrix variable (l) [DecidableEq l] (R) [CommRing R] section JMatrixLemmas def J : Matrix (Sum l l) (Sum l l) R := Matrix.fromBlocks 0 (-1) 1 0 set_option linter.uppercaseLean3 false in #align matrix.J Matrix.J @[simp] theorem J_transpose : (J l R)α΅€ = -J l R := by rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l βŠ• l) (l βŠ• l) R), fromBlocks_smul, Matrix.transpose_zero, Matrix.transpose_one, transpose_neg] simp [fromBlocks] set_option linter.uppercaseLean3 false in #align matrix.J_transpose Matrix.J_transpose variable [Fintype l] theorem J_squared : J l R * J l R = -1 := by rw [J, fromBlocks_multiply] simp only [Matrix.zero_mul, Matrix.neg_mul, zero_add, neg_zero, Matrix.one_mul, add_zero] rw [← neg_zero, ← Matrix.fromBlocks_neg, ← fromBlocks_one] set_option linter.uppercaseLean3 false in #align matrix.J_squared Matrix.J_squared
Mathlib/LinearAlgebra/SymplecticGroup.lean
59
62
theorem J_inv : (J l R)⁻¹ = -J l R := by
refine Matrix.inv_eq_right_inv ?_ rw [Matrix.mul_neg, J_squared] exact neg_neg 1
1,849
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse #align_import linear_algebra.symplectic_group from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Matrix variable {l R : Type*} namespace Matrix variable (l) [DecidableEq l] (R) [CommRing R] section JMatrixLemmas def J : Matrix (Sum l l) (Sum l l) R := Matrix.fromBlocks 0 (-1) 1 0 set_option linter.uppercaseLean3 false in #align matrix.J Matrix.J @[simp] theorem J_transpose : (J l R)α΅€ = -J l R := by rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l βŠ• l) (l βŠ• l) R), fromBlocks_smul, Matrix.transpose_zero, Matrix.transpose_one, transpose_neg] simp [fromBlocks] set_option linter.uppercaseLean3 false in #align matrix.J_transpose Matrix.J_transpose variable [Fintype l] theorem J_squared : J l R * J l R = -1 := by rw [J, fromBlocks_multiply] simp only [Matrix.zero_mul, Matrix.neg_mul, zero_add, neg_zero, Matrix.one_mul, add_zero] rw [← neg_zero, ← Matrix.fromBlocks_neg, ← fromBlocks_one] set_option linter.uppercaseLean3 false in #align matrix.J_squared Matrix.J_squared theorem J_inv : (J l R)⁻¹ = -J l R := by refine Matrix.inv_eq_right_inv ?_ rw [Matrix.mul_neg, J_squared] exact neg_neg 1 set_option linter.uppercaseLean3 false in #align matrix.J_inv Matrix.J_inv
Mathlib/LinearAlgebra/SymplecticGroup.lean
66
70
theorem J_det_mul_J_det : det (J l R) * det (J l R) = 1 := by
rw [← det_mul, J_squared, ← one_smul R (-1 : Matrix _ _ R), smul_neg, ← neg_smul, det_smul, Fintype.card_sum, det_one, mul_one] apply Even.neg_one_pow exact even_add_self _
1,849
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer #align_import linear_algebra.matrix.to_linear_equiv from "leanprover-community/mathlib"@"e42cfdb03b7902f8787a1eb552cb8f77766b45b9" variable {n : Type*} [Fintype n] namespace Matrix section LinearEquiv open LinearMap variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] section Nondegenerate open Matrix
Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean
114
132
theorem exists_mulVec_eq_zero_iff_aux {K : Type*} [DecidableEq n] [Field K] {M : Matrix n n K} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by
constructor Β· rintro ⟨v, hv, mul_eq⟩ contrapose! hv exact eq_zero_of_mulVec_eq_zero hv mul_eq Β· contrapose! intro h have : Function.Injective (Matrix.toLin' M) := by simpa only [← LinearMap.ker_eq_bot, ker_toLin'_eq_bot_iff, not_imp_not] using h have : M * LinearMap.toMatrix' ((LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).symm : (n β†’ K) β†’β‚—[K] n β†’ K) = 1 := by refine Matrix.toLin'.injective (LinearMap.ext fun v => ?_) rw [Matrix.toLin'_mul, Matrix.toLin'_one, Matrix.toLin'_toMatrix', LinearMap.comp_apply] exact (LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).apply_symm_apply v exact Matrix.det_ne_zero_of_right_inverse this
1,850
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer #align_import linear_algebra.matrix.to_linear_equiv from "leanprover-community/mathlib"@"e42cfdb03b7902f8787a1eb552cb8f77766b45b9" variable {n : Type*} [Fintype n] namespace Matrix section LinearEquiv open LinearMap variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] section Nondegenerate open Matrix theorem exists_mulVec_eq_zero_iff_aux {K : Type*} [DecidableEq n] [Field K] {M : Matrix n n K} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by constructor Β· rintro ⟨v, hv, mul_eq⟩ contrapose! hv exact eq_zero_of_mulVec_eq_zero hv mul_eq Β· contrapose! intro h have : Function.Injective (Matrix.toLin' M) := by simpa only [← LinearMap.ker_eq_bot, ker_toLin'_eq_bot_iff, not_imp_not] using h have : M * LinearMap.toMatrix' ((LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).symm : (n β†’ K) β†’β‚—[K] n β†’ K) = 1 := by refine Matrix.toLin'.injective (LinearMap.ext fun v => ?_) rw [Matrix.toLin'_mul, Matrix.toLin'_one, Matrix.toLin'_toMatrix', LinearMap.comp_apply] exact (LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).apply_symm_apply v exact Matrix.det_ne_zero_of_right_inverse this #align matrix.exists_mul_vec_eq_zero_iff_aux Matrix.exists_mulVec_eq_zero_iff_aux
Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean
135
167
theorem exists_mulVec_eq_zero_iff' {A : Type*} (K : Type*) [DecidableEq n] [CommRing A] [Nontrivial A] [Field K] [Algebra A K] [IsFractionRing A K] {M : Matrix n n A} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by
have : (βˆƒ v β‰  0, (algebraMap A K).mapMatrix M *α΅₯ v = 0) ↔ _ := exists_mulVec_eq_zero_iff_aux rw [← RingHom.map_det, IsFractionRing.to_map_eq_zero_iff] at this refine Iff.trans ?_ this; constructor <;> rintro ⟨v, hv, mul_eq⟩ Β· refine ⟨fun i => algebraMap _ _ (v i), mt (fun h => funext fun i => ?_) hv, ?_⟩ Β· exact IsFractionRing.to_map_eq_zero_iff.mp (congr_fun h i) Β· ext i refine (RingHom.map_mulVec _ _ _ i).symm.trans ?_ rw [mul_eq, Pi.zero_apply, RingHom.map_zero, Pi.zero_apply] Β· letI := Classical.decEq K obtain ⟨⟨b, hb⟩, ba_eq⟩ := IsLocalization.exist_integer_multiples_of_finset (nonZeroDivisors A) (Finset.univ.image v) choose f hf using ba_eq refine ⟨fun i => f _ (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩), mt (fun h => funext fun i => ?_) hv, ?_⟩ Β· have := congr_arg (algebraMap A K) (congr_fun h i) rw [hf, Subtype.coe_mk, Pi.zero_apply, RingHom.map_zero, Algebra.smul_def, mul_eq_zero, IsFractionRing.to_map_eq_zero_iff] at this exact this.resolve_left (nonZeroDivisors.ne_zero hb) Β· ext i refine IsFractionRing.injective A K ?_ calc algebraMap A K ((M *α΅₯ (fun i : n => f (v i) _)) i) = ((algebraMap A K).mapMatrix M *α΅₯ algebraMap _ K b β€’ v) i := ?_ _ = 0 := ?_ _ = algebraMap A K 0 := (RingHom.map_zero _).symm Β· simp_rw [RingHom.map_mulVec, mulVec, dotProduct, Function.comp_apply, hf, RingHom.mapMatrix_apply, Pi.smul_apply, smul_eq_mul, Algebra.smul_def] Β· rw [mulVec_smul, mul_eq, Pi.smul_apply, Pi.zero_apply, smul_zero]
1,850
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer #align_import linear_algebra.matrix.to_linear_equiv from "leanprover-community/mathlib"@"e42cfdb03b7902f8787a1eb552cb8f77766b45b9" variable {n : Type*} [Fintype n] namespace Matrix section LinearEquiv open LinearMap variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] section Nondegenerate open Matrix theorem exists_mulVec_eq_zero_iff_aux {K : Type*} [DecidableEq n] [Field K] {M : Matrix n n K} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by constructor Β· rintro ⟨v, hv, mul_eq⟩ contrapose! hv exact eq_zero_of_mulVec_eq_zero hv mul_eq Β· contrapose! intro h have : Function.Injective (Matrix.toLin' M) := by simpa only [← LinearMap.ker_eq_bot, ker_toLin'_eq_bot_iff, not_imp_not] using h have : M * LinearMap.toMatrix' ((LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).symm : (n β†’ K) β†’β‚—[K] n β†’ K) = 1 := by refine Matrix.toLin'.injective (LinearMap.ext fun v => ?_) rw [Matrix.toLin'_mul, Matrix.toLin'_one, Matrix.toLin'_toMatrix', LinearMap.comp_apply] exact (LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).apply_symm_apply v exact Matrix.det_ne_zero_of_right_inverse this #align matrix.exists_mul_vec_eq_zero_iff_aux Matrix.exists_mulVec_eq_zero_iff_aux theorem exists_mulVec_eq_zero_iff' {A : Type*} (K : Type*) [DecidableEq n] [CommRing A] [Nontrivial A] [Field K] [Algebra A K] [IsFractionRing A K] {M : Matrix n n A} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by have : (βˆƒ v β‰  0, (algebraMap A K).mapMatrix M *α΅₯ v = 0) ↔ _ := exists_mulVec_eq_zero_iff_aux rw [← RingHom.map_det, IsFractionRing.to_map_eq_zero_iff] at this refine Iff.trans ?_ this; constructor <;> rintro ⟨v, hv, mul_eq⟩ Β· refine ⟨fun i => algebraMap _ _ (v i), mt (fun h => funext fun i => ?_) hv, ?_⟩ Β· exact IsFractionRing.to_map_eq_zero_iff.mp (congr_fun h i) Β· ext i refine (RingHom.map_mulVec _ _ _ i).symm.trans ?_ rw [mul_eq, Pi.zero_apply, RingHom.map_zero, Pi.zero_apply] Β· letI := Classical.decEq K obtain ⟨⟨b, hb⟩, ba_eq⟩ := IsLocalization.exist_integer_multiples_of_finset (nonZeroDivisors A) (Finset.univ.image v) choose f hf using ba_eq refine ⟨fun i => f _ (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩), mt (fun h => funext fun i => ?_) hv, ?_⟩ Β· have := congr_arg (algebraMap A K) (congr_fun h i) rw [hf, Subtype.coe_mk, Pi.zero_apply, RingHom.map_zero, Algebra.smul_def, mul_eq_zero, IsFractionRing.to_map_eq_zero_iff] at this exact this.resolve_left (nonZeroDivisors.ne_zero hb) Β· ext i refine IsFractionRing.injective A K ?_ calc algebraMap A K ((M *α΅₯ (fun i : n => f (v i) _)) i) = ((algebraMap A K).mapMatrix M *α΅₯ algebraMap _ K b β€’ v) i := ?_ _ = 0 := ?_ _ = algebraMap A K 0 := (RingHom.map_zero _).symm Β· simp_rw [RingHom.map_mulVec, mulVec, dotProduct, Function.comp_apply, hf, RingHom.mapMatrix_apply, Pi.smul_apply, smul_eq_mul, Algebra.smul_def] Β· rw [mulVec_smul, mul_eq, Pi.smul_apply, Pi.zero_apply, smul_zero] #align matrix.exists_mul_vec_eq_zero_iff' Matrix.exists_mulVec_eq_zero_iff' theorem exists_mulVec_eq_zero_iff {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A] {M : Matrix n n A} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := exists_mulVec_eq_zero_iff' (FractionRing A) #align matrix.exists_mul_vec_eq_zero_iff Matrix.exists_mulVec_eq_zero_iff
Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean
175
177
theorem exists_vecMul_eq_zero_iff {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A] {M : Matrix n n A} : (βˆƒ v β‰  0, v α΅₯* M = 0) ↔ M.det = 0 := by
simpa only [← M.det_transpose, ← mulVec_transpose] using exists_mulVec_eq_zero_iff
1,850
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer #align_import linear_algebra.matrix.to_linear_equiv from "leanprover-community/mathlib"@"e42cfdb03b7902f8787a1eb552cb8f77766b45b9" variable {n : Type*} [Fintype n] namespace Matrix section LinearEquiv open LinearMap variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] section Nondegenerate open Matrix theorem exists_mulVec_eq_zero_iff_aux {K : Type*} [DecidableEq n] [Field K] {M : Matrix n n K} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by constructor Β· rintro ⟨v, hv, mul_eq⟩ contrapose! hv exact eq_zero_of_mulVec_eq_zero hv mul_eq Β· contrapose! intro h have : Function.Injective (Matrix.toLin' M) := by simpa only [← LinearMap.ker_eq_bot, ker_toLin'_eq_bot_iff, not_imp_not] using h have : M * LinearMap.toMatrix' ((LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).symm : (n β†’ K) β†’β‚—[K] n β†’ K) = 1 := by refine Matrix.toLin'.injective (LinearMap.ext fun v => ?_) rw [Matrix.toLin'_mul, Matrix.toLin'_one, Matrix.toLin'_toMatrix', LinearMap.comp_apply] exact (LinearEquiv.ofInjectiveEndo (Matrix.toLin' M) this).apply_symm_apply v exact Matrix.det_ne_zero_of_right_inverse this #align matrix.exists_mul_vec_eq_zero_iff_aux Matrix.exists_mulVec_eq_zero_iff_aux theorem exists_mulVec_eq_zero_iff' {A : Type*} (K : Type*) [DecidableEq n] [CommRing A] [Nontrivial A] [Field K] [Algebra A K] [IsFractionRing A K] {M : Matrix n n A} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := by have : (βˆƒ v β‰  0, (algebraMap A K).mapMatrix M *α΅₯ v = 0) ↔ _ := exists_mulVec_eq_zero_iff_aux rw [← RingHom.map_det, IsFractionRing.to_map_eq_zero_iff] at this refine Iff.trans ?_ this; constructor <;> rintro ⟨v, hv, mul_eq⟩ Β· refine ⟨fun i => algebraMap _ _ (v i), mt (fun h => funext fun i => ?_) hv, ?_⟩ Β· exact IsFractionRing.to_map_eq_zero_iff.mp (congr_fun h i) Β· ext i refine (RingHom.map_mulVec _ _ _ i).symm.trans ?_ rw [mul_eq, Pi.zero_apply, RingHom.map_zero, Pi.zero_apply] Β· letI := Classical.decEq K obtain ⟨⟨b, hb⟩, ba_eq⟩ := IsLocalization.exist_integer_multiples_of_finset (nonZeroDivisors A) (Finset.univ.image v) choose f hf using ba_eq refine ⟨fun i => f _ (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩), mt (fun h => funext fun i => ?_) hv, ?_⟩ Β· have := congr_arg (algebraMap A K) (congr_fun h i) rw [hf, Subtype.coe_mk, Pi.zero_apply, RingHom.map_zero, Algebra.smul_def, mul_eq_zero, IsFractionRing.to_map_eq_zero_iff] at this exact this.resolve_left (nonZeroDivisors.ne_zero hb) Β· ext i refine IsFractionRing.injective A K ?_ calc algebraMap A K ((M *α΅₯ (fun i : n => f (v i) _)) i) = ((algebraMap A K).mapMatrix M *α΅₯ algebraMap _ K b β€’ v) i := ?_ _ = 0 := ?_ _ = algebraMap A K 0 := (RingHom.map_zero _).symm Β· simp_rw [RingHom.map_mulVec, mulVec, dotProduct, Function.comp_apply, hf, RingHom.mapMatrix_apply, Pi.smul_apply, smul_eq_mul, Algebra.smul_def] Β· rw [mulVec_smul, mul_eq, Pi.smul_apply, Pi.zero_apply, smul_zero] #align matrix.exists_mul_vec_eq_zero_iff' Matrix.exists_mulVec_eq_zero_iff' theorem exists_mulVec_eq_zero_iff {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A] {M : Matrix n n A} : (βˆƒ v β‰  0, M *α΅₯ v = 0) ↔ M.det = 0 := exists_mulVec_eq_zero_iff' (FractionRing A) #align matrix.exists_mul_vec_eq_zero_iff Matrix.exists_mulVec_eq_zero_iff theorem exists_vecMul_eq_zero_iff {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A] {M : Matrix n n A} : (βˆƒ v β‰  0, v α΅₯* M = 0) ↔ M.det = 0 := by simpa only [← M.det_transpose, ← mulVec_transpose] using exists_mulVec_eq_zero_iff #align matrix.exists_vec_mul_eq_zero_iff Matrix.exists_vecMul_eq_zero_iff
Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean
180
190
theorem nondegenerate_iff_det_ne_zero {A : Type*} [DecidableEq n] [CommRing A] [IsDomain A] {M : Matrix n n A} : Nondegenerate M ↔ M.det β‰  0 := by
rw [ne_eq, ← exists_vecMul_eq_zero_iff] push_neg constructor Β· intro hM v hv hMv obtain ⟨w, hwMv⟩ := hM.exists_not_ortho_of_ne_zero hv simp [dotProduct_mulVec, hMv, zero_dotProduct, ne_eq, not_true] at hwMv Β· intro h v hv refine not_imp_not.mp (h v) (funext fun i => ?_) simpa only [dotProduct_mulVec, dotProduct_single, mul_one] using hv (Pi.single i 1)
1,850
import Mathlib.LinearAlgebra.FinsuppVectorSpace import Mathlib.LinearAlgebra.Matrix.Basis import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.LinearAlgebra.SesquilinearForm import Mathlib.LinearAlgebra.Basis.Bilinear #align_import linear_algebra.matrix.sesquilinear_form from "leanprover-community/mathlib"@"84582d2872fb47c0c17eec7382dc097c9ec7137a" variable {R R₁ Rβ‚‚ M M₁ Mβ‚‚ M₁' Mβ‚‚' n m n' m' ΞΉ : Type*} open Finset LinearMap Matrix open Matrix section AuxToLinearMap variable [CommSemiring R] [Semiring R₁] [Semiring Rβ‚‚] variable [Fintype n] [Fintype m] variable (σ₁ : R₁ β†’+* R) (Οƒβ‚‚ : Rβ‚‚ β†’+* R) def Matrix.toLinearMapβ‚‚'Aux (f : Matrix n m R) : (n β†’ R₁) β†’β‚›β‚—[σ₁] (m β†’ Rβ‚‚) β†’β‚›β‚—[Οƒβ‚‚] R := -- Porting note: we don't seem to have `βˆ‘ i j` as valid notation yet mkβ‚‚'β‚›β‚— σ₁ Οƒβ‚‚ (fun (v : n β†’ R₁) (w : m β†’ Rβ‚‚) => βˆ‘ i, βˆ‘ j, σ₁ (v i) * f i j * Οƒβ‚‚ (w j)) (fun _ _ _ => by simp only [Pi.add_apply, map_add, add_mul, sum_add_distrib]) (fun _ _ _ => by simp only [Pi.smul_apply, smul_eq_mul, RingHom.map_mul, mul_assoc, mul_sum]) (fun _ _ _ => by simp only [Pi.add_apply, map_add, mul_add, sum_add_distrib]) fun _ _ _ => by simp only [Pi.smul_apply, smul_eq_mul, RingHom.map_mul, mul_assoc, mul_left_comm, mul_sum] #align matrix.to_linear_mapβ‚‚'_aux Matrix.toLinearMapβ‚‚'Aux variable [DecidableEq n] [DecidableEq m]
Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean
66
74
theorem Matrix.toLinearMapβ‚‚'Aux_stdBasis (f : Matrix n m R) (i : n) (j : m) : f.toLinearMapβ‚‚'Aux σ₁ Οƒβ‚‚ (LinearMap.stdBasis R₁ (fun _ => R₁) i 1) (LinearMap.stdBasis Rβ‚‚ (fun _ => Rβ‚‚) j 1) = f i j := by
rw [Matrix.toLinearMapβ‚‚'Aux, mkβ‚‚'β‚›β‚—_apply] have : (βˆ‘ i', βˆ‘ j', (if i = i' then 1 else 0) * f i' j' * if j = j' then 1 else 0) = f i j := by simp_rw [mul_assoc, ← Finset.mul_sum] simp only [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true, mul_comm (f _ _)] rw [← this] exact Finset.sum_congr rfl fun _ _ => Finset.sum_congr rfl fun _ _ => by simp
1,851
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.quadratic_form.basic from "leanprover-community/mathlib"@"d11f435d4e34a6cea0a1797d6b625b0c170be845" universe u v w variable {S T : Type*} variable {R : Type*} {M N : Type*} open LinearMap (BilinForm) section Polar variable [CommRing R] [AddCommGroup M] namespace QuadraticForm def polar (f : M β†’ R) (x y : M) := f (x + y) - f x - f y #align quadratic_form.polar QuadraticForm.polar
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
98
100
theorem polar_add (f g : M β†’ R) (x y : M) : polar (f + g) x y = polar f x y + polar g x y := by
simp only [polar, Pi.add_apply] abel
1,852
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.quadratic_form.basic from "leanprover-community/mathlib"@"d11f435d4e34a6cea0a1797d6b625b0c170be845" universe u v w variable {S T : Type*} variable {R : Type*} {M N : Type*} open LinearMap (BilinForm) section Polar variable [CommRing R] [AddCommGroup M] namespace QuadraticForm def polar (f : M β†’ R) (x y : M) := f (x + y) - f x - f y #align quadratic_form.polar QuadraticForm.polar theorem polar_add (f g : M β†’ R) (x y : M) : polar (f + g) x y = polar f x y + polar g x y := by simp only [polar, Pi.add_apply] abel #align quadratic_form.polar_add QuadraticForm.polar_add
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
103
104
theorem polar_neg (f : M β†’ R) (x y : M) : polar (-f) x y = -polar f x y := by
simp only [polar, Pi.neg_apply, sub_eq_add_neg, neg_add]
1,852
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.quadratic_form.basic from "leanprover-community/mathlib"@"d11f435d4e34a6cea0a1797d6b625b0c170be845" universe u v w variable {S T : Type*} variable {R : Type*} {M N : Type*} open LinearMap (BilinForm) section Polar variable [CommRing R] [AddCommGroup M] namespace QuadraticForm def polar (f : M β†’ R) (x y : M) := f (x + y) - f x - f y #align quadratic_form.polar QuadraticForm.polar theorem polar_add (f g : M β†’ R) (x y : M) : polar (f + g) x y = polar f x y + polar g x y := by simp only [polar, Pi.add_apply] abel #align quadratic_form.polar_add QuadraticForm.polar_add theorem polar_neg (f : M β†’ R) (x y : M) : polar (-f) x y = -polar f x y := by simp only [polar, Pi.neg_apply, sub_eq_add_neg, neg_add] #align quadratic_form.polar_neg QuadraticForm.polar_neg
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
107
108
theorem polar_smul [Monoid S] [DistribMulAction S R] (f : M β†’ R) (s : S) (x y : M) : polar (s β€’ f) x y = s β€’ polar f x y := by
simp only [polar, Pi.smul_apply, smul_sub]
1,852
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.quadratic_form.basic from "leanprover-community/mathlib"@"d11f435d4e34a6cea0a1797d6b625b0c170be845" universe u v w variable {S T : Type*} variable {R : Type*} {M N : Type*} open LinearMap (BilinForm) section Polar variable [CommRing R] [AddCommGroup M] namespace QuadraticForm def polar (f : M β†’ R) (x y : M) := f (x + y) - f x - f y #align quadratic_form.polar QuadraticForm.polar theorem polar_add (f g : M β†’ R) (x y : M) : polar (f + g) x y = polar f x y + polar g x y := by simp only [polar, Pi.add_apply] abel #align quadratic_form.polar_add QuadraticForm.polar_add theorem polar_neg (f : M β†’ R) (x y : M) : polar (-f) x y = -polar f x y := by simp only [polar, Pi.neg_apply, sub_eq_add_neg, neg_add] #align quadratic_form.polar_neg QuadraticForm.polar_neg theorem polar_smul [Monoid S] [DistribMulAction S R] (f : M β†’ R) (s : S) (x y : M) : polar (s β€’ f) x y = s β€’ polar f x y := by simp only [polar, Pi.smul_apply, smul_sub] #align quadratic_form.polar_smul QuadraticForm.polar_smul
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
111
112
theorem polar_comm (f : M β†’ R) (x y : M) : polar f x y = polar f y x := by
rw [polar, polar, add_comm, sub_sub, sub_sub, add_comm (f x) (f y)]
1,852
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.quadratic_form.basic from "leanprover-community/mathlib"@"d11f435d4e34a6cea0a1797d6b625b0c170be845" universe u v w variable {S T : Type*} variable {R : Type*} {M N : Type*} open LinearMap (BilinForm) section Polar variable [CommRing R] [AddCommGroup M] namespace QuadraticForm def polar (f : M β†’ R) (x y : M) := f (x + y) - f x - f y #align quadratic_form.polar QuadraticForm.polar theorem polar_add (f g : M β†’ R) (x y : M) : polar (f + g) x y = polar f x y + polar g x y := by simp only [polar, Pi.add_apply] abel #align quadratic_form.polar_add QuadraticForm.polar_add theorem polar_neg (f : M β†’ R) (x y : M) : polar (-f) x y = -polar f x y := by simp only [polar, Pi.neg_apply, sub_eq_add_neg, neg_add] #align quadratic_form.polar_neg QuadraticForm.polar_neg theorem polar_smul [Monoid S] [DistribMulAction S R] (f : M β†’ R) (s : S) (x y : M) : polar (s β€’ f) x y = s β€’ polar f x y := by simp only [polar, Pi.smul_apply, smul_sub] #align quadratic_form.polar_smul QuadraticForm.polar_smul theorem polar_comm (f : M β†’ R) (x y : M) : polar f x y = polar f y x := by rw [polar, polar, add_comm, sub_sub, sub_sub, add_comm (f x) (f y)] #align quadratic_form.polar_comm QuadraticForm.polar_comm
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
116
123
theorem polar_add_left_iff {f : M β†’ R} {x x' y : M} : polar f (x + x') y = polar f x y + polar f x' y ↔ f (x + x' + y) + (f x + f x' + f y) = f (x + x') + f (x' + y) + f (y + x) := by
simp only [← add_assoc] simp only [polar, sub_eq_iff_eq_add, eq_sub_iff_add_eq, sub_add_eq_add_sub, add_sub] simp only [add_right_comm _ (f y) _, add_right_comm _ (f x') (f x)] rw [add_comm y x, add_right_comm _ _ (f (x + y)), add_comm _ (f (x + y)), add_right_comm (f (x + y)), add_left_inj]
1,852
import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import linear_algebra.quadratic_form.basic from "leanprover-community/mathlib"@"d11f435d4e34a6cea0a1797d6b625b0c170be845" universe u v w variable {S T : Type*} variable {R : Type*} {M N : Type*} open LinearMap (BilinForm) section Polar variable [CommRing R] [AddCommGroup M] namespace QuadraticForm def polar (f : M β†’ R) (x y : M) := f (x + y) - f x - f y #align quadratic_form.polar QuadraticForm.polar theorem polar_add (f g : M β†’ R) (x y : M) : polar (f + g) x y = polar f x y + polar g x y := by simp only [polar, Pi.add_apply] abel #align quadratic_form.polar_add QuadraticForm.polar_add theorem polar_neg (f : M β†’ R) (x y : M) : polar (-f) x y = -polar f x y := by simp only [polar, Pi.neg_apply, sub_eq_add_neg, neg_add] #align quadratic_form.polar_neg QuadraticForm.polar_neg theorem polar_smul [Monoid S] [DistribMulAction S R] (f : M β†’ R) (s : S) (x y : M) : polar (s β€’ f) x y = s β€’ polar f x y := by simp only [polar, Pi.smul_apply, smul_sub] #align quadratic_form.polar_smul QuadraticForm.polar_smul theorem polar_comm (f : M β†’ R) (x y : M) : polar f x y = polar f y x := by rw [polar, polar, add_comm, sub_sub, sub_sub, add_comm (f x) (f y)] #align quadratic_form.polar_comm QuadraticForm.polar_comm theorem polar_add_left_iff {f : M β†’ R} {x x' y : M} : polar f (x + x') y = polar f x y + polar f x' y ↔ f (x + x' + y) + (f x + f x' + f y) = f (x + x') + f (x' + y) + f (y + x) := by simp only [← add_assoc] simp only [polar, sub_eq_iff_eq_add, eq_sub_iff_add_eq, sub_add_eq_add_sub, add_sub] simp only [add_right_comm _ (f y) _, add_right_comm _ (f x') (f x)] rw [add_comm y x, add_right_comm _ _ (f (x + y)), add_comm _ (f (x + y)), add_right_comm (f (x + y)), add_left_inj] #align quadratic_form.polar_add_left_iff QuadraticForm.polar_add_left_iff
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean
126
129
theorem polar_comp {F : Type*} [CommRing S] [FunLike F R S] [AddMonoidHomClass F R S] (f : M β†’ R) (g : F) (x y : M) : polar (g ∘ f) x y = g (polar f x y) := by
simp only [polar, Pi.smul_apply, Function.comp_apply, map_sub]
1,852
import Mathlib.LinearAlgebra.BilinearForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.Basic universe uR uA uM₁ uMβ‚‚ variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} open TensorProduct open LinearMap (BilinForm) namespace QuadraticForm section CommRing variable [CommRing R] [CommRing A] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] variable [Algebra R A] [Module R M₁] [Module A M₁] variable [SMulCommClass R A M₁] [SMulCommClass A R M₁] [IsScalarTower R A M₁] variable [Module R Mβ‚‚] [Invertible (2 : R)] variable (R A) in -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def tensorDistrib : QuadraticForm A M₁ βŠ—[R] QuadraticForm R Mβ‚‚ β†’β‚—[A] QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm -- while `letI`s would produce a better term than `let`, they would make this already-slow -- definition even slower. let toQ := BilinForm.toQuadraticFormLinearMap A A (M₁ βŠ—[R] Mβ‚‚) let tmulB := BilinForm.tensorDistrib R A (M₁ := M₁) (Mβ‚‚ := Mβ‚‚) let toB := AlgebraTensorModule.map (QuadraticForm.associated : QuadraticForm A M₁ β†’β‚—[A] BilinForm A M₁) (QuadraticForm.associated : QuadraticForm R Mβ‚‚ β†’β‚—[R] BilinForm R Mβ‚‚) toQ βˆ˜β‚— tmulB βˆ˜β‚— toB -- TODO: make the RHS `MulOpposite.op (Qβ‚‚ mβ‚‚) β€’ Q₁ m₁` so that this has a nicer defeq for -- `R = A` of `Q₁ m₁ * Qβ‚‚ mβ‚‚`. @[simp] theorem tensorDistrib_tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (m₁ : M₁) (mβ‚‚ : Mβ‚‚) : tensorDistrib R A (Q₁ βŠ—β‚œ Qβ‚‚) (m₁ βŠ—β‚œ mβ‚‚) = Qβ‚‚ mβ‚‚ β€’ Q₁ m₁ := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm (BilinForm.tensorDistrib_tmul _ _ _ _ _ _).trans <| congr_argβ‚‚ _ (associated_eq_self_apply _ _ _) (associated_eq_self_apply _ _ _) -- `noncomputable` is a performance workaround for mathlib4#7103 protected noncomputable abbrev tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := tensorDistrib R A (Q₁ βŠ—β‚œ[R] Qβ‚‚)
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean
69
75
theorem associated_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : associated (R := A) (Q₁.tmul Qβ‚‚) = (associated (R := A) Q₁).tmul (associated (R := R) Qβ‚‚) := by
rw [QuadraticForm.tmul, tensorDistrib, BilinForm.tmul] dsimp have : Subsingleton (Invertible (2 : A)) := inferInstance convert associated_left_inverse A ((associated_isSymm A Q₁).tmul (associated_isSymm R Qβ‚‚))
1,853
import Mathlib.LinearAlgebra.BilinearForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.Basic universe uR uA uM₁ uMβ‚‚ variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} open TensorProduct open LinearMap (BilinForm) namespace QuadraticForm section CommRing variable [CommRing R] [CommRing A] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] variable [Algebra R A] [Module R M₁] [Module A M₁] variable [SMulCommClass R A M₁] [SMulCommClass A R M₁] [IsScalarTower R A M₁] variable [Module R Mβ‚‚] [Invertible (2 : R)] variable (R A) in -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def tensorDistrib : QuadraticForm A M₁ βŠ—[R] QuadraticForm R Mβ‚‚ β†’β‚—[A] QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm -- while `letI`s would produce a better term than `let`, they would make this already-slow -- definition even slower. let toQ := BilinForm.toQuadraticFormLinearMap A A (M₁ βŠ—[R] Mβ‚‚) let tmulB := BilinForm.tensorDistrib R A (M₁ := M₁) (Mβ‚‚ := Mβ‚‚) let toB := AlgebraTensorModule.map (QuadraticForm.associated : QuadraticForm A M₁ β†’β‚—[A] BilinForm A M₁) (QuadraticForm.associated : QuadraticForm R Mβ‚‚ β†’β‚—[R] BilinForm R Mβ‚‚) toQ βˆ˜β‚— tmulB βˆ˜β‚— toB -- TODO: make the RHS `MulOpposite.op (Qβ‚‚ mβ‚‚) β€’ Q₁ m₁` so that this has a nicer defeq for -- `R = A` of `Q₁ m₁ * Qβ‚‚ mβ‚‚`. @[simp] theorem tensorDistrib_tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (m₁ : M₁) (mβ‚‚ : Mβ‚‚) : tensorDistrib R A (Q₁ βŠ—β‚œ Qβ‚‚) (m₁ βŠ—β‚œ mβ‚‚) = Qβ‚‚ mβ‚‚ β€’ Q₁ m₁ := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm (BilinForm.tensorDistrib_tmul _ _ _ _ _ _).trans <| congr_argβ‚‚ _ (associated_eq_self_apply _ _ _) (associated_eq_self_apply _ _ _) -- `noncomputable` is a performance workaround for mathlib4#7103 protected noncomputable abbrev tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := tensorDistrib R A (Q₁ βŠ—β‚œ[R] Qβ‚‚) theorem associated_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : associated (R := A) (Q₁.tmul Qβ‚‚) = (associated (R := A) Q₁).tmul (associated (R := R) Qβ‚‚) := by rw [QuadraticForm.tmul, tensorDistrib, BilinForm.tmul] dsimp have : Subsingleton (Invertible (2 : A)) := inferInstance convert associated_left_inverse A ((associated_isSymm A Q₁).tmul (associated_isSymm R Qβ‚‚))
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean
77
82
theorem polarBilin_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : polarBilin (Q₁.tmul Qβ‚‚) = β…Ÿ(2 : A) β€’ (polarBilin Q₁).tmul (polarBilin Qβ‚‚) := by
simp_rw [← two_nsmul_associated A, ← two_nsmul_associated R, BilinForm.tmul, tmul_smul, ← smul_tmul', map_nsmul, associated_tmul] rw [smul_comm (_ : A) (_ : β„•), ← smul_assoc, two_smul _ (_ : A), invOf_two_add_invOf_two, one_smul]
1,853
import Mathlib.LinearAlgebra.BilinearForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.Basic universe uR uA uM₁ uMβ‚‚ variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} open TensorProduct open LinearMap (BilinForm) namespace QuadraticForm section CommRing variable [CommRing R] [CommRing A] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] variable [Algebra R A] [Module R M₁] [Module A M₁] variable [SMulCommClass R A M₁] [SMulCommClass A R M₁] [IsScalarTower R A M₁] variable [Module R Mβ‚‚] [Invertible (2 : R)] variable (R A) in -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def tensorDistrib : QuadraticForm A M₁ βŠ—[R] QuadraticForm R Mβ‚‚ β†’β‚—[A] QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm -- while `letI`s would produce a better term than `let`, they would make this already-slow -- definition even slower. let toQ := BilinForm.toQuadraticFormLinearMap A A (M₁ βŠ—[R] Mβ‚‚) let tmulB := BilinForm.tensorDistrib R A (M₁ := M₁) (Mβ‚‚ := Mβ‚‚) let toB := AlgebraTensorModule.map (QuadraticForm.associated : QuadraticForm A M₁ β†’β‚—[A] BilinForm A M₁) (QuadraticForm.associated : QuadraticForm R Mβ‚‚ β†’β‚—[R] BilinForm R Mβ‚‚) toQ βˆ˜β‚— tmulB βˆ˜β‚— toB -- TODO: make the RHS `MulOpposite.op (Qβ‚‚ mβ‚‚) β€’ Q₁ m₁` so that this has a nicer defeq for -- `R = A` of `Q₁ m₁ * Qβ‚‚ mβ‚‚`. @[simp] theorem tensorDistrib_tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (m₁ : M₁) (mβ‚‚ : Mβ‚‚) : tensorDistrib R A (Q₁ βŠ—β‚œ Qβ‚‚) (m₁ βŠ—β‚œ mβ‚‚) = Qβ‚‚ mβ‚‚ β€’ Q₁ m₁ := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm (BilinForm.tensorDistrib_tmul _ _ _ _ _ _).trans <| congr_argβ‚‚ _ (associated_eq_self_apply _ _ _) (associated_eq_self_apply _ _ _) -- `noncomputable` is a performance workaround for mathlib4#7103 protected noncomputable abbrev tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := tensorDistrib R A (Q₁ βŠ—β‚œ[R] Qβ‚‚) theorem associated_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : associated (R := A) (Q₁.tmul Qβ‚‚) = (associated (R := A) Q₁).tmul (associated (R := R) Qβ‚‚) := by rw [QuadraticForm.tmul, tensorDistrib, BilinForm.tmul] dsimp have : Subsingleton (Invertible (2 : A)) := inferInstance convert associated_left_inverse A ((associated_isSymm A Q₁).tmul (associated_isSymm R Qβ‚‚)) theorem polarBilin_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : polarBilin (Q₁.tmul Qβ‚‚) = β…Ÿ(2 : A) β€’ (polarBilin Q₁).tmul (polarBilin Qβ‚‚) := by simp_rw [← two_nsmul_associated A, ← two_nsmul_associated R, BilinForm.tmul, tmul_smul, ← smul_tmul', map_nsmul, associated_tmul] rw [smul_comm (_ : A) (_ : β„•), ← smul_assoc, two_smul _ (_ : A), invOf_two_add_invOf_two, one_smul] variable (A) in -- `noncomputable` is a performance workaround for mathlib4#7103 protected noncomputable def baseChange (Q : QuadraticForm R Mβ‚‚) : QuadraticForm A (A βŠ—[R] Mβ‚‚) := QuadraticForm.tmul (R := R) (A := A) (M₁ := A) (Mβ‚‚ := Mβ‚‚) (QuadraticForm.sq (R := A)) Q @[simp] theorem baseChange_tmul (Q : QuadraticForm R Mβ‚‚) (a : A) (mβ‚‚ : Mβ‚‚) : Q.baseChange A (a βŠ—β‚œ mβ‚‚) = Q mβ‚‚ β€’ (a * a) := tensorDistrib_tmul _ _ _ _
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean
95
99
theorem associated_baseChange [Invertible (2 : A)] (Q : QuadraticForm R Mβ‚‚) : associated (R := A) (Q.baseChange A) = (associated (R := R) Q).baseChange A := by
dsimp only [QuadraticForm.baseChange, LinearMap.baseChange] rw [associated_tmul (QuadraticForm.sq (R := A)) Q, associated_sq] exact rfl
1,853
import Mathlib.LinearAlgebra.BilinearForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.Basic universe uR uA uM₁ uMβ‚‚ variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} open TensorProduct open LinearMap (BilinForm) namespace QuadraticForm section CommRing variable [CommRing R] [CommRing A] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] variable [Algebra R A] [Module R M₁] [Module A M₁] variable [SMulCommClass R A M₁] [SMulCommClass A R M₁] [IsScalarTower R A M₁] variable [Module R Mβ‚‚] [Invertible (2 : R)] variable (R A) in -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def tensorDistrib : QuadraticForm A M₁ βŠ—[R] QuadraticForm R Mβ‚‚ β†’β‚—[A] QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm -- while `letI`s would produce a better term than `let`, they would make this already-slow -- definition even slower. let toQ := BilinForm.toQuadraticFormLinearMap A A (M₁ βŠ—[R] Mβ‚‚) let tmulB := BilinForm.tensorDistrib R A (M₁ := M₁) (Mβ‚‚ := Mβ‚‚) let toB := AlgebraTensorModule.map (QuadraticForm.associated : QuadraticForm A M₁ β†’β‚—[A] BilinForm A M₁) (QuadraticForm.associated : QuadraticForm R Mβ‚‚ β†’β‚—[R] BilinForm R Mβ‚‚) toQ βˆ˜β‚— tmulB βˆ˜β‚— toB -- TODO: make the RHS `MulOpposite.op (Qβ‚‚ mβ‚‚) β€’ Q₁ m₁` so that this has a nicer defeq for -- `R = A` of `Q₁ m₁ * Qβ‚‚ mβ‚‚`. @[simp] theorem tensorDistrib_tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (m₁ : M₁) (mβ‚‚ : Mβ‚‚) : tensorDistrib R A (Q₁ βŠ—β‚œ Qβ‚‚) (m₁ βŠ—β‚œ mβ‚‚) = Qβ‚‚ mβ‚‚ β€’ Q₁ m₁ := letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm (BilinForm.tensorDistrib_tmul _ _ _ _ _ _).trans <| congr_argβ‚‚ _ (associated_eq_self_apply _ _ _) (associated_eq_self_apply _ _ _) -- `noncomputable` is a performance workaround for mathlib4#7103 protected noncomputable abbrev tmul (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : QuadraticForm A (M₁ βŠ—[R] Mβ‚‚) := tensorDistrib R A (Q₁ βŠ—β‚œ[R] Qβ‚‚) theorem associated_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : associated (R := A) (Q₁.tmul Qβ‚‚) = (associated (R := A) Q₁).tmul (associated (R := R) Qβ‚‚) := by rw [QuadraticForm.tmul, tensorDistrib, BilinForm.tmul] dsimp have : Subsingleton (Invertible (2 : A)) := inferInstance convert associated_left_inverse A ((associated_isSymm A Q₁).tmul (associated_isSymm R Qβ‚‚)) theorem polarBilin_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : polarBilin (Q₁.tmul Qβ‚‚) = β…Ÿ(2 : A) β€’ (polarBilin Q₁).tmul (polarBilin Qβ‚‚) := by simp_rw [← two_nsmul_associated A, ← two_nsmul_associated R, BilinForm.tmul, tmul_smul, ← smul_tmul', map_nsmul, associated_tmul] rw [smul_comm (_ : A) (_ : β„•), ← smul_assoc, two_smul _ (_ : A), invOf_two_add_invOf_two, one_smul] variable (A) in -- `noncomputable` is a performance workaround for mathlib4#7103 protected noncomputable def baseChange (Q : QuadraticForm R Mβ‚‚) : QuadraticForm A (A βŠ—[R] Mβ‚‚) := QuadraticForm.tmul (R := R) (A := A) (M₁ := A) (Mβ‚‚ := Mβ‚‚) (QuadraticForm.sq (R := A)) Q @[simp] theorem baseChange_tmul (Q : QuadraticForm R Mβ‚‚) (a : A) (mβ‚‚ : Mβ‚‚) : Q.baseChange A (a βŠ—β‚œ mβ‚‚) = Q mβ‚‚ β€’ (a * a) := tensorDistrib_tmul _ _ _ _ theorem associated_baseChange [Invertible (2 : A)] (Q : QuadraticForm R Mβ‚‚) : associated (R := A) (Q.baseChange A) = (associated (R := R) Q).baseChange A := by dsimp only [QuadraticForm.baseChange, LinearMap.baseChange] rw [associated_tmul (QuadraticForm.sq (R := A)) Q, associated_sq] exact rfl
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean
101
105
theorem polarBilin_baseChange [Invertible (2 : A)] (Q : QuadraticForm R Mβ‚‚) : polarBilin (Q.baseChange A) = (polarBilin Q).baseChange A := by
rw [QuadraticForm.baseChange, BilinForm.baseChange, polarBilin_tmul, BilinForm.tmul, ← LinearMap.map_smul, smul_tmul', ← two_nsmul_associated R, coe_associatedHom, associated_sq, smul_comm, ← smul_assoc, two_smul, invOf_two_add_invOf_two, one_smul]
1,853
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv suppress_compilation universe uR uM₁ uMβ‚‚ uM₃ uMβ‚„ variable {R : Type uR} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} {M₃ : Type uM₃} {Mβ‚„ : Type uMβ‚„} open scoped TensorProduct namespace QuadraticForm variable [CommRing R] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] [AddCommGroup M₃] [AddCommGroup Mβ‚„] variable [Module R M₁] [Module R Mβ‚‚] [Module R M₃] [Module R Mβ‚„] [Invertible (2 : R)] @[simp]
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean
37
46
theorem tmul_comp_tensorMap {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) : (Qβ‚‚.tmul Qβ‚„).comp (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃ := by
have h₁ : Q₁ = Qβ‚‚.comp f.toLinearMap := QuadraticForm.ext fun x => (f.map_app x).symm have h₃ : Q₃ = Qβ‚„.comp g.toLinearMap := QuadraticForm.ext fun x => (g.map_app x).symm refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ m₃ m₁' m₃' simp [-associated_apply, h₁, h₃, associated_tmul]
1,854
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv suppress_compilation universe uR uM₁ uMβ‚‚ uM₃ uMβ‚„ variable {R : Type uR} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} {M₃ : Type uM₃} {Mβ‚„ : Type uMβ‚„} open scoped TensorProduct namespace QuadraticForm variable [CommRing R] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] [AddCommGroup M₃] [AddCommGroup Mβ‚„] variable [Module R M₁] [Module R Mβ‚‚] [Module R M₃] [Module R Mβ‚„] [Invertible (2 : R)] @[simp] theorem tmul_comp_tensorMap {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) : (Qβ‚‚.tmul Qβ‚„).comp (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃ := by have h₁ : Q₁ = Qβ‚‚.comp f.toLinearMap := QuadraticForm.ext fun x => (f.map_app x).symm have h₃ : Q₃ = Qβ‚„.comp g.toLinearMap := QuadraticForm.ext fun x => (g.map_app x).symm refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ m₃ m₁' m₃' simp [-associated_apply, h₁, h₃, associated_tmul] @[simp] theorem tmul_tensorMap_apply {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) (x : M₁ βŠ—[R] M₃) : Qβ‚‚.tmul Qβ‚„ (TensorProduct.map f.toLinearMap g.toLinearMap x) = Q₁.tmul Q₃ x := DFunLike.congr_fun (tmul_comp_tensorMap f g) x section tensorComm @[simp]
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean
79
85
theorem tmul_comp_tensorComm (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (Qβ‚‚.tmul Q₁).comp (TensorProduct.comm R M₁ Mβ‚‚) = Q₁.tmul Qβ‚‚ := by
refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ mβ‚‚ m₁' mβ‚‚' dsimp [-associated_apply] simp only [associated_tmul, QuadraticForm.associated_comp] exact mul_comm _ _
1,854
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv suppress_compilation universe uR uM₁ uMβ‚‚ uM₃ uMβ‚„ variable {R : Type uR} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} {M₃ : Type uM₃} {Mβ‚„ : Type uMβ‚„} open scoped TensorProduct namespace QuadraticForm variable [CommRing R] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] [AddCommGroup M₃] [AddCommGroup Mβ‚„] variable [Module R M₁] [Module R Mβ‚‚] [Module R M₃] [Module R Mβ‚„] [Invertible (2 : R)] @[simp] theorem tmul_comp_tensorMap {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) : (Qβ‚‚.tmul Qβ‚„).comp (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃ := by have h₁ : Q₁ = Qβ‚‚.comp f.toLinearMap := QuadraticForm.ext fun x => (f.map_app x).symm have h₃ : Q₃ = Qβ‚„.comp g.toLinearMap := QuadraticForm.ext fun x => (g.map_app x).symm refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ m₃ m₁' m₃' simp [-associated_apply, h₁, h₃, associated_tmul] @[simp] theorem tmul_tensorMap_apply {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) (x : M₁ βŠ—[R] M₃) : Qβ‚‚.tmul Qβ‚„ (TensorProduct.map f.toLinearMap g.toLinearMap x) = Q₁.tmul Q₃ x := DFunLike.congr_fun (tmul_comp_tensorMap f g) x section tensorAssoc @[simp]
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean
114
121
theorem tmul_comp_tensorAssoc (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (Q₃ : QuadraticForm R M₃) : (Q₁.tmul (Qβ‚‚.tmul Q₃)).comp (TensorProduct.assoc R M₁ Mβ‚‚ M₃) = (Q₁.tmul Qβ‚‚).tmul Q₃ := by
refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ mβ‚‚ m₁' mβ‚‚' m₁'' mβ‚‚'' dsimp [-associated_apply] simp only [associated_tmul, QuadraticForm.associated_comp] exact mul_assoc _ _ _
1,854
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv suppress_compilation universe uR uM₁ uMβ‚‚ uM₃ uMβ‚„ variable {R : Type uR} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} {M₃ : Type uM₃} {Mβ‚„ : Type uMβ‚„} open scoped TensorProduct namespace QuadraticForm variable [CommRing R] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] [AddCommGroup M₃] [AddCommGroup Mβ‚„] variable [Module R M₁] [Module R Mβ‚‚] [Module R M₃] [Module R Mβ‚„] [Invertible (2 : R)] @[simp] theorem tmul_comp_tensorMap {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) : (Qβ‚‚.tmul Qβ‚„).comp (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃ := by have h₁ : Q₁ = Qβ‚‚.comp f.toLinearMap := QuadraticForm.ext fun x => (f.map_app x).symm have h₃ : Q₃ = Qβ‚„.comp g.toLinearMap := QuadraticForm.ext fun x => (g.map_app x).symm refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ m₃ m₁' m₃' simp [-associated_apply, h₁, h₃, associated_tmul] @[simp] theorem tmul_tensorMap_apply {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) (x : M₁ βŠ—[R] M₃) : Qβ‚‚.tmul Qβ‚„ (TensorProduct.map f.toLinearMap g.toLinearMap x) = Q₁.tmul Q₃ x := DFunLike.congr_fun (tmul_comp_tensorMap f g) x section tensorRId
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean
153
159
theorem comp_tensorRId_eq (Q₁ : QuadraticForm R M₁) : Q₁.comp (TensorProduct.rid R M₁) = Q₁.tmul (sq (R := R)) := by
refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ m₁' dsimp [-associated_apply] simp only [associated_tmul, QuadraticForm.associated_comp] simp [-associated_apply, one_mul]
1,854
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv suppress_compilation universe uR uM₁ uMβ‚‚ uM₃ uMβ‚„ variable {R : Type uR} {M₁ : Type uM₁} {Mβ‚‚ : Type uMβ‚‚} {M₃ : Type uM₃} {Mβ‚„ : Type uMβ‚„} open scoped TensorProduct namespace QuadraticForm variable [CommRing R] variable [AddCommGroup M₁] [AddCommGroup Mβ‚‚] [AddCommGroup M₃] [AddCommGroup Mβ‚„] variable [Module R M₁] [Module R Mβ‚‚] [Module R M₃] [Module R Mβ‚„] [Invertible (2 : R)] @[simp] theorem tmul_comp_tensorMap {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) : (Qβ‚‚.tmul Qβ‚„).comp (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃ := by have h₁ : Q₁ = Qβ‚‚.comp f.toLinearMap := QuadraticForm.ext fun x => (f.map_app x).symm have h₃ : Q₃ = Qβ‚„.comp g.toLinearMap := QuadraticForm.ext fun x => (g.map_app x).symm refine (QuadraticForm.associated_rightInverse R).injective ?_ ext m₁ m₃ m₁' m₃' simp [-associated_apply, h₁, h₃, associated_tmul] @[simp] theorem tmul_tensorMap_apply {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₃ : QuadraticForm R M₃} {Qβ‚„ : QuadraticForm R Mβ‚„} (f : Q₁ β†’qα΅’ Qβ‚‚) (g : Q₃ β†’qα΅’ Qβ‚„) (x : M₁ βŠ—[R] M₃) : Qβ‚‚.tmul Qβ‚„ (TensorProduct.map f.toLinearMap g.toLinearMap x) = Q₁.tmul Q₃ x := DFunLike.congr_fun (tmul_comp_tensorMap f g) x section tensorLId
Mathlib/LinearAlgebra/QuadraticForm/TensorProduct/Isometries.lean
186
192
theorem comp_tensorLId_eq (Qβ‚‚ : QuadraticForm R Mβ‚‚) : Qβ‚‚.comp (TensorProduct.lid R Mβ‚‚) = (sq (R := R)).tmul Qβ‚‚ := by
refine (QuadraticForm.associated_rightInverse R).injective ?_ ext mβ‚‚ mβ‚‚' dsimp [-associated_apply] simp only [associated_tmul, QuadraticForm.associated_comp] simp [-associated_apply, mul_one]
1,854
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.TensorProduct.Opposite import Mathlib.RingTheory.TensorProduct.Basic variable {R A V : Type*} variable [CommRing R] [CommRing A] [AddCommGroup V] variable [Algebra R A] [Module R V] [Module A V] [IsScalarTower R A V] variable [Invertible (2 : R)] open scoped TensorProduct namespace CliffordAlgebra variable (A) -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChangeAux (Q : QuadraticForm R V) : CliffordAlgebra Q →ₐ[R] CliffordAlgebra (Q.baseChange A) := CliffordAlgebra.lift Q <| by refine ⟨(ΞΉ (Q.baseChange A)).restrictScalars R βˆ˜β‚— TensorProduct.mk R A V 1, fun v => ?_⟩ refine (CliffordAlgebra.ΞΉ_sq_scalar (Q.baseChange A) (1 βŠ—β‚œ v)).trans ?_ rw [QuadraticForm.baseChange_tmul, one_mul, ← Algebra.algebraMap_eq_smul_one, ← IsScalarTower.algebraMap_apply] @[simp] theorem ofBaseChangeAux_ΞΉ (Q : QuadraticForm R V) (v : V) : ofBaseChangeAux A Q (ΞΉ Q v) = ΞΉ (Q.baseChange A) (1 βŠ—β‚œ v) := CliffordAlgebra.lift_ΞΉ_apply _ _ v -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChange (Q : QuadraticForm R V) : A βŠ—[R] CliffordAlgebra Q →ₐ[A] CliffordAlgebra (Q.baseChange A) := Algebra.TensorProduct.lift (Algebra.ofId _ _) (ofBaseChangeAux A Q) fun _a _x => Algebra.commutes _ _ @[simp] theorem ofBaseChange_tmul_ΞΉ (Q : QuadraticForm R V) (z : A) (v : V) : ofBaseChange A Q (z βŠ—β‚œ ΞΉ Q v) = ΞΉ (Q.baseChange A) (z βŠ—β‚œ v) := by show algebraMap _ _ z * ofBaseChangeAux A Q (ΞΉ Q v) = ΞΉ (Q.baseChange A) (z βŠ—β‚œ[R] v) rw [ofBaseChangeAux_ΞΉ, ← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] @[simp] theorem ofBaseChange_tmul_one (Q : QuadraticForm R V) (z : A) : ofBaseChange A Q (z βŠ—β‚œ 1) = algebraMap _ _ z := by show algebraMap _ _ z * ofBaseChangeAux A Q 1 = _ rw [map_one, mul_one] -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def toBaseChange (Q : QuadraticForm R V) : CliffordAlgebra (Q.baseChange A) →ₐ[A] A βŠ—[R] CliffordAlgebra Q := CliffordAlgebra.lift _ <| by refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A β†’β‚—[A] A) (ΞΉ Q), ?_⟩ letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm letI : Invertible (2 : A βŠ—[R] CliffordAlgebra Q) := (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm suffices hpure_tensor : βˆ€ v w, (1 * 1) βŠ—β‚œ[R] (ΞΉ Q v * ΞΉ Q w) + (1 * 1) βŠ—β‚œ[R] (ΞΉ Q w * ΞΉ Q v) = QuadraticForm.polarBilin (Q.baseChange A) (1 βŠ—β‚œ[R] v) (1 βŠ—β‚œ[R] w) βŠ—β‚œ[R] 1 by -- the crux is that by converting to a statement about linear maps instead of quadratic forms, -- we then have access to all the partially-applied `ext` lemmas. rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)] refine TensorProduct.AlgebraTensorModule.curry_injective ?_ ext v w exact hpure_tensor v w intros v w rw [← TensorProduct.tmul_add, CliffordAlgebra.ΞΉ_mul_ΞΉ_add_swap, QuadraticForm.polarBilin_baseChange, LinearMap.BilinForm.baseChange_tmul, one_mul, TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one, QuadraticForm.polarBilin_apply_apply] @[simp] theorem toBaseChange_ΞΉ (Q : QuadraticForm R V) (z : A) (v : V) : toBaseChange A Q (ΞΉ (Q.baseChange A) (z βŠ—β‚œ v)) = z βŠ—β‚œ ΞΉ Q v := CliffordAlgebra.lift_ΞΉ_apply _ _ _
Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean
104
113
theorem toBaseChange_comp_involute (Q : QuadraticForm R V) : (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by
ext v show toBaseChange A Q (involute (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v))) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute : A βŠ—[R] CliffordAlgebra Q →ₐ[A] _) (toBaseChange A Q (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v))) rw [toBaseChange_ΞΉ, involute_ΞΉ, map_neg (toBaseChange A Q), toBaseChange_ΞΉ, Algebra.TensorProduct.map_tmul, AlgHom.id_apply, involute_ΞΉ, TensorProduct.tmul_neg]
1,855
import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.TensorProduct.Opposite import Mathlib.RingTheory.TensorProduct.Basic variable {R A V : Type*} variable [CommRing R] [CommRing A] [AddCommGroup V] variable [Algebra R A] [Module R V] [Module A V] [IsScalarTower R A V] variable [Invertible (2 : R)] open scoped TensorProduct namespace CliffordAlgebra variable (A) -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChangeAux (Q : QuadraticForm R V) : CliffordAlgebra Q →ₐ[R] CliffordAlgebra (Q.baseChange A) := CliffordAlgebra.lift Q <| by refine ⟨(ΞΉ (Q.baseChange A)).restrictScalars R βˆ˜β‚— TensorProduct.mk R A V 1, fun v => ?_⟩ refine (CliffordAlgebra.ΞΉ_sq_scalar (Q.baseChange A) (1 βŠ—β‚œ v)).trans ?_ rw [QuadraticForm.baseChange_tmul, one_mul, ← Algebra.algebraMap_eq_smul_one, ← IsScalarTower.algebraMap_apply] @[simp] theorem ofBaseChangeAux_ΞΉ (Q : QuadraticForm R V) (v : V) : ofBaseChangeAux A Q (ΞΉ Q v) = ΞΉ (Q.baseChange A) (1 βŠ—β‚œ v) := CliffordAlgebra.lift_ΞΉ_apply _ _ v -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def ofBaseChange (Q : QuadraticForm R V) : A βŠ—[R] CliffordAlgebra Q →ₐ[A] CliffordAlgebra (Q.baseChange A) := Algebra.TensorProduct.lift (Algebra.ofId _ _) (ofBaseChangeAux A Q) fun _a _x => Algebra.commutes _ _ @[simp] theorem ofBaseChange_tmul_ΞΉ (Q : QuadraticForm R V) (z : A) (v : V) : ofBaseChange A Q (z βŠ—β‚œ ΞΉ Q v) = ΞΉ (Q.baseChange A) (z βŠ—β‚œ v) := by show algebraMap _ _ z * ofBaseChangeAux A Q (ΞΉ Q v) = ΞΉ (Q.baseChange A) (z βŠ—β‚œ[R] v) rw [ofBaseChangeAux_ΞΉ, ← Algebra.smul_def, ← map_smul, TensorProduct.smul_tmul', smul_eq_mul, mul_one] @[simp] theorem ofBaseChange_tmul_one (Q : QuadraticForm R V) (z : A) : ofBaseChange A Q (z βŠ—β‚œ 1) = algebraMap _ _ z := by show algebraMap _ _ z * ofBaseChangeAux A Q 1 = _ rw [map_one, mul_one] -- `noncomputable` is a performance workaround for mathlib4#7103 noncomputable def toBaseChange (Q : QuadraticForm R V) : CliffordAlgebra (Q.baseChange A) →ₐ[A] A βŠ—[R] CliffordAlgebra Q := CliffordAlgebra.lift _ <| by refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A β†’β‚—[A] A) (ΞΉ Q), ?_⟩ letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm letI : Invertible (2 : A βŠ—[R] CliffordAlgebra Q) := (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm suffices hpure_tensor : βˆ€ v w, (1 * 1) βŠ—β‚œ[R] (ΞΉ Q v * ΞΉ Q w) + (1 * 1) βŠ—β‚œ[R] (ΞΉ Q w * ΞΉ Q v) = QuadraticForm.polarBilin (Q.baseChange A) (1 βŠ—β‚œ[R] v) (1 βŠ—β‚œ[R] w) βŠ—β‚œ[R] 1 by -- the crux is that by converting to a statement about linear maps instead of quadratic forms, -- we then have access to all the partially-applied `ext` lemmas. rw [CliffordAlgebra.forall_mul_self_eq_iff (isUnit_of_invertible _)] refine TensorProduct.AlgebraTensorModule.curry_injective ?_ ext v w exact hpure_tensor v w intros v w rw [← TensorProduct.tmul_add, CliffordAlgebra.ΞΉ_mul_ΞΉ_add_swap, QuadraticForm.polarBilin_baseChange, LinearMap.BilinForm.baseChange_tmul, one_mul, TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one, QuadraticForm.polarBilin_apply_apply] @[simp] theorem toBaseChange_ΞΉ (Q : QuadraticForm R V) (z : A) (v : V) : toBaseChange A Q (ΞΉ (Q.baseChange A) (z βŠ—β‚œ v)) = z βŠ—β‚œ ΞΉ Q v := CliffordAlgebra.lift_ΞΉ_apply _ _ _ theorem toBaseChange_comp_involute (Q : QuadraticForm R V) : (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q) := by ext v show toBaseChange A Q (involute (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v))) = (Algebra.TensorProduct.map (AlgHom.id _ _) involute : A βŠ—[R] CliffordAlgebra Q →ₐ[A] _) (toBaseChange A Q (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v))) rw [toBaseChange_ΞΉ, involute_ΞΉ, map_neg (toBaseChange A Q), toBaseChange_ΞΉ, Algebra.TensorProduct.map_tmul, AlgHom.id_apply, involute_ΞΉ, TensorProduct.tmul_neg] theorem toBaseChange_involute (Q : QuadraticForm R V) (x : CliffordAlgebra (Q.baseChange A)) : toBaseChange A Q (involute x) = TensorProduct.map LinearMap.id (involute.toLinearMap) (toBaseChange A Q x) := DFunLike.congr_fun (toBaseChange_comp_involute A Q) x open MulOpposite
Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean
124
137
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) : (toBaseChange A Q).op.comp reverseOp = ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <| (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp (toBaseChange A Q)) := by
ext v show op (toBaseChange A Q (reverse (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v)))) = Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q) (Algebra.TensorProduct.map (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q)) (toBaseChange A Q (ΞΉ (Q.baseChange A) (1 βŠ—β‚œ[R] v)))) rw [toBaseChange_ΞΉ, reverse_ΞΉ, toBaseChange_ΞΉ, Algebra.TensorProduct.map_tmul, Algebra.TensorProduct.opAlgEquiv_tmul, reverseOp_ΞΉ] rfl
1,855
import Mathlib.LinearAlgebra.Matrix.Basis import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.LinearAlgebra.BilinearForm.Properties import Mathlib.LinearAlgebra.Matrix.SesquilinearForm #align_import linear_algebra.matrix.bilinear_form from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" open LinearMap (BilinForm) variable {R : Type*} {M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] variable {R₁ : Type*} {M₁ : Type*} [CommRing R₁] [AddCommGroup M₁] [Module R₁ M₁] variable {Rβ‚‚ : Type*} {Mβ‚‚ : Type*} [CommSemiring Rβ‚‚] [AddCommMonoid Mβ‚‚] [Module Rβ‚‚ Mβ‚‚] variable {R₃ : Type*} {M₃ : Type*} [CommRing R₃] [AddCommGroup M₃] [Module R₃ M₃] variable {V : Type*} {K : Type*} [Field K] [AddCommGroup V] [Module K V] variable {B : BilinForm R M} {B₁ : BilinForm R₁ M₁} {Bβ‚‚ : BilinForm Rβ‚‚ Mβ‚‚} section Matrix variable {n o : Type*} open Finset LinearMap Matrix open Matrix def Matrix.toBilin'Aux [Fintype n] (M : Matrix n n Rβ‚‚) : BilinForm Rβ‚‚ (n β†’ Rβ‚‚) := Matrix.toLinearMapβ‚‚'Aux _ _ M #align matrix.to_bilin'_aux Matrix.toBilin'Aux theorem Matrix.toBilin'Aux_stdBasis [Fintype n] [DecidableEq n] (M : Matrix n n Rβ‚‚) (i j : n) : M.toBilin'Aux (LinearMap.stdBasis Rβ‚‚ (fun _ => Rβ‚‚) i 1) (LinearMap.stdBasis Rβ‚‚ (fun _ => Rβ‚‚) j 1) = M i j := Matrix.toLinearMapβ‚‚'Aux_stdBasis _ _ _ _ _ #align matrix.to_bilin'_aux_std_basis Matrix.toBilin'Aux_stdBasis def BilinForm.toMatrixAux (b : n β†’ Mβ‚‚) : BilinForm Rβ‚‚ Mβ‚‚ β†’β‚—[Rβ‚‚] Matrix n n Rβ‚‚ := LinearMap.toMatrixβ‚‚Aux b b #align bilin_form.to_matrix_aux BilinForm.toMatrixAux @[simp] theorem LinearMap.BilinForm.toMatrixAux_apply (B : BilinForm Rβ‚‚ Mβ‚‚) (b : n β†’ Mβ‚‚) (i j : n) : -- Porting note: had to hint the base ring even though it should be clear from context... BilinForm.toMatrixAux (Rβ‚‚ := Rβ‚‚) b B i j = B (b i) (b j) := LinearMap.toMatrixβ‚‚Aux_apply B _ _ _ _ #align bilin_form.to_matrix_aux_apply LinearMap.BilinForm.toMatrixAux_apply variable [Fintype n] [Fintype o]
Mathlib/LinearAlgebra/Matrix/BilinearForm.lean
88
93
theorem toBilin'Aux_toMatrixAux [DecidableEq n] (Bβ‚‚ : BilinForm Rβ‚‚ (n β†’ Rβ‚‚)) : -- Porting note: had to hint the base ring even though it should be clear from context... Matrix.toBilin'Aux (BilinForm.toMatrixAux (Rβ‚‚ := Rβ‚‚) (fun j => stdBasis Rβ‚‚ (fun _ => Rβ‚‚) j 1) Bβ‚‚) = Bβ‚‚ := by
rw [BilinForm.toMatrixAux, Matrix.toBilin'Aux, toLinearMapβ‚‚'Aux_toMatrixβ‚‚Aux]
1,856
import Mathlib.Algebra.Lie.OfAssociative import Mathlib.LinearAlgebra.Matrix.Reindex import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv #align_import algebra.lie.matrix from "leanprover-community/mathlib"@"55e2dfde0cff928ce5c70926a3f2c7dee3e2dd99" universe u v w w₁ wβ‚‚ section Matrices open scoped Matrix variable {R : Type u} [CommRing R] variable {n : Type w} [DecidableEq n] [Fintype n] def lieEquivMatrix' : Module.End R (n β†’ R) ≃ₗ⁅R⁆ Matrix n n R := { LinearMap.toMatrix' with map_lie' := fun {T S} => by let f := @LinearMap.toMatrix' R _ n n _ _ change f (T.comp S - S.comp T) = f T * f S - f S * f T have h : βˆ€ T S : Module.End R _, f (T.comp S) = f T * f S := LinearMap.toMatrix'_comp rw [map_sub, h, h] } #align lie_equiv_matrix' lieEquivMatrix' @[simp] theorem lieEquivMatrix'_apply (f : Module.End R (n β†’ R)) : lieEquivMatrix' f = LinearMap.toMatrix' f := rfl #align lie_equiv_matrix'_apply lieEquivMatrix'_apply @[simp] theorem lieEquivMatrix'_symm_apply (A : Matrix n n R) : (@lieEquivMatrix' R _ n _ _).symm A = Matrix.toLin' A := rfl #align lie_equiv_matrix'_symm_apply lieEquivMatrix'_symm_apply def Matrix.lieConj (P : Matrix n n R) (h : Invertible P) : Matrix n n R ≃ₗ⁅R⁆ Matrix n n R := ((@lieEquivMatrix' R _ n _ _).symm.trans (P.toLinearEquiv' h).lieConj).trans lieEquivMatrix' #align matrix.lie_conj Matrix.lieConj @[simp]
Mathlib/Algebra/Lie/Matrix.lean
69
72
theorem Matrix.lieConj_apply (P A : Matrix n n R) (h : Invertible P) : P.lieConj h A = P * A * P⁻¹ := by
simp [LinearEquiv.conj_apply, Matrix.lieConj, LinearMap.toMatrix'_comp, LinearMap.toMatrix'_toLin']
1,857
import Mathlib.Algebra.Lie.OfAssociative import Mathlib.LinearAlgebra.Matrix.Reindex import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv #align_import algebra.lie.matrix from "leanprover-community/mathlib"@"55e2dfde0cff928ce5c70926a3f2c7dee3e2dd99" universe u v w w₁ wβ‚‚ section Matrices open scoped Matrix variable {R : Type u} [CommRing R] variable {n : Type w} [DecidableEq n] [Fintype n] def lieEquivMatrix' : Module.End R (n β†’ R) ≃ₗ⁅R⁆ Matrix n n R := { LinearMap.toMatrix' with map_lie' := fun {T S} => by let f := @LinearMap.toMatrix' R _ n n _ _ change f (T.comp S - S.comp T) = f T * f S - f S * f T have h : βˆ€ T S : Module.End R _, f (T.comp S) = f T * f S := LinearMap.toMatrix'_comp rw [map_sub, h, h] } #align lie_equiv_matrix' lieEquivMatrix' @[simp] theorem lieEquivMatrix'_apply (f : Module.End R (n β†’ R)) : lieEquivMatrix' f = LinearMap.toMatrix' f := rfl #align lie_equiv_matrix'_apply lieEquivMatrix'_apply @[simp] theorem lieEquivMatrix'_symm_apply (A : Matrix n n R) : (@lieEquivMatrix' R _ n _ _).symm A = Matrix.toLin' A := rfl #align lie_equiv_matrix'_symm_apply lieEquivMatrix'_symm_apply def Matrix.lieConj (P : Matrix n n R) (h : Invertible P) : Matrix n n R ≃ₗ⁅R⁆ Matrix n n R := ((@lieEquivMatrix' R _ n _ _).symm.trans (P.toLinearEquiv' h).lieConj).trans lieEquivMatrix' #align matrix.lie_conj Matrix.lieConj @[simp] theorem Matrix.lieConj_apply (P A : Matrix n n R) (h : Invertible P) : P.lieConj h A = P * A * P⁻¹ := by simp [LinearEquiv.conj_apply, Matrix.lieConj, LinearMap.toMatrix'_comp, LinearMap.toMatrix'_toLin'] #align matrix.lie_conj_apply Matrix.lieConj_apply @[simp]
Mathlib/Algebra/Lie/Matrix.lean
76
79
theorem Matrix.lieConj_symm_apply (P A : Matrix n n R) (h : Invertible P) : (P.lieConj h).symm A = P⁻¹ * A * P := by
simp [LinearEquiv.symm_conj_apply, Matrix.lieConj, LinearMap.toMatrix'_comp, LinearMap.toMatrix'_toLin']
1,857
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointEndomorphisms open LinearMap (BilinForm) variable {R : Type u} {M : Type v} [CommRing R] [AddCommGroup M] [Module R M] variable (B : BilinForm R M) -- Porting note: Changed `(f g)` to `{f g}` for convenience in `skewAdjointLieSubalgebra`
Mathlib/Algebra/Lie/SkewAdjoint.lean
46
53
theorem LinearMap.BilinForm.isSkewAdjoint_bracket {f g : Module.End R M} (hf : f ∈ B.skewAdjointSubmodule) (hg : g ∈ B.skewAdjointSubmodule) : ⁅f, g⁆ ∈ B.skewAdjointSubmodule := by
rw [mem_skewAdjointSubmodule] at * have hfg : IsAdjointPair B B (f * g) (g * f) := by rw [← neg_mul_neg g f]; exact hf.mul hg have hgf : IsAdjointPair B B (g * f) (f * g) := by rw [← neg_mul_neg f g]; exact hg.mul hf change IsAdjointPair B B (f * g - g * f) (-(f * g - g * f)); rw [neg_sub] exact hfg.sub hgf
1,858
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointEndomorphisms open LinearMap (BilinForm) variable {R : Type u} {M : Type v} [CommRing R] [AddCommGroup M] [Module R M] variable (B : BilinForm R M) -- Porting note: Changed `(f g)` to `{f g}` for convenience in `skewAdjointLieSubalgebra` theorem LinearMap.BilinForm.isSkewAdjoint_bracket {f g : Module.End R M} (hf : f ∈ B.skewAdjointSubmodule) (hg : g ∈ B.skewAdjointSubmodule) : ⁅f, g⁆ ∈ B.skewAdjointSubmodule := by rw [mem_skewAdjointSubmodule] at * have hfg : IsAdjointPair B B (f * g) (g * f) := by rw [← neg_mul_neg g f]; exact hf.mul hg have hgf : IsAdjointPair B B (g * f) (f * g) := by rw [← neg_mul_neg f g]; exact hg.mul hf change IsAdjointPair B B (f * g - g * f) (-(f * g - g * f)); rw [neg_sub] exact hfg.sub hgf #align bilin_form.is_skew_adjoint_bracket LinearMap.BilinForm.isSkewAdjoint_bracket def skewAdjointLieSubalgebra : LieSubalgebra R (Module.End R M) := { B.skewAdjointSubmodule with lie_mem' := B.isSkewAdjoint_bracket } #align skew_adjoint_lie_subalgebra skewAdjointLieSubalgebra variable {N : Type w} [AddCommGroup N] [Module R N] (e : N ≃ₗ[R] M) def skewAdjointLieSubalgebraEquiv : skewAdjointLieSubalgebra (B.compl₁₂ (↑e : N β†’β‚—[R] M) ↑e) ≃ₗ⁅R⁆ skewAdjointLieSubalgebra B := by apply LieEquiv.ofSubalgebras _ _ e.lieConj ext f simp only [LieSubalgebra.mem_coe, Submodule.mem_map_equiv, LieSubalgebra.mem_map_submodule, LinearEquiv.coe_coe] exact (LinearMap.isPairSelfAdjoint_equiv (B := -B) (F := B) e f).symm #align skew_adjoint_lie_subalgebra_equiv skewAdjointLieSubalgebraEquiv @[simp]
Mathlib/Algebra/Lie/SkewAdjoint.lean
77
80
theorem skewAdjointLieSubalgebraEquiv_apply (f : skewAdjointLieSubalgebra (B.compl₁₂ (Qβ‚— := N) (Qβ‚—' := N) ↑e ↑e)) : ↑(skewAdjointLieSubalgebraEquiv B e f) = e.lieConj f := by
simp [skewAdjointLieSubalgebraEquiv]
1,858
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointEndomorphisms open LinearMap (BilinForm) variable {R : Type u} {M : Type v} [CommRing R] [AddCommGroup M] [Module R M] variable (B : BilinForm R M) -- Porting note: Changed `(f g)` to `{f g}` for convenience in `skewAdjointLieSubalgebra` theorem LinearMap.BilinForm.isSkewAdjoint_bracket {f g : Module.End R M} (hf : f ∈ B.skewAdjointSubmodule) (hg : g ∈ B.skewAdjointSubmodule) : ⁅f, g⁆ ∈ B.skewAdjointSubmodule := by rw [mem_skewAdjointSubmodule] at * have hfg : IsAdjointPair B B (f * g) (g * f) := by rw [← neg_mul_neg g f]; exact hf.mul hg have hgf : IsAdjointPair B B (g * f) (f * g) := by rw [← neg_mul_neg f g]; exact hg.mul hf change IsAdjointPair B B (f * g - g * f) (-(f * g - g * f)); rw [neg_sub] exact hfg.sub hgf #align bilin_form.is_skew_adjoint_bracket LinearMap.BilinForm.isSkewAdjoint_bracket def skewAdjointLieSubalgebra : LieSubalgebra R (Module.End R M) := { B.skewAdjointSubmodule with lie_mem' := B.isSkewAdjoint_bracket } #align skew_adjoint_lie_subalgebra skewAdjointLieSubalgebra variable {N : Type w} [AddCommGroup N] [Module R N] (e : N ≃ₗ[R] M) def skewAdjointLieSubalgebraEquiv : skewAdjointLieSubalgebra (B.compl₁₂ (↑e : N β†’β‚—[R] M) ↑e) ≃ₗ⁅R⁆ skewAdjointLieSubalgebra B := by apply LieEquiv.ofSubalgebras _ _ e.lieConj ext f simp only [LieSubalgebra.mem_coe, Submodule.mem_map_equiv, LieSubalgebra.mem_map_submodule, LinearEquiv.coe_coe] exact (LinearMap.isPairSelfAdjoint_equiv (B := -B) (F := B) e f).symm #align skew_adjoint_lie_subalgebra_equiv skewAdjointLieSubalgebraEquiv @[simp] theorem skewAdjointLieSubalgebraEquiv_apply (f : skewAdjointLieSubalgebra (B.compl₁₂ (Qβ‚— := N) (Qβ‚—' := N) ↑e ↑e)) : ↑(skewAdjointLieSubalgebraEquiv B e f) = e.lieConj f := by simp [skewAdjointLieSubalgebraEquiv] #align skew_adjoint_lie_subalgebra_equiv_apply skewAdjointLieSubalgebraEquiv_apply @[simp]
Mathlib/Algebra/Lie/SkewAdjoint.lean
84
86
theorem skewAdjointLieSubalgebraEquiv_symm_apply (f : skewAdjointLieSubalgebra B) : ↑((skewAdjointLieSubalgebraEquiv B e).symm f) = e.symm.lieConj f := by
simp [skewAdjointLieSubalgebraEquiv]
1,858
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointMatrices open scoped Matrix variable {R : Type u} {n : Type w} [CommRing R] [DecidableEq n] [Fintype n] variable (J : Matrix n n R) theorem Matrix.lie_transpose (A B : Matrix n n R) : ⁅A, B⁆ᡀ = ⁅Bα΅€, Aᡀ⁆ := show (A * B - B * A)α΅€ = Bα΅€ * Aα΅€ - Aα΅€ * Bα΅€ by simp #align matrix.lie_transpose Matrix.lie_transpose -- Porting note: Changed `(A B)` to `{A B}` for convenience in `skewAdjointMatricesLieSubalgebra`
Mathlib/Algebra/Lie/SkewAdjoint.lean
103
112
theorem Matrix.isSkewAdjoint_bracket {A B : Matrix n n R} (hA : A ∈ skewAdjointMatricesSubmodule J) (hB : B ∈ skewAdjointMatricesSubmodule J) : ⁅A, B⁆ ∈ skewAdjointMatricesSubmodule J := by
simp only [mem_skewAdjointMatricesSubmodule] at * change ⁅A, B⁆ᡀ * J = J * (-⁅A, B⁆) change Aα΅€ * J = J * (-A) at hA change Bα΅€ * J = J * (-B) at hB rw [Matrix.lie_transpose, LieRing.of_associative_ring_bracket, LieRing.of_associative_ring_bracket, sub_mul, mul_assoc, mul_assoc, hA, hB, ← mul_assoc, ← mul_assoc, hA, hB] noncomm_ring
1,858
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointMatrices open scoped Matrix variable {R : Type u} {n : Type w} [CommRing R] [DecidableEq n] [Fintype n] variable (J : Matrix n n R) theorem Matrix.lie_transpose (A B : Matrix n n R) : ⁅A, B⁆ᡀ = ⁅Bα΅€, Aᡀ⁆ := show (A * B - B * A)α΅€ = Bα΅€ * Aα΅€ - Aα΅€ * Bα΅€ by simp #align matrix.lie_transpose Matrix.lie_transpose -- Porting note: Changed `(A B)` to `{A B}` for convenience in `skewAdjointMatricesLieSubalgebra` theorem Matrix.isSkewAdjoint_bracket {A B : Matrix n n R} (hA : A ∈ skewAdjointMatricesSubmodule J) (hB : B ∈ skewAdjointMatricesSubmodule J) : ⁅A, B⁆ ∈ skewAdjointMatricesSubmodule J := by simp only [mem_skewAdjointMatricesSubmodule] at * change ⁅A, B⁆ᡀ * J = J * (-⁅A, B⁆) change Aα΅€ * J = J * (-A) at hA change Bα΅€ * J = J * (-B) at hB rw [Matrix.lie_transpose, LieRing.of_associative_ring_bracket, LieRing.of_associative_ring_bracket, sub_mul, mul_assoc, mul_assoc, hA, hB, ← mul_assoc, ← mul_assoc, hA, hB] noncomm_ring #align matrix.is_skew_adjoint_bracket Matrix.isSkewAdjoint_bracket def skewAdjointMatricesLieSubalgebra : LieSubalgebra R (Matrix n n R) := { skewAdjointMatricesSubmodule J with lie_mem' := J.isSkewAdjoint_bracket } #align skew_adjoint_matrices_lie_subalgebra skewAdjointMatricesLieSubalgebra @[simp] theorem mem_skewAdjointMatricesLieSubalgebra (A : Matrix n n R) : A ∈ skewAdjointMatricesLieSubalgebra J ↔ A ∈ skewAdjointMatricesSubmodule J := Iff.rfl #align mem_skew_adjoint_matrices_lie_subalgebra mem_skewAdjointMatricesLieSubalgebra def skewAdjointMatricesLieSubalgebraEquiv (P : Matrix n n R) (h : Invertible P) : skewAdjointMatricesLieSubalgebra J ≃ₗ⁅R⁆ skewAdjointMatricesLieSubalgebra (Pα΅€ * J * P) := LieEquiv.ofSubalgebras _ _ (P.lieConj h).symm <| by ext A suffices P.lieConj h A ∈ skewAdjointMatricesSubmodule J ↔ A ∈ skewAdjointMatricesSubmodule (Pα΅€ * J * P) by simp only [LieSubalgebra.mem_coe, Submodule.mem_map_equiv, LieSubalgebra.mem_map_submodule, LinearEquiv.coe_coe] exact this simp [Matrix.IsSkewAdjoint, J.isAdjointPair_equiv _ _ P (isUnit_of_invertible P)] #align skew_adjoint_matrices_lie_subalgebra_equiv skewAdjointMatricesLieSubalgebraEquiv -- TODO(mathlib4#6607): fix elaboration so annotation on `A` isn't needed
Mathlib/Algebra/Lie/SkewAdjoint.lean
142
145
theorem skewAdjointMatricesLieSubalgebraEquiv_apply (P : Matrix n n R) (h : Invertible P) (A : skewAdjointMatricesLieSubalgebra J) : ↑(skewAdjointMatricesLieSubalgebraEquiv J P h A) = P⁻¹ * (A : Matrix n n R) * P := by
simp [skewAdjointMatricesLieSubalgebraEquiv]
1,858
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointMatrices open scoped Matrix variable {R : Type u} {n : Type w} [CommRing R] [DecidableEq n] [Fintype n] variable (J : Matrix n n R) theorem Matrix.lie_transpose (A B : Matrix n n R) : ⁅A, B⁆ᡀ = ⁅Bα΅€, Aᡀ⁆ := show (A * B - B * A)α΅€ = Bα΅€ * Aα΅€ - Aα΅€ * Bα΅€ by simp #align matrix.lie_transpose Matrix.lie_transpose -- Porting note: Changed `(A B)` to `{A B}` for convenience in `skewAdjointMatricesLieSubalgebra` theorem Matrix.isSkewAdjoint_bracket {A B : Matrix n n R} (hA : A ∈ skewAdjointMatricesSubmodule J) (hB : B ∈ skewAdjointMatricesSubmodule J) : ⁅A, B⁆ ∈ skewAdjointMatricesSubmodule J := by simp only [mem_skewAdjointMatricesSubmodule] at * change ⁅A, B⁆ᡀ * J = J * (-⁅A, B⁆) change Aα΅€ * J = J * (-A) at hA change Bα΅€ * J = J * (-B) at hB rw [Matrix.lie_transpose, LieRing.of_associative_ring_bracket, LieRing.of_associative_ring_bracket, sub_mul, mul_assoc, mul_assoc, hA, hB, ← mul_assoc, ← mul_assoc, hA, hB] noncomm_ring #align matrix.is_skew_adjoint_bracket Matrix.isSkewAdjoint_bracket def skewAdjointMatricesLieSubalgebra : LieSubalgebra R (Matrix n n R) := { skewAdjointMatricesSubmodule J with lie_mem' := J.isSkewAdjoint_bracket } #align skew_adjoint_matrices_lie_subalgebra skewAdjointMatricesLieSubalgebra @[simp] theorem mem_skewAdjointMatricesLieSubalgebra (A : Matrix n n R) : A ∈ skewAdjointMatricesLieSubalgebra J ↔ A ∈ skewAdjointMatricesSubmodule J := Iff.rfl #align mem_skew_adjoint_matrices_lie_subalgebra mem_skewAdjointMatricesLieSubalgebra def skewAdjointMatricesLieSubalgebraEquiv (P : Matrix n n R) (h : Invertible P) : skewAdjointMatricesLieSubalgebra J ≃ₗ⁅R⁆ skewAdjointMatricesLieSubalgebra (Pα΅€ * J * P) := LieEquiv.ofSubalgebras _ _ (P.lieConj h).symm <| by ext A suffices P.lieConj h A ∈ skewAdjointMatricesSubmodule J ↔ A ∈ skewAdjointMatricesSubmodule (Pα΅€ * J * P) by simp only [LieSubalgebra.mem_coe, Submodule.mem_map_equiv, LieSubalgebra.mem_map_submodule, LinearEquiv.coe_coe] exact this simp [Matrix.IsSkewAdjoint, J.isAdjointPair_equiv _ _ P (isUnit_of_invertible P)] #align skew_adjoint_matrices_lie_subalgebra_equiv skewAdjointMatricesLieSubalgebraEquiv -- TODO(mathlib4#6607): fix elaboration so annotation on `A` isn't needed theorem skewAdjointMatricesLieSubalgebraEquiv_apply (P : Matrix n n R) (h : Invertible P) (A : skewAdjointMatricesLieSubalgebra J) : ↑(skewAdjointMatricesLieSubalgebraEquiv J P h A) = P⁻¹ * (A : Matrix n n R) * P := by simp [skewAdjointMatricesLieSubalgebraEquiv] #align skew_adjoint_matrices_lie_subalgebra_equiv_apply skewAdjointMatricesLieSubalgebraEquiv_apply def skewAdjointMatricesLieSubalgebraEquivTranspose {m : Type w} [DecidableEq m] [Fintype m] (e : Matrix n n R ≃ₐ[R] Matrix m m R) (h : βˆ€ A, (e A)α΅€ = e Aα΅€) : skewAdjointMatricesLieSubalgebra J ≃ₗ⁅R⁆ skewAdjointMatricesLieSubalgebra (e J) := LieEquiv.ofSubalgebras _ _ e.toLieEquiv <| by ext A suffices J.IsSkewAdjoint (e.symm A) ↔ (e J).IsSkewAdjoint A by -- Porting note: Originally `simpa [this]` simpa [- LieSubalgebra.mem_map, LieSubalgebra.mem_map_submodule] simp only [Matrix.IsSkewAdjoint, Matrix.IsAdjointPair, ← h, ← Function.Injective.eq_iff e.injective, map_mul, AlgEquiv.apply_symm_apply, map_neg] #align skew_adjoint_matrices_lie_subalgebra_equiv_transpose skewAdjointMatricesLieSubalgebraEquivTranspose @[simp] theorem skewAdjointMatricesLieSubalgebraEquivTranspose_apply {m : Type w} [DecidableEq m] [Fintype m] (e : Matrix n n R ≃ₐ[R] Matrix m m R) (h : βˆ€ A, (e A)α΅€ = e Aα΅€) (A : skewAdjointMatricesLieSubalgebra J) : (skewAdjointMatricesLieSubalgebraEquivTranspose J e h A : Matrix m m R) = e A := rfl #align skew_adjoint_matrices_lie_subalgebra_equiv_transpose_apply skewAdjointMatricesLieSubalgebraEquivTranspose_apply
Mathlib/Algebra/Lie/SkewAdjoint.lean
170
176
theorem mem_skewAdjointMatricesLieSubalgebra_unit_smul (u : RΛ£) (J A : Matrix n n R) : A ∈ skewAdjointMatricesLieSubalgebra (u β€’ J) ↔ A ∈ skewAdjointMatricesLieSubalgebra J := by
change A ∈ skewAdjointMatricesSubmodule (u β€’ J) ↔ A ∈ skewAdjointMatricesSubmodule J simp only [mem_skewAdjointMatricesSubmodule, Matrix.IsSkewAdjoint, Matrix.IsAdjointPair] constructor <;> intro h Β· simpa using congr_arg (fun B => u⁻¹ β€’ B) h Β· simp [h]
1,858
import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.Algebra.Star.Unitary #align_import linear_algebra.unitary_group from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9" universe u v namespace Matrix open LinearMap Matrix section variable (n : Type u) [DecidableEq n] [Fintype n] variable (Ξ± : Type v) [CommRing Ξ±] [StarRing Ξ±] abbrev unitaryGroup := unitary (Matrix n n Ξ±) #align matrix.unitary_group Matrix.unitaryGroup end variable {n : Type u} [DecidableEq n] [Fintype n] variable {Ξ± : Type v} [CommRing Ξ±] [StarRing Ξ±] {A : Matrix n n Ξ±}
Mathlib/LinearAlgebra/UnitaryGroup.lean
66
68
theorem mem_unitaryGroup_iff : A ∈ Matrix.unitaryGroup n Ξ± ↔ A * star A = 1 := by
refine ⟨And.right, fun hA => ⟨?_, hA⟩⟩ simpa only [mul_eq_one_comm] using hA
1,859
import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.Algebra.Star.Unitary #align_import linear_algebra.unitary_group from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9" universe u v namespace Matrix open LinearMap Matrix section variable (n : Type u) [DecidableEq n] [Fintype n] variable (Ξ± : Type v) [CommRing Ξ±] [StarRing Ξ±] abbrev unitaryGroup := unitary (Matrix n n Ξ±) #align matrix.unitary_group Matrix.unitaryGroup end variable {n : Type u} [DecidableEq n] [Fintype n] variable {Ξ± : Type v} [CommRing Ξ±] [StarRing Ξ±] {A : Matrix n n Ξ±} theorem mem_unitaryGroup_iff : A ∈ Matrix.unitaryGroup n Ξ± ↔ A * star A = 1 := by refine ⟨And.right, fun hA => ⟨?_, hA⟩⟩ simpa only [mul_eq_one_comm] using hA #align matrix.mem_unitary_group_iff Matrix.mem_unitaryGroup_iff
Mathlib/LinearAlgebra/UnitaryGroup.lean
71
73
theorem mem_unitaryGroup_iff' : A ∈ Matrix.unitaryGroup n Ξ± ↔ star A * A = 1 := by
refine ⟨And.left, fun hA => ⟨hA, ?_⟩⟩ rwa [mul_eq_one_comm] at hA
1,859
import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.Algebra.Star.Unitary #align_import linear_algebra.unitary_group from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9" universe u v namespace Matrix open LinearMap Matrix section variable (n : Type u) [DecidableEq n] [Fintype n] variable (Ξ± : Type v) [CommRing Ξ±] [StarRing Ξ±] abbrev unitaryGroup := unitary (Matrix n n Ξ±) #align matrix.unitary_group Matrix.unitaryGroup end variable {n : Type u} [DecidableEq n] [Fintype n] variable {Ξ± : Type v} [CommRing Ξ±] [StarRing Ξ±] {A : Matrix n n Ξ±} theorem mem_unitaryGroup_iff : A ∈ Matrix.unitaryGroup n Ξ± ↔ A * star A = 1 := by refine ⟨And.right, fun hA => ⟨?_, hA⟩⟩ simpa only [mul_eq_one_comm] using hA #align matrix.mem_unitary_group_iff Matrix.mem_unitaryGroup_iff theorem mem_unitaryGroup_iff' : A ∈ Matrix.unitaryGroup n Ξ± ↔ star A * A = 1 := by refine ⟨And.left, fun hA => ⟨hA, ?_⟩⟩ rwa [mul_eq_one_comm] at hA #align matrix.mem_unitary_group_iff' Matrix.mem_unitaryGroup_iff'
Mathlib/LinearAlgebra/UnitaryGroup.lean
76
80
theorem det_of_mem_unitary {A : Matrix n n α} (hA : A ∈ Matrix.unitaryGroup n α) : A.det ∈ unitary α := by
constructor Β· simpa [star, det_transpose] using congr_arg det hA.1 Β· simpa [star, det_transpose] using congr_arg det hA.2
1,859
import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.RingTheory.PolynomialAlgebra #align_import linear_algebra.matrix.charpoly.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe u v w namespace Matrix open Finset Matrix Polynomial variable {R S : Type*} [CommRing R] [CommRing S] variable {m n : Type*} [DecidableEq m] [DecidableEq n] [Fintype m] [Fintype n] variable (M₁₁ : Matrix m m R) (M₁₂ : Matrix m n R) (M₂₁ : Matrix n m R) (Mβ‚‚β‚‚ M : Matrix n n R) variable (i j : n) def charmatrix (M : Matrix n n R) : Matrix n n R[X] := Matrix.scalar n (X : R[X]) - (C : R β†’+* R[X]).mapMatrix M #align charmatrix Matrix.charmatrix theorem charmatrix_apply : charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) := rfl #align charmatrix_apply Matrix.charmatrix_apply @[simp]
Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean
55
57
theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) := by
simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, map_apply, diagonal_apply_eq]
1,860
import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.RingTheory.PolynomialAlgebra #align_import linear_algebra.matrix.charpoly.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe u v w namespace Matrix open Finset Matrix Polynomial variable {R S : Type*} [CommRing R] [CommRing S] variable {m n : Type*} [DecidableEq m] [DecidableEq n] [Fintype m] [Fintype n] variable (M₁₁ : Matrix m m R) (M₁₂ : Matrix m n R) (M₂₁ : Matrix n m R) (Mβ‚‚β‚‚ M : Matrix n n R) variable (i j : n) def charmatrix (M : Matrix n n R) : Matrix n n R[X] := Matrix.scalar n (X : R[X]) - (C : R β†’+* R[X]).mapMatrix M #align charmatrix Matrix.charmatrix theorem charmatrix_apply : charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) := rfl #align charmatrix_apply Matrix.charmatrix_apply @[simp] theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, map_apply, diagonal_apply_eq] #align charmatrix_apply_eq Matrix.charmatrix_apply_eq @[simp]
Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean
62
64
theorem charmatrix_apply_ne (h : i β‰  j) : charmatrix M i j = -C (M i j) := by
simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, diagonal_apply_ne _ h, map_apply, sub_eq_neg_self]
1,860
import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.RingTheory.PolynomialAlgebra #align_import linear_algebra.matrix.charpoly.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe u v w namespace Matrix open Finset Matrix Polynomial variable {R S : Type*} [CommRing R] [CommRing S] variable {m n : Type*} [DecidableEq m] [DecidableEq n] [Fintype m] [Fintype n] variable (M₁₁ : Matrix m m R) (M₁₂ : Matrix m n R) (M₂₁ : Matrix n m R) (Mβ‚‚β‚‚ M : Matrix n n R) variable (i j : n) def charmatrix (M : Matrix n n R) : Matrix n n R[X] := Matrix.scalar n (X : R[X]) - (C : R β†’+* R[X]).mapMatrix M #align charmatrix Matrix.charmatrix theorem charmatrix_apply : charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) := rfl #align charmatrix_apply Matrix.charmatrix_apply @[simp] theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, map_apply, diagonal_apply_eq] #align charmatrix_apply_eq Matrix.charmatrix_apply_eq @[simp] theorem charmatrix_apply_ne (h : i β‰  j) : charmatrix M i j = -C (M i j) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, diagonal_apply_ne _ h, map_apply, sub_eq_neg_self] #align charmatrix_apply_ne Matrix.charmatrix_apply_ne
Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean
67
76
theorem matPolyEquiv_charmatrix : matPolyEquiv (charmatrix M) = X - C M := by
ext k i j simp only [matPolyEquiv_coeff_apply, coeff_sub, Pi.sub_apply] by_cases h : i = j Β· subst h rw [charmatrix_apply_eq, coeff_sub] simp only [coeff_X, coeff_C] split_ifs <;> simp Β· rw [charmatrix_apply_ne _ _ _ h, coeff_X, coeff_neg, coeff_C, coeff_C] split_ifs <;> simp [h]
1,860
import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.RingTheory.PolynomialAlgebra #align_import linear_algebra.matrix.charpoly.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe u v w namespace Matrix open Finset Matrix Polynomial variable {R S : Type*} [CommRing R] [CommRing S] variable {m n : Type*} [DecidableEq m] [DecidableEq n] [Fintype m] [Fintype n] variable (M₁₁ : Matrix m m R) (M₁₂ : Matrix m n R) (M₂₁ : Matrix n m R) (Mβ‚‚β‚‚ M : Matrix n n R) variable (i j : n) def charmatrix (M : Matrix n n R) : Matrix n n R[X] := Matrix.scalar n (X : R[X]) - (C : R β†’+* R[X]).mapMatrix M #align charmatrix Matrix.charmatrix theorem charmatrix_apply : charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) := rfl #align charmatrix_apply Matrix.charmatrix_apply @[simp] theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, map_apply, diagonal_apply_eq] #align charmatrix_apply_eq Matrix.charmatrix_apply_eq @[simp] theorem charmatrix_apply_ne (h : i β‰  j) : charmatrix M i j = -C (M i j) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, diagonal_apply_ne _ h, map_apply, sub_eq_neg_self] #align charmatrix_apply_ne Matrix.charmatrix_apply_ne theorem matPolyEquiv_charmatrix : matPolyEquiv (charmatrix M) = X - C M := by ext k i j simp only [matPolyEquiv_coeff_apply, coeff_sub, Pi.sub_apply] by_cases h : i = j Β· subst h rw [charmatrix_apply_eq, coeff_sub] simp only [coeff_X, coeff_C] split_ifs <;> simp Β· rw [charmatrix_apply_ne _ _ _ h, coeff_X, coeff_neg, coeff_C, coeff_C] split_ifs <;> simp [h] #align mat_poly_equiv_charmatrix Matrix.matPolyEquiv_charmatrix
Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean
79
83
theorem charmatrix_reindex (e : n ≃ m) : charmatrix (reindex e e M) = reindex e e (charmatrix M) := by
ext i j x by_cases h : i = j all_goals simp [h]
1,860
import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.RingTheory.PolynomialAlgebra #align_import linear_algebra.matrix.charpoly.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe u v w namespace Matrix open Finset Matrix Polynomial variable {R S : Type*} [CommRing R] [CommRing S] variable {m n : Type*} [DecidableEq m] [DecidableEq n] [Fintype m] [Fintype n] variable (M₁₁ : Matrix m m R) (M₁₂ : Matrix m n R) (M₂₁ : Matrix n m R) (Mβ‚‚β‚‚ M : Matrix n n R) variable (i j : n) def charmatrix (M : Matrix n n R) : Matrix n n R[X] := Matrix.scalar n (X : R[X]) - (C : R β†’+* R[X]).mapMatrix M #align charmatrix Matrix.charmatrix theorem charmatrix_apply : charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) := rfl #align charmatrix_apply Matrix.charmatrix_apply @[simp] theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, map_apply, diagonal_apply_eq] #align charmatrix_apply_eq Matrix.charmatrix_apply_eq @[simp] theorem charmatrix_apply_ne (h : i β‰  j) : charmatrix M i j = -C (M i j) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, diagonal_apply_ne _ h, map_apply, sub_eq_neg_self] #align charmatrix_apply_ne Matrix.charmatrix_apply_ne theorem matPolyEquiv_charmatrix : matPolyEquiv (charmatrix M) = X - C M := by ext k i j simp only [matPolyEquiv_coeff_apply, coeff_sub, Pi.sub_apply] by_cases h : i = j Β· subst h rw [charmatrix_apply_eq, coeff_sub] simp only [coeff_X, coeff_C] split_ifs <;> simp Β· rw [charmatrix_apply_ne _ _ _ h, coeff_X, coeff_neg, coeff_C, coeff_C] split_ifs <;> simp [h] #align mat_poly_equiv_charmatrix Matrix.matPolyEquiv_charmatrix theorem charmatrix_reindex (e : n ≃ m) : charmatrix (reindex e e M) = reindex e e (charmatrix M) := by ext i j x by_cases h : i = j all_goals simp [h] #align charmatrix_reindex Matrix.charmatrix_reindex lemma charmatrix_map (M : Matrix n n R) (f : R β†’+* S) : charmatrix (M.map f) = (charmatrix M).map (Polynomial.map f) := by ext i j by_cases h : i = j <;> simp [h, charmatrix, diagonal] lemma charmatrix_fromBlocks : charmatrix (fromBlocks M₁₁ M₁₂ M₂₁ Mβ‚‚β‚‚) = fromBlocks (charmatrix M₁₁) (- M₁₂.map C) (- M₂₁.map C) (charmatrix Mβ‚‚β‚‚) := by simp only [charmatrix] ext (i|i) (j|j) : 2 <;> simp [diagonal] def charpoly (M : Matrix n n R) : R[X] := (charmatrix M).det #align matrix.charpoly Matrix.charpoly
Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean
103
106
theorem charpoly_reindex (e : n ≃ m) (M : Matrix n n R) : (reindex e e M).charpoly = M.charpoly := by
unfold Matrix.charpoly rw [charmatrix_reindex, Matrix.det_reindex_self]
1,860
import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.RingTheory.PolynomialAlgebra #align_import linear_algebra.matrix.charpoly.basic from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section universe u v w namespace Matrix open Finset Matrix Polynomial variable {R S : Type*} [CommRing R] [CommRing S] variable {m n : Type*} [DecidableEq m] [DecidableEq n] [Fintype m] [Fintype n] variable (M₁₁ : Matrix m m R) (M₁₂ : Matrix m n R) (M₂₁ : Matrix n m R) (Mβ‚‚β‚‚ M : Matrix n n R) variable (i j : n) def charmatrix (M : Matrix n n R) : Matrix n n R[X] := Matrix.scalar n (X : R[X]) - (C : R β†’+* R[X]).mapMatrix M #align charmatrix Matrix.charmatrix theorem charmatrix_apply : charmatrix M i j = (Matrix.diagonal fun _ : n => X) i j - C (M i j) := rfl #align charmatrix_apply Matrix.charmatrix_apply @[simp] theorem charmatrix_apply_eq : charmatrix M i i = (X : R[X]) - C (M i i) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, map_apply, diagonal_apply_eq] #align charmatrix_apply_eq Matrix.charmatrix_apply_eq @[simp] theorem charmatrix_apply_ne (h : i β‰  j) : charmatrix M i j = -C (M i j) := by simp only [charmatrix, RingHom.mapMatrix_apply, sub_apply, scalar_apply, diagonal_apply_ne _ h, map_apply, sub_eq_neg_self] #align charmatrix_apply_ne Matrix.charmatrix_apply_ne theorem matPolyEquiv_charmatrix : matPolyEquiv (charmatrix M) = X - C M := by ext k i j simp only [matPolyEquiv_coeff_apply, coeff_sub, Pi.sub_apply] by_cases h : i = j Β· subst h rw [charmatrix_apply_eq, coeff_sub] simp only [coeff_X, coeff_C] split_ifs <;> simp Β· rw [charmatrix_apply_ne _ _ _ h, coeff_X, coeff_neg, coeff_C, coeff_C] split_ifs <;> simp [h] #align mat_poly_equiv_charmatrix Matrix.matPolyEquiv_charmatrix theorem charmatrix_reindex (e : n ≃ m) : charmatrix (reindex e e M) = reindex e e (charmatrix M) := by ext i j x by_cases h : i = j all_goals simp [h] #align charmatrix_reindex Matrix.charmatrix_reindex lemma charmatrix_map (M : Matrix n n R) (f : R β†’+* S) : charmatrix (M.map f) = (charmatrix M).map (Polynomial.map f) := by ext i j by_cases h : i = j <;> simp [h, charmatrix, diagonal] lemma charmatrix_fromBlocks : charmatrix (fromBlocks M₁₁ M₁₂ M₂₁ Mβ‚‚β‚‚) = fromBlocks (charmatrix M₁₁) (- M₁₂.map C) (- M₂₁.map C) (charmatrix Mβ‚‚β‚‚) := by simp only [charmatrix] ext (i|i) (j|j) : 2 <;> simp [diagonal] def charpoly (M : Matrix n n R) : R[X] := (charmatrix M).det #align matrix.charpoly Matrix.charpoly theorem charpoly_reindex (e : n ≃ m) (M : Matrix n n R) : (reindex e e M).charpoly = M.charpoly := by unfold Matrix.charpoly rw [charmatrix_reindex, Matrix.det_reindex_self] #align matrix.charpoly_reindex Matrix.charpoly_reindex lemma charpoly_map (M : Matrix n n R) (f : R β†’+* S) : (M.map f).charpoly = M.charpoly.map f := by rw [charpoly, charmatrix_map, ← Polynomial.coe_mapRingHom, charpoly, RingHom.map_det, RingHom.mapMatrix_apply] @[simp] lemma charpoly_fromBlocks_zero₁₂ : (fromBlocks M₁₁ 0 M₂₁ Mβ‚‚β‚‚).charpoly = (M₁₁.charpoly * Mβ‚‚β‚‚.charpoly) := by simp only [charpoly, charmatrix_fromBlocks, Matrix.map_zero _ (Polynomial.C_0), neg_zero, det_fromBlocks_zero₁₂] @[simp] lemma charpoly_fromBlocks_zero₂₁ : (fromBlocks M₁₁ M₁₂ 0 Mβ‚‚β‚‚).charpoly = (M₁₁.charpoly * Mβ‚‚β‚‚.charpoly) := by simp only [charpoly, charmatrix_fromBlocks, Matrix.map_zero _ (Polynomial.C_0), neg_zero, det_fromBlocks_zero₂₁] -- This proof follows http://drorbn.net/AcademicPensieve/2015-12/CayleyHamilton.pdf
Mathlib/LinearAlgebra/Matrix/Charpoly/Basic.lean
134
154
theorem aeval_self_charpoly (M : Matrix n n R) : aeval M M.charpoly = 0 := by
-- We begin with the fact $Ο‡_M(t) I = adjugate (t I - M) * (t I - M)$, -- as an identity in `Matrix n n R[X]`. have h : M.charpoly β€’ (1 : Matrix n n R[X]) = adjugate (charmatrix M) * charmatrix M := (adjugate_mul _).symm -- Using the algebra isomorphism `Matrix n n R[X] ≃ₐ[R] Polynomial (Matrix n n R)`, -- we have the same identity in `Polynomial (Matrix n n R)`. apply_fun matPolyEquiv at h simp only [matPolyEquiv.map_mul, matPolyEquiv_charmatrix] at h -- Because the coefficient ring `Matrix n n R` is non-commutative, -- evaluation at `M` is not multiplicative. -- However, any polynomial which is a product of the form $N * (t I - M)$ -- is sent to zero, because the evaluation function puts the polynomial variable -- to the right of any coefficients, so everything telescopes. apply_fun fun p => p.eval M at h rw [eval_mul_X_sub_C] at h -- Now $Ο‡_M (t) I$, when thought of as a polynomial of matrices -- and evaluated at some `N` is exactly $Ο‡_M (N)$. rw [matPolyEquiv_smul_one, eval_map] at h -- Thus we have $Ο‡_M(M) = 0$, which is the desired result. exact h
1,860
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R]
Mathlib/RingTheory/Polynomial/Quotient.lean
87
91
theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by
intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha
1,861
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero
Mathlib/RingTheory/Polynomial/Quotient.lean
94
107
theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by
intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h]
1,861
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h] #align ideal.evalβ‚‚_C_mk_eq_zero Ideal.evalβ‚‚_C_mk_eq_zero def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : (R β§Έ I)[X] ≃+* R[X] β§Έ (map C I : Ideal R[X]) where toFun := evalβ‚‚RingHom (Quotient.lift I ((Quotient.mk (map C I : Ideal R[X])).comp C) quotient_map_C_eq_zero) (Quotient.mk (map C I : Ideal R[X]) X) invFun := Quotient.lift (map C I : Ideal R[X]) (evalβ‚‚RingHom (C.comp (Quotient.mk I)) X) evalβ‚‚_C_mk_eq_zero map_mul' f g := by simp only [coe_evalβ‚‚RingHom, evalβ‚‚_mul] map_add' f g := by simp only [evalβ‚‚_add, coe_evalβ‚‚RingHom] left_inv := by intro f refine Polynomial.induction_on' f ?_ ?_ Β· intro p q hp hq simp only [coe_evalβ‚‚RingHom] at hp hq simp only [coe_evalβ‚‚RingHom, hp, hq, RingHom.map_add] Β· rintro n ⟨x⟩ simp only [← smul_X_eq_monomial, C_mul', Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] right_inv := by rintro ⟨f⟩ refine Polynomial.induction_on' f ?_ ?_ Β· -- Porting note: was `simp_intro p q hp hq` intros p q hp hq simp only [Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, map_add, Quotient.lift_mk, coe_evalβ‚‚RingHom] at hp hq ⊒ rw [hp, hq] Β· intro n a simp only [← smul_X_eq_monomial, ← C_mul' a (X ^ n), Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] #align ideal.polynomial_quotient_equiv_quotient_polynomial Ideal.polynomialQuotientEquivQuotientPolynomial @[simp]
Mathlib/RingTheory/Polynomial/Quotient.lean
150
154
theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by
rw [polynomialQuotientEquivQuotientPolynomial, RingEquiv.symm_mk, RingEquiv.coe_mk, Equiv.coe_fn_mk, Quotient.lift_mk, coe_evalβ‚‚RingHom, evalβ‚‚_eq_eval_map, ← Polynomial.map_map, ← evalβ‚‚_eq_eval_map, Polynomial.evalβ‚‚_C_X]
1,861
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h] #align ideal.evalβ‚‚_C_mk_eq_zero Ideal.evalβ‚‚_C_mk_eq_zero def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : (R β§Έ I)[X] ≃+* R[X] β§Έ (map C I : Ideal R[X]) where toFun := evalβ‚‚RingHom (Quotient.lift I ((Quotient.mk (map C I : Ideal R[X])).comp C) quotient_map_C_eq_zero) (Quotient.mk (map C I : Ideal R[X]) X) invFun := Quotient.lift (map C I : Ideal R[X]) (evalβ‚‚RingHom (C.comp (Quotient.mk I)) X) evalβ‚‚_C_mk_eq_zero map_mul' f g := by simp only [coe_evalβ‚‚RingHom, evalβ‚‚_mul] map_add' f g := by simp only [evalβ‚‚_add, coe_evalβ‚‚RingHom] left_inv := by intro f refine Polynomial.induction_on' f ?_ ?_ Β· intro p q hp hq simp only [coe_evalβ‚‚RingHom] at hp hq simp only [coe_evalβ‚‚RingHom, hp, hq, RingHom.map_add] Β· rintro n ⟨x⟩ simp only [← smul_X_eq_monomial, C_mul', Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] right_inv := by rintro ⟨f⟩ refine Polynomial.induction_on' f ?_ ?_ Β· -- Porting note: was `simp_intro p q hp hq` intros p q hp hq simp only [Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, map_add, Quotient.lift_mk, coe_evalβ‚‚RingHom] at hp hq ⊒ rw [hp, hq] Β· intro n a simp only [← smul_X_eq_monomial, ← C_mul' a (X ^ n), Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] #align ideal.polynomial_quotient_equiv_quotient_polynomial Ideal.polynomialQuotientEquivQuotientPolynomial @[simp] theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by rw [polynomialQuotientEquivQuotientPolynomial, RingEquiv.symm_mk, RingEquiv.coe_mk, Equiv.coe_fn_mk, Quotient.lift_mk, coe_evalβ‚‚RingHom, evalβ‚‚_eq_eval_map, ← Polynomial.map_map, ← evalβ‚‚_eq_eval_map, Polynomial.evalβ‚‚_C_X] #align ideal.polynomial_quotient_equiv_quotient_polynomial_symm_mk Ideal.polynomialQuotientEquivQuotientPolynomial_symm_mk @[simp]
Mathlib/RingTheory/Polynomial/Quotient.lean
158
162
theorem polynomialQuotientEquivQuotientPolynomial_map_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial (f.map <| Quotient.mk I) = Quotient.mk (map C I : Ideal R[X]) f := by
apply (polynomialQuotientEquivQuotientPolynomial I).symm.injective rw [RingEquiv.symm_apply_apply, polynomialQuotientEquivQuotientPolynomial_symm_mk]
1,861
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h] #align ideal.evalβ‚‚_C_mk_eq_zero Ideal.evalβ‚‚_C_mk_eq_zero def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : (R β§Έ I)[X] ≃+* R[X] β§Έ (map C I : Ideal R[X]) where toFun := evalβ‚‚RingHom (Quotient.lift I ((Quotient.mk (map C I : Ideal R[X])).comp C) quotient_map_C_eq_zero) (Quotient.mk (map C I : Ideal R[X]) X) invFun := Quotient.lift (map C I : Ideal R[X]) (evalβ‚‚RingHom (C.comp (Quotient.mk I)) X) evalβ‚‚_C_mk_eq_zero map_mul' f g := by simp only [coe_evalβ‚‚RingHom, evalβ‚‚_mul] map_add' f g := by simp only [evalβ‚‚_add, coe_evalβ‚‚RingHom] left_inv := by intro f refine Polynomial.induction_on' f ?_ ?_ Β· intro p q hp hq simp only [coe_evalβ‚‚RingHom] at hp hq simp only [coe_evalβ‚‚RingHom, hp, hq, RingHom.map_add] Β· rintro n ⟨x⟩ simp only [← smul_X_eq_monomial, C_mul', Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] right_inv := by rintro ⟨f⟩ refine Polynomial.induction_on' f ?_ ?_ Β· -- Porting note: was `simp_intro p q hp hq` intros p q hp hq simp only [Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, map_add, Quotient.lift_mk, coe_evalβ‚‚RingHom] at hp hq ⊒ rw [hp, hq] Β· intro n a simp only [← smul_X_eq_monomial, ← C_mul' a (X ^ n), Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] #align ideal.polynomial_quotient_equiv_quotient_polynomial Ideal.polynomialQuotientEquivQuotientPolynomial @[simp] theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by rw [polynomialQuotientEquivQuotientPolynomial, RingEquiv.symm_mk, RingEquiv.coe_mk, Equiv.coe_fn_mk, Quotient.lift_mk, coe_evalβ‚‚RingHom, evalβ‚‚_eq_eval_map, ← Polynomial.map_map, ← evalβ‚‚_eq_eval_map, Polynomial.evalβ‚‚_C_X] #align ideal.polynomial_quotient_equiv_quotient_polynomial_symm_mk Ideal.polynomialQuotientEquivQuotientPolynomial_symm_mk @[simp] theorem polynomialQuotientEquivQuotientPolynomial_map_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial (f.map <| Quotient.mk I) = Quotient.mk (map C I : Ideal R[X]) f := by apply (polynomialQuotientEquivQuotientPolynomial I).symm.injective rw [RingEquiv.symm_apply_apply, polynomialQuotientEquivQuotientPolynomial_symm_mk] #align ideal.polynomial_quotient_equiv_quotient_polynomial_map_mk Ideal.polynomialQuotientEquivQuotientPolynomial_map_mk theorem isDomain_map_C_quotient {P : Ideal R} (_ : IsPrime P) : IsDomain (R[X] β§Έ (map (C : R β†’+* R[X]) P : Ideal R[X])) := MulEquiv.isDomain (Polynomial (R β§Έ P)) (polynomialQuotientEquivQuotientPolynomial P).symm #align ideal.is_domain_map_C_quotient Ideal.isDomain_map_C_quotient
Mathlib/RingTheory/Polynomial/Quotient.lean
175
194
theorem eq_zero_of_polynomial_mem_map_range (I : Ideal R[X]) (x : ((Quotient.mk I).comp C).range) (hx : C x ∈ I.map (Polynomial.mapRingHom ((Quotient.mk I).comp C).rangeRestrict)) : x = 0 := by
let i := ((Quotient.mk I).comp C).rangeRestrict have hi' : RingHom.ker (Polynomial.mapRingHom i) ≀ I := by refine fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => ?_ rw [mem_comap, ← Quotient.eq_zero_iff_mem, ← RingHom.comp_apply] rw [RingHom.mem_ker, coe_mapRingHom] at hf replace hf := congr_arg (fun f : Polynomial _ => f.coeff n) hf simp only [coeff_map, coeff_zero] at hf rwa [Subtype.ext_iff, RingHom.coe_rangeRestrict] at hf obtain ⟨x, hx'⟩ := x obtain ⟨y, rfl⟩ := RingHom.mem_range.1 hx' refine Subtype.eq ?_ simp only [RingHom.comp_apply, Quotient.eq_zero_iff_mem, ZeroMemClass.coe_zero] suffices C (i y) ∈ I.map (Polynomial.mapRingHom i) by obtain ⟨f, hf⟩ := mem_image_of_mem_map_of_surjective (Polynomial.mapRingHom i) (Polynomial.map_surjective _ (RingHom.rangeRestrict_surjective ((Quotient.mk I).comp C))) this refine sub_add_cancel (C y) f β–Έ I.add_mem (hi' ?_ : C y - f ∈ I) hf.1 rw [RingHom.mem_ker, RingHom.map_sub, hf.2, sub_eq_zero, coe_mapRingHom, map_C] exact hx
1,861
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace MvPolynomial variable {R : Type*} {Οƒ : Type*} [CommRing R] {r : R}
Mathlib/RingTheory/Polynomial/Quotient.lean
205
209
theorem quotient_map_C_eq_zero {I : Ideal R} {i : R} (hi : i ∈ I) : (Ideal.Quotient.mk (Ideal.map (C : R β†’+* MvPolynomial Οƒ R) I : Ideal (MvPolynomial Οƒ R))).comp C i = 0 := by
simp only [Function.comp_apply, RingHom.coe_comp, Ideal.Quotient.eq_zero_iff_mem] exact Ideal.mem_map_of_mem _ hi
1,861
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace MvPolynomial variable {R : Type*} {Οƒ : Type*} [CommRing R] {r : R} theorem quotient_map_C_eq_zero {I : Ideal R} {i : R} (hi : i ∈ I) : (Ideal.Quotient.mk (Ideal.map (C : R β†’+* MvPolynomial Οƒ R) I : Ideal (MvPolynomial Οƒ R))).comp C i = 0 := by simp only [Function.comp_apply, RingHom.coe_comp, Ideal.Quotient.eq_zero_iff_mem] exact Ideal.mem_map_of_mem _ hi #align mv_polynomial.quotient_map_C_eq_zero MvPolynomial.quotient_map_C_eq_zero
Mathlib/RingTheory/Polynomial/Quotient.lean
212
223
theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} {a : MvPolynomial Οƒ R} (ha : a ∈ (Ideal.map (C : R β†’+* MvPolynomial Οƒ R) I : Ideal (MvPolynomial Οƒ R))) : evalβ‚‚Hom (C.comp (Ideal.Quotient.mk I)) X a = 0 := by
rw [as_sum a] rw [coe_evalβ‚‚Hom, evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ simp only [evalβ‚‚_monomial, Function.comp_apply, RingHom.coe_comp] refine mul_eq_zero_of_left ?_ _ suffices coeff n a ∈ I by rw [← @Ideal.mk_ker R _ I, RingHom.mem_ker] at this simp only [this, C_0] exact mem_map_C_iff.1 ha n
1,861
import Mathlib.RingTheory.Ideal.IsPrimary import Mathlib.RingTheory.Ideal.Quotient import Mathlib.RingTheory.Polynomial.Quotient #align_import ring_theory.jacobson_ideal from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" universe u v namespace Ideal variable {R : Type u} {S : Type v} open Polynomial section Jacobson section Ring variable [Ring R] [Ring S] {I : Ideal R} def jacobson (I : Ideal R) : Ideal R := sInf { J : Ideal R | I ≀ J ∧ IsMaximal J } #align ideal.jacobson Ideal.jacobson theorem le_jacobson : I ≀ jacobson I := fun _ hx => mem_sInf.mpr fun _ hJ => hJ.left hx #align ideal.le_jacobson Ideal.le_jacobson @[simp] theorem jacobson_idem : jacobson (jacobson I) = jacobson I := le_antisymm (sInf_le_sInf fun _ hJ => ⟨sInf_le hJ, hJ.2⟩) le_jacobson #align ideal.jacobson_idem Ideal.jacobson_idem @[simp] theorem jacobson_top : jacobson (⊀ : Ideal R) = ⊀ := eq_top_iff.2 le_jacobson #align ideal.jacobson_top Ideal.jacobson_top @[simp] theorem jacobson_eq_top_iff : jacobson I = ⊀ ↔ I = ⊀ := ⟨fun H => by_contradiction fun hi => let ⟨M, hm, him⟩ := exists_le_maximal I hi lt_top_iff_ne_top.1 (lt_of_le_of_lt (show jacobson I ≀ M from sInf_le ⟨him, hm⟩) <| lt_top_iff_ne_top.2 hm.ne_top) H, fun H => eq_top_iff.2 <| le_sInf fun _ ⟨hij, _⟩ => H β–Έ hij⟩ #align ideal.jacobson_eq_top_iff Ideal.jacobson_eq_top_iff theorem jacobson_eq_bot : jacobson I = βŠ₯ β†’ I = βŠ₯ := fun h => eq_bot_iff.mpr (h β–Έ le_jacobson) #align ideal.jacobson_eq_bot Ideal.jacobson_eq_bot theorem jacobson_eq_self_of_isMaximal [H : IsMaximal I] : I.jacobson = I := le_antisymm (sInf_le ⟨le_of_eq rfl, H⟩) le_jacobson #align ideal.jacobson_eq_self_of_is_maximal Ideal.jacobson_eq_self_of_isMaximal instance (priority := 100) jacobson.isMaximal [H : IsMaximal I] : IsMaximal (jacobson I) := ⟨⟨fun htop => H.1.1 (jacobson_eq_top_iff.1 htop), fun _ hJ => H.1.2 _ (lt_of_le_of_lt le_jacobson hJ)⟩⟩ #align ideal.jacobson.is_maximal Ideal.jacobson.isMaximal theorem mem_jacobson_iff {x : R} : x ∈ jacobson I ↔ βˆ€ y, βˆƒ z, z * y * x + z - 1 ∈ I := ⟨fun hx y => by_cases (fun hxy : I βŠ” span {y * x + 1} = ⊀ => let ⟨p, hpi, q, hq, hpq⟩ := Submodule.mem_sup.1 ((eq_top_iff_one _).1 hxy) let ⟨r, hr⟩ := mem_span_singleton'.1 hq ⟨r, by -- Porting note: supply `mul_add_one` with explicit variables rw [mul_assoc, ← mul_add_one r (y * x), hr, ← hpq, ← neg_sub, add_sub_cancel_right] exact I.neg_mem hpi⟩) fun hxy : I βŠ” span {y * x + 1} β‰  ⊀ => let ⟨M, hm1, hm2⟩ := exists_le_maximal _ hxy suffices x βˆ‰ M from (this <| mem_sInf.1 hx ⟨le_trans le_sup_left hm2, hm1⟩).elim fun hxm => hm1.1.1 <| (eq_top_iff_one _).2 <| add_sub_cancel_left (y * x) 1 β–Έ M.sub_mem (le_sup_right.trans hm2 <| subset_span rfl) (M.mul_mem_left _ hxm), fun hx => mem_sInf.2 fun M ⟨him, hm⟩ => by_contradiction fun hxm => let ⟨y, i, hi, df⟩ := hm.exists_inv hxm let ⟨z, hz⟩ := hx (-y) hm.1.1 <| (eq_top_iff_one _).2 <| sub_sub_cancel (z * -y * x + z) 1 β–Έ M.sub_mem (by -- Porting note: supply `mul_add_one` with explicit variables rw [mul_assoc, ← mul_add_one z, neg_mul, ← sub_eq_iff_eq_add.mpr df.symm, neg_sub, sub_add_cancel] exact M.mul_mem_left _ hi) <| him hz⟩ #align ideal.mem_jacobson_iff Ideal.mem_jacobson_iff
Mathlib/RingTheory/JacobsonIdeal.lean
125
129
theorem exists_mul_sub_mem_of_sub_one_mem_jacobson {I : Ideal R} (r : R) (h : r - 1 ∈ jacobson I) : βˆƒ s, s * r - 1 ∈ I := by
cases' mem_jacobson_iff.1 h 1 with s hs use s simpa [mul_sub] using hs
1,862
import Mathlib.RingTheory.Ideal.IsPrimary import Mathlib.RingTheory.Ideal.Quotient import Mathlib.RingTheory.Polynomial.Quotient #align_import ring_theory.jacobson_ideal from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" universe u v namespace Ideal variable {R : Type u} {S : Type v} open Polynomial section Jacobson section Ring variable [Ring R] [Ring S] {I : Ideal R} def jacobson (I : Ideal R) : Ideal R := sInf { J : Ideal R | I ≀ J ∧ IsMaximal J } #align ideal.jacobson Ideal.jacobson theorem le_jacobson : I ≀ jacobson I := fun _ hx => mem_sInf.mpr fun _ hJ => hJ.left hx #align ideal.le_jacobson Ideal.le_jacobson @[simp] theorem jacobson_idem : jacobson (jacobson I) = jacobson I := le_antisymm (sInf_le_sInf fun _ hJ => ⟨sInf_le hJ, hJ.2⟩) le_jacobson #align ideal.jacobson_idem Ideal.jacobson_idem @[simp] theorem jacobson_top : jacobson (⊀ : Ideal R) = ⊀ := eq_top_iff.2 le_jacobson #align ideal.jacobson_top Ideal.jacobson_top @[simp] theorem jacobson_eq_top_iff : jacobson I = ⊀ ↔ I = ⊀ := ⟨fun H => by_contradiction fun hi => let ⟨M, hm, him⟩ := exists_le_maximal I hi lt_top_iff_ne_top.1 (lt_of_le_of_lt (show jacobson I ≀ M from sInf_le ⟨him, hm⟩) <| lt_top_iff_ne_top.2 hm.ne_top) H, fun H => eq_top_iff.2 <| le_sInf fun _ ⟨hij, _⟩ => H β–Έ hij⟩ #align ideal.jacobson_eq_top_iff Ideal.jacobson_eq_top_iff theorem jacobson_eq_bot : jacobson I = βŠ₯ β†’ I = βŠ₯ := fun h => eq_bot_iff.mpr (h β–Έ le_jacobson) #align ideal.jacobson_eq_bot Ideal.jacobson_eq_bot theorem jacobson_eq_self_of_isMaximal [H : IsMaximal I] : I.jacobson = I := le_antisymm (sInf_le ⟨le_of_eq rfl, H⟩) le_jacobson #align ideal.jacobson_eq_self_of_is_maximal Ideal.jacobson_eq_self_of_isMaximal instance (priority := 100) jacobson.isMaximal [H : IsMaximal I] : IsMaximal (jacobson I) := ⟨⟨fun htop => H.1.1 (jacobson_eq_top_iff.1 htop), fun _ hJ => H.1.2 _ (lt_of_le_of_lt le_jacobson hJ)⟩⟩ #align ideal.jacobson.is_maximal Ideal.jacobson.isMaximal theorem mem_jacobson_iff {x : R} : x ∈ jacobson I ↔ βˆ€ y, βˆƒ z, z * y * x + z - 1 ∈ I := ⟨fun hx y => by_cases (fun hxy : I βŠ” span {y * x + 1} = ⊀ => let ⟨p, hpi, q, hq, hpq⟩ := Submodule.mem_sup.1 ((eq_top_iff_one _).1 hxy) let ⟨r, hr⟩ := mem_span_singleton'.1 hq ⟨r, by -- Porting note: supply `mul_add_one` with explicit variables rw [mul_assoc, ← mul_add_one r (y * x), hr, ← hpq, ← neg_sub, add_sub_cancel_right] exact I.neg_mem hpi⟩) fun hxy : I βŠ” span {y * x + 1} β‰  ⊀ => let ⟨M, hm1, hm2⟩ := exists_le_maximal _ hxy suffices x βˆ‰ M from (this <| mem_sInf.1 hx ⟨le_trans le_sup_left hm2, hm1⟩).elim fun hxm => hm1.1.1 <| (eq_top_iff_one _).2 <| add_sub_cancel_left (y * x) 1 β–Έ M.sub_mem (le_sup_right.trans hm2 <| subset_span rfl) (M.mul_mem_left _ hxm), fun hx => mem_sInf.2 fun M ⟨him, hm⟩ => by_contradiction fun hxm => let ⟨y, i, hi, df⟩ := hm.exists_inv hxm let ⟨z, hz⟩ := hx (-y) hm.1.1 <| (eq_top_iff_one _).2 <| sub_sub_cancel (z * -y * x + z) 1 β–Έ M.sub_mem (by -- Porting note: supply `mul_add_one` with explicit variables rw [mul_assoc, ← mul_add_one z, neg_mul, ← sub_eq_iff_eq_add.mpr df.symm, neg_sub, sub_add_cancel] exact M.mul_mem_left _ hi) <| him hz⟩ #align ideal.mem_jacobson_iff Ideal.mem_jacobson_iff theorem exists_mul_sub_mem_of_sub_one_mem_jacobson {I : Ideal R} (r : R) (h : r - 1 ∈ jacobson I) : βˆƒ s, s * r - 1 ∈ I := by cases' mem_jacobson_iff.1 h 1 with s hs use s simpa [mul_sub] using hs #align ideal.exists_mul_sub_mem_of_sub_one_mem_jacobson Ideal.exists_mul_sub_mem_of_sub_one_mem_jacobson
Mathlib/RingTheory/JacobsonIdeal.lean
134
143
theorem eq_jacobson_iff_sInf_maximal : I.jacobson = I ↔ βˆƒ M : Set (Ideal R), (βˆ€ J ∈ M, IsMaximal J ∨ J = ⊀) ∧ I = sInf M := by
use fun hI => ⟨{ J : Ideal R | I ≀ J ∧ J.IsMaximal }, ⟨fun _ hJ => Or.inl hJ.right, hI.symm⟩⟩ rintro ⟨M, hM, hInf⟩ refine le_antisymm (fun x hx => ?_) le_jacobson rw [hInf, mem_sInf] intro I hI cases' hM I hI with is_max is_top Β· exact (mem_sInf.1 hx) ⟨le_sInf_iff.1 (le_of_eq hInf) I hI, is_max⟩ Β· exact is_top.symm β–Έ Submodule.mem_top
1,862
import Mathlib.Algebra.Algebra.Defs import Mathlib.RingTheory.Ideal.Operations import Mathlib.RingTheory.JacobsonIdeal import Mathlib.Logic.Equiv.TransferInstance import Mathlib.Tactic.TFAE #align_import ring_theory.ideal.local_ring from "leanprover-community/mathlib"@"ec1c7d810034d4202b0dd239112d1792be9f6fdc" universe u v w u' variable {R : Type u} {S : Type v} {T : Type w} {K : Type u'} class LocalRing (R : Type u) [Semiring R] extends Nontrivial R : Prop where of_is_unit_or_is_unit_of_add_one :: isUnit_or_isUnit_of_add_one {a b : R} (h : a + b = 1) : IsUnit a ∨ IsUnit b #align local_ring LocalRing section CommSemiring variable [CommSemiring R] namespace LocalRing theorem of_isUnit_or_isUnit_of_isUnit_add [Nontrivial R] (h : βˆ€ a b : R, IsUnit (a + b) β†’ IsUnit a ∨ IsUnit b) : LocalRing R := ⟨fun {a b} hab => h a b <| hab.symm β–Έ isUnit_one⟩ #align local_ring.of_is_unit_or_is_unit_of_is_unit_add LocalRing.of_isUnit_or_isUnit_of_isUnit_add theorem of_nonunits_add [Nontrivial R] (h : βˆ€ a b : R, a ∈ nonunits R β†’ b ∈ nonunits R β†’ a + b ∈ nonunits R) : LocalRing R := ⟨fun {a b} hab => or_iff_not_and_not.2 fun H => h a b H.1 H.2 <| hab.symm β–Έ isUnit_one⟩ #align local_ring.of_nonunits_add LocalRing.of_nonunits_add theorem of_unique_max_ideal (h : βˆƒ! I : Ideal R, I.IsMaximal) : LocalRing R := @of_nonunits_add _ _ (nontrivial_of_ne (0 : R) 1 <| let ⟨I, Imax, _⟩ := h fun H : 0 = 1 => Imax.1.1 <| I.eq_top_iff_one.2 <| H β–Έ I.zero_mem) fun x y hx hy H => let ⟨I, Imax, Iuniq⟩ := h let ⟨Ix, Ixmax, Hx⟩ := exists_max_ideal_of_mem_nonunits hx let ⟨Iy, Iymax, Hy⟩ := exists_max_ideal_of_mem_nonunits hy have xmemI : x ∈ I := Iuniq Ix Ixmax β–Έ Hx have ymemI : y ∈ I := Iuniq Iy Iymax β–Έ Hy Imax.1.1 <| I.eq_top_of_isUnit_mem (I.add_mem xmemI ymemI) H #align local_ring.of_unique_max_ideal LocalRing.of_unique_max_ideal theorem of_unique_nonzero_prime (h : βˆƒ! P : Ideal R, P β‰  βŠ₯ ∧ Ideal.IsPrime P) : LocalRing R := of_unique_max_ideal (by rcases h with ⟨P, ⟨hPnonzero, hPnot_top, _⟩, hPunique⟩ refine ⟨P, ⟨⟨hPnot_top, ?_⟩⟩, fun M hM => hPunique _ ⟨?_, Ideal.IsMaximal.isPrime hM⟩⟩ Β· refine Ideal.maximal_of_no_maximal fun M hPM hM => ne_of_lt hPM ?_ exact (hPunique _ ⟨ne_bot_of_gt hPM, Ideal.IsMaximal.isPrime hM⟩).symm Β· rintro rfl exact hPnot_top (hM.1.2 P (bot_lt_iff_ne_bot.2 hPnonzero))) #align local_ring.of_unique_nonzero_prime LocalRing.of_unique_nonzero_prime variable [LocalRing R]
Mathlib/RingTheory/Ideal/LocalRing.lean
93
96
theorem isUnit_or_isUnit_of_isUnit_add {a b : R} (h : IsUnit (a + b)) : IsUnit a ∨ IsUnit b := by
rcases h with ⟨u, hu⟩ rw [← Units.inv_mul_eq_one, mul_add] at hu apply Or.imp _ _ (isUnit_or_isUnit_of_add_one hu) <;> exact isUnit_of_mul_isUnit_right
1,863
import Mathlib.Algebra.Algebra.Defs import Mathlib.RingTheory.Ideal.Operations import Mathlib.RingTheory.JacobsonIdeal import Mathlib.Logic.Equiv.TransferInstance import Mathlib.Tactic.TFAE #align_import ring_theory.ideal.local_ring from "leanprover-community/mathlib"@"ec1c7d810034d4202b0dd239112d1792be9f6fdc" universe u v w u' variable {R : Type u} {S : Type v} {T : Type w} {K : Type u'} class LocalRing (R : Type u) [Semiring R] extends Nontrivial R : Prop where of_is_unit_or_is_unit_of_add_one :: isUnit_or_isUnit_of_add_one {a b : R} (h : a + b = 1) : IsUnit a ∨ IsUnit b #align local_ring LocalRing section CommSemiring variable [CommSemiring R] namespace LocalRing theorem of_isUnit_or_isUnit_of_isUnit_add [Nontrivial R] (h : βˆ€ a b : R, IsUnit (a + b) β†’ IsUnit a ∨ IsUnit b) : LocalRing R := ⟨fun {a b} hab => h a b <| hab.symm β–Έ isUnit_one⟩ #align local_ring.of_is_unit_or_is_unit_of_is_unit_add LocalRing.of_isUnit_or_isUnit_of_isUnit_add theorem of_nonunits_add [Nontrivial R] (h : βˆ€ a b : R, a ∈ nonunits R β†’ b ∈ nonunits R β†’ a + b ∈ nonunits R) : LocalRing R := ⟨fun {a b} hab => or_iff_not_and_not.2 fun H => h a b H.1 H.2 <| hab.symm β–Έ isUnit_one⟩ #align local_ring.of_nonunits_add LocalRing.of_nonunits_add theorem of_unique_max_ideal (h : βˆƒ! I : Ideal R, I.IsMaximal) : LocalRing R := @of_nonunits_add _ _ (nontrivial_of_ne (0 : R) 1 <| let ⟨I, Imax, _⟩ := h fun H : 0 = 1 => Imax.1.1 <| I.eq_top_iff_one.2 <| H β–Έ I.zero_mem) fun x y hx hy H => let ⟨I, Imax, Iuniq⟩ := h let ⟨Ix, Ixmax, Hx⟩ := exists_max_ideal_of_mem_nonunits hx let ⟨Iy, Iymax, Hy⟩ := exists_max_ideal_of_mem_nonunits hy have xmemI : x ∈ I := Iuniq Ix Ixmax β–Έ Hx have ymemI : y ∈ I := Iuniq Iy Iymax β–Έ Hy Imax.1.1 <| I.eq_top_of_isUnit_mem (I.add_mem xmemI ymemI) H #align local_ring.of_unique_max_ideal LocalRing.of_unique_max_ideal theorem of_unique_nonzero_prime (h : βˆƒ! P : Ideal R, P β‰  βŠ₯ ∧ Ideal.IsPrime P) : LocalRing R := of_unique_max_ideal (by rcases h with ⟨P, ⟨hPnonzero, hPnot_top, _⟩, hPunique⟩ refine ⟨P, ⟨⟨hPnot_top, ?_⟩⟩, fun M hM => hPunique _ ⟨?_, Ideal.IsMaximal.isPrime hM⟩⟩ Β· refine Ideal.maximal_of_no_maximal fun M hPM hM => ne_of_lt hPM ?_ exact (hPunique _ ⟨ne_bot_of_gt hPM, Ideal.IsMaximal.isPrime hM⟩).symm Β· rintro rfl exact hPnot_top (hM.1.2 P (bot_lt_iff_ne_bot.2 hPnonzero))) #align local_ring.of_unique_nonzero_prime LocalRing.of_unique_nonzero_prime variable [LocalRing R] theorem isUnit_or_isUnit_of_isUnit_add {a b : R} (h : IsUnit (a + b)) : IsUnit a ∨ IsUnit b := by rcases h with ⟨u, hu⟩ rw [← Units.inv_mul_eq_one, mul_add] at hu apply Or.imp _ _ (isUnit_or_isUnit_of_add_one hu) <;> exact isUnit_of_mul_isUnit_right #align local_ring.is_unit_or_is_unit_of_is_unit_add LocalRing.isUnit_or_isUnit_of_isUnit_add theorem nonunits_add {a b : R} (ha : a ∈ nonunits R) (hb : b ∈ nonunits R) : a + b ∈ nonunits R := fun H => not_or_of_not ha hb (isUnit_or_isUnit_of_isUnit_add H) #align local_ring.nonunits_add LocalRing.nonunits_add variable (R) def maximalIdeal : Ideal R where carrier := nonunits R zero_mem' := zero_mem_nonunits.2 <| zero_ne_one add_mem' {_ _} hx hy := nonunits_add hx hy smul_mem' _ _ := mul_mem_nonunits_right #align local_ring.maximal_ideal LocalRing.maximalIdeal instance maximalIdeal.isMaximal : (maximalIdeal R).IsMaximal := by rw [Ideal.isMaximal_iff] constructor Β· intro h apply h exact isUnit_one Β· intro I x _ hx H erw [Classical.not_not] at hx rcases hx with ⟨u, rfl⟩ simpa using I.mul_mem_left (↑u⁻¹) H #align local_ring.maximal_ideal.is_maximal LocalRing.maximalIdeal.isMaximal theorem maximal_ideal_unique : βˆƒ! I : Ideal R, I.IsMaximal := ⟨maximalIdeal R, maximalIdeal.isMaximal R, fun I hI => hI.eq_of_le (maximalIdeal.isMaximal R).1.1 fun _ hx => hI.1.1 ∘ I.eq_top_of_isUnit_mem hx⟩ #align local_ring.maximal_ideal_unique LocalRing.maximal_ideal_unique variable {R} theorem eq_maximalIdeal {I : Ideal R} (hI : I.IsMaximal) : I = maximalIdeal R := ExistsUnique.unique (maximal_ideal_unique R) hI <| maximalIdeal.isMaximal R #align local_ring.eq_maximal_ideal LocalRing.eq_maximalIdeal
Mathlib/RingTheory/Ideal/LocalRing.lean
136
138
theorem le_maximalIdeal {J : Ideal R} (hJ : J β‰  ⊀) : J ≀ maximalIdeal R := by
rcases Ideal.exists_le_maximal J hJ with ⟨M, hM1, hM2⟩ rwa [← eq_maximalIdeal hM1]
1,863
import Mathlib.Analysis.LocallyConvex.BalancedCoreHull import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix import Mathlib.Topology.Algebra.Module.Simple import Mathlib.Topology.Algebra.Module.Determinant import Mathlib.RingTheory.Ideal.LocalRing #align_import topology.algebra.module.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter section NormedField variable {π•œ : Type u} [hnorm : NontriviallyNormedField π•œ] {E : Type v} [AddCommGroup E] [Module π•œ E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousSMul π•œ E] {F : Type w} [AddCommGroup F] [Module π•œ F] [TopologicalSpace F] [TopologicalAddGroup F] [ContinuousSMul π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F']
Mathlib/Topology/Algebra/Module/FiniteDimension.lean
77
127
theorem unique_topology_of_t2 {t : TopologicalSpace π•œ} (h₁ : @TopologicalAddGroup π•œ t _) (hβ‚‚ : @ContinuousSMul π•œ π•œ _ hnorm.toUniformSpace.toTopologicalSpace t) (h₃ : @T2Space π•œ t) : t = hnorm.toUniformSpace.toTopologicalSpace := by
-- Let `𝓣₀` denote the topology on `π•œ` induced by the norm, and `𝓣` be any T2 vector -- topology on `π•œ`. To show that `𝓣₀ = 𝓣`, it suffices to show that they have the same -- neighborhoods of 0. refine TopologicalAddGroup.ext h₁ inferInstance (le_antisymm ?_ ?_) Β· -- To show `𝓣 ≀ 𝓣₀`, we have to show that closed balls are `𝓣`-neighborhoods of 0. rw [Metric.nhds_basis_closedBall.ge_iff] -- Let `Ξ΅ > 0`. Since `π•œ` is nontrivially normed, we have `0 < β€–ΞΎβ‚€β€– < Ξ΅` for some `ΞΎβ‚€ : π•œ`. intro Ξ΅ hΞ΅ rcases NormedField.exists_norm_lt π•œ hΞ΅ with βŸ¨ΞΎβ‚€, hΞΎβ‚€, hΞΎβ‚€Ξ΅βŸ© -- Since `ΞΎβ‚€ β‰  0` and `𝓣` is T2, we know that `{ΞΎβ‚€}ᢜ` is a `𝓣`-neighborhood of 0. -- Porting note: added `mem_compl_singleton_iff.mpr` have : {ΞΎβ‚€}ᢜ ∈ @nhds π•œ t 0 := IsOpen.mem_nhds isOpen_compl_singleton <| mem_compl_singleton_iff.mpr <| Ne.symm <| norm_ne_zero_iff.mp hΞΎβ‚€.ne.symm -- Thus, its balanced core `𝓑` is too. Let's show that the closed ball of radius `Ξ΅` contains -- `𝓑`, which will imply that the closed ball is indeed a `𝓣`-neighborhood of 0. have : balancedCore π•œ {ΞΎβ‚€}ᢜ ∈ @nhds π•œ t 0 := balancedCore_mem_nhds_zero this refine mem_of_superset this fun ΞΎ hΞΎ => ?_ -- Let `ΞΎ ∈ 𝓑`. We want to show `β€–ΞΎβ€– < Ξ΅`. If `ΞΎ = 0`, this is trivial. by_cases hΞΎ0 : ΞΎ = 0 Β· rw [hΞΎ0] exact Metric.mem_closedBall_self hΞ΅.le Β· rw [mem_closedBall_zero_iff] -- Now suppose `ΞΎ β‰  0`. By contradiction, let's assume `Ξ΅ < β€–ΞΎβ€–`, and show that -- `ΞΎβ‚€ ∈ 𝓑 βŠ† {ΞΎβ‚€}ᢜ`, which is a contradiction. by_contra! h suffices (ΞΎβ‚€ * ξ⁻¹) β€’ ΞΎ ∈ balancedCore π•œ {ΞΎβ‚€}ᢜ by rw [smul_eq_mul π•œ, mul_assoc, inv_mul_cancel hΞΎ0, mul_one] at this exact not_mem_compl_iff.mpr (mem_singleton ΞΎβ‚€) ((balancedCore_subset _) this) -- For that, we use that `𝓑` is balanced : since `β€–ΞΎβ‚€β€– < Ξ΅ < β€–ΞΎβ€–`, we have `β€–ΞΎβ‚€ / ΞΎβ€– ≀ 1`, -- hence `ΞΎβ‚€ = (ΞΎβ‚€ / ΞΎ) β€’ ΞΎ ∈ 𝓑` because `ΞΎ ∈ 𝓑`. refine (balancedCore_balanced _).smul_mem ?_ hΞΎ rw [norm_mul, norm_inv, mul_inv_le_iff (norm_pos_iff.mpr hΞΎ0), mul_one] exact (hΞΎβ‚€Ξ΅.trans h).le Β· -- Finally, to show `𝓣₀ ≀ 𝓣`, we simply argue that `id = (fun x ↦ x β€’ 1)` is continuous from -- `(π•œ, 𝓣₀)` to `(π•œ, 𝓣)` because `(β€’) : (π•œ, 𝓣₀) Γ— (π•œ, 𝓣) β†’ (π•œ, 𝓣)` is continuous. calc @nhds π•œ hnorm.toUniformSpace.toTopologicalSpace 0 = map id (@nhds π•œ hnorm.toUniformSpace.toTopologicalSpace 0) := map_id.symm _ = map (fun x => id x β€’ (1 : π•œ)) (@nhds π•œ hnorm.toUniformSpace.toTopologicalSpace 0) := by conv_rhs => congr ext rw [smul_eq_mul, mul_one] _ ≀ @nhds π•œ t ((0 : π•œ) β€’ (1 : π•œ)) := (@Tendsto.smul_const _ _ _ hnorm.toUniformSpace.toTopologicalSpace t _ _ _ _ _ tendsto_id (1 : π•œ)) _ = @nhds π•œ t 0 := by rw [zero_smul]
1,864
import Mathlib.Analysis.LocallyConvex.BalancedCoreHull import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix import Mathlib.Topology.Algebra.Module.Simple import Mathlib.Topology.Algebra.Module.Determinant import Mathlib.RingTheory.Ideal.LocalRing #align_import topology.algebra.module.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter section NormedField variable {π•œ : Type u} [hnorm : NontriviallyNormedField π•œ] {E : Type v} [AddCommGroup E] [Module π•œ E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousSMul π•œ E] {F : Type w} [AddCommGroup F] [Module π•œ F] [TopologicalSpace F] [TopologicalAddGroup F] [ContinuousSMul π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] theorem unique_topology_of_t2 {t : TopologicalSpace π•œ} (h₁ : @TopologicalAddGroup π•œ t _) (hβ‚‚ : @ContinuousSMul π•œ π•œ _ hnorm.toUniformSpace.toTopologicalSpace t) (h₃ : @T2Space π•œ t) : t = hnorm.toUniformSpace.toTopologicalSpace := by -- Let `𝓣₀` denote the topology on `π•œ` induced by the norm, and `𝓣` be any T2 vector -- topology on `π•œ`. To show that `𝓣₀ = 𝓣`, it suffices to show that they have the same -- neighborhoods of 0. refine TopologicalAddGroup.ext h₁ inferInstance (le_antisymm ?_ ?_) Β· -- To show `𝓣 ≀ 𝓣₀`, we have to show that closed balls are `𝓣`-neighborhoods of 0. rw [Metric.nhds_basis_closedBall.ge_iff] -- Let `Ξ΅ > 0`. Since `π•œ` is nontrivially normed, we have `0 < β€–ΞΎβ‚€β€– < Ξ΅` for some `ΞΎβ‚€ : π•œ`. intro Ξ΅ hΞ΅ rcases NormedField.exists_norm_lt π•œ hΞ΅ with βŸ¨ΞΎβ‚€, hΞΎβ‚€, hΞΎβ‚€Ξ΅βŸ© -- Since `ΞΎβ‚€ β‰  0` and `𝓣` is T2, we know that `{ΞΎβ‚€}ᢜ` is a `𝓣`-neighborhood of 0. -- Porting note: added `mem_compl_singleton_iff.mpr` have : {ΞΎβ‚€}ᢜ ∈ @nhds π•œ t 0 := IsOpen.mem_nhds isOpen_compl_singleton <| mem_compl_singleton_iff.mpr <| Ne.symm <| norm_ne_zero_iff.mp hΞΎβ‚€.ne.symm -- Thus, its balanced core `𝓑` is too. Let's show that the closed ball of radius `Ξ΅` contains -- `𝓑`, which will imply that the closed ball is indeed a `𝓣`-neighborhood of 0. have : balancedCore π•œ {ΞΎβ‚€}ᢜ ∈ @nhds π•œ t 0 := balancedCore_mem_nhds_zero this refine mem_of_superset this fun ΞΎ hΞΎ => ?_ -- Let `ΞΎ ∈ 𝓑`. We want to show `β€–ΞΎβ€– < Ξ΅`. If `ΞΎ = 0`, this is trivial. by_cases hΞΎ0 : ΞΎ = 0 Β· rw [hΞΎ0] exact Metric.mem_closedBall_self hΞ΅.le Β· rw [mem_closedBall_zero_iff] -- Now suppose `ΞΎ β‰  0`. By contradiction, let's assume `Ξ΅ < β€–ΞΎβ€–`, and show that -- `ΞΎβ‚€ ∈ 𝓑 βŠ† {ΞΎβ‚€}ᢜ`, which is a contradiction. by_contra! h suffices (ΞΎβ‚€ * ξ⁻¹) β€’ ΞΎ ∈ balancedCore π•œ {ΞΎβ‚€}ᢜ by rw [smul_eq_mul π•œ, mul_assoc, inv_mul_cancel hΞΎ0, mul_one] at this exact not_mem_compl_iff.mpr (mem_singleton ΞΎβ‚€) ((balancedCore_subset _) this) -- For that, we use that `𝓑` is balanced : since `β€–ΞΎβ‚€β€– < Ξ΅ < β€–ΞΎβ€–`, we have `β€–ΞΎβ‚€ / ΞΎβ€– ≀ 1`, -- hence `ΞΎβ‚€ = (ΞΎβ‚€ / ΞΎ) β€’ ΞΎ ∈ 𝓑` because `ΞΎ ∈ 𝓑`. refine (balancedCore_balanced _).smul_mem ?_ hΞΎ rw [norm_mul, norm_inv, mul_inv_le_iff (norm_pos_iff.mpr hΞΎ0), mul_one] exact (hΞΎβ‚€Ξ΅.trans h).le Β· -- Finally, to show `𝓣₀ ≀ 𝓣`, we simply argue that `id = (fun x ↦ x β€’ 1)` is continuous from -- `(π•œ, 𝓣₀)` to `(π•œ, 𝓣)` because `(β€’) : (π•œ, 𝓣₀) Γ— (π•œ, 𝓣) β†’ (π•œ, 𝓣)` is continuous. calc @nhds π•œ hnorm.toUniformSpace.toTopologicalSpace 0 = map id (@nhds π•œ hnorm.toUniformSpace.toTopologicalSpace 0) := map_id.symm _ = map (fun x => id x β€’ (1 : π•œ)) (@nhds π•œ hnorm.toUniformSpace.toTopologicalSpace 0) := by conv_rhs => congr ext rw [smul_eq_mul, mul_one] _ ≀ @nhds π•œ t ((0 : π•œ) β€’ (1 : π•œ)) := (@Tendsto.smul_const _ _ _ hnorm.toUniformSpace.toTopologicalSpace t _ _ _ _ _ tendsto_id (1 : π•œ)) _ = @nhds π•œ t 0 := by rw [zero_smul] #align unique_topology_of_t2 unique_topology_of_t2
Mathlib/Topology/Algebra/Module/FiniteDimension.lean
132
173
theorem LinearMap.continuous_of_isClosed_ker (l : E β†’β‚—[π•œ] π•œ) (hl : IsClosed (LinearMap.ker l : Set E)) : Continuous l := by
-- `l` is either constant or surjective. If it is constant, the result is trivial. by_cases H : finrank π•œ (LinearMap.range l) = 0 Β· rw [Submodule.finrank_eq_zero, LinearMap.range_eq_bot] at H rw [H] exact continuous_zero Β· -- In the case where `l` is surjective, we factor it as `Ο† : (E β§Έ l.ker) ≃ₗ[π•œ] π•œ`. Note that -- `E β§Έ l.ker` is T2 since `l.ker` is closed. have : finrank π•œ (LinearMap.range l) = 1 := le_antisymm (finrank_self π•œ β–Έ l.range.finrank_le) (zero_lt_iff.mpr H) have hi : Function.Injective ((LinearMap.ker l).liftQ l (le_refl _)) := by rw [← LinearMap.ker_eq_bot] exact Submodule.ker_liftQ_eq_bot _ _ _ (le_refl _) have hs : Function.Surjective ((LinearMap.ker l).liftQ l (le_refl _)) := by rw [← LinearMap.range_eq_top, Submodule.range_liftQ] exact Submodule.eq_top_of_finrank_eq ((finrank_self π•œ).symm β–Έ this) let Ο† : (E β§Έ LinearMap.ker l) ≃ₗ[π•œ] π•œ := LinearEquiv.ofBijective ((LinearMap.ker l).liftQ l (le_refl _)) ⟨hi, hs⟩ have hlΟ† : (l : E β†’ π•œ) = Ο† ∘ (LinearMap.ker l).mkQ := by ext; rfl -- Since the quotient map `E β†’β‚—[π•œ] (E β§Έ l.ker)` is continuous, the continuity of `l` will follow -- form the continuity of `Ο†`. suffices Continuous Ο†.toEquiv by rw [hlΟ†] exact this.comp continuous_quot_mk -- The pullback by `Ο†.symm` of the quotient topology is a T2 topology on `π•œ`, because `Ο†.symm` -- is injective. Since `Ο†.symm` is linear, it is also a vector space topology. -- Hence, we know that it is equal to the topology induced by the norm. have : induced Ο†.toEquiv.symm inferInstance = hnorm.toUniformSpace.toTopologicalSpace := by refine unique_topology_of_t2 (topologicalAddGroup_induced Ο†.symm.toLinearMap) (continuousSMul_induced Ο†.symm.toLinearMap) ?_ -- Porting note: was `rw [t2Space_iff]` refine (@t2Space_iff π•œ (induced (↑(LinearEquiv.toEquiv Ο†).symm) inferInstance)).mpr ?_ exact fun x y hxy => @separated_by_continuous _ _ (induced _ _) _ _ _ continuous_induced_dom _ _ (Ο†.toEquiv.symm.injective.ne hxy) -- Finally, the pullback by `Ο†.symm` is exactly the pushforward by `Ο†`, so we have to prove -- that `Ο†` is continuous when `π•œ` is endowed with the pushforward by `Ο†` of the quotient -- topology, which is trivial by definition of the pushforward. rw [this.symm, Equiv.induced_symm] exact continuous_coinduced_rng
1,864
import Mathlib.Analysis.NormedSpace.Banach import Mathlib.Topology.Algebra.Module.FiniteDimension #align_import analysis.normed_space.complemented from "leanprover-community/mathlib"@"3397560e65278e5f31acefcdea63138bd53d1cd4" variable {π•œ E F G : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] noncomputable section open LinearMap (ker range) namespace ContinuousLinearMap section variable [CompleteSpace π•œ]
Mathlib/Analysis/NormedSpace/Complemented.lean
39
43
theorem ker_closedComplemented_of_finiteDimensional_range (f : E β†’L[π•œ] F) [FiniteDimensional π•œ (range f)] : (ker f).ClosedComplemented := by
set f' : E β†’L[π•œ] range f := f.codRestrict _ (LinearMap.mem_range_self (f : E β†’β‚—[π•œ] F)) rcases f'.exists_right_inverse_of_surjective (f : E β†’β‚—[π•œ] F).range_rangeRestrict with ⟨g, hg⟩ simpa only [f', ker_codRestrict] using f'.closedComplemented_ker_of_rightInverse g (ext_iff.1 hg)
1,865
import Mathlib.Analysis.NormedSpace.Banach import Mathlib.Topology.Algebra.Module.FiniteDimension #align_import analysis.normed_space.complemented from "leanprover-community/mathlib"@"3397560e65278e5f31acefcdea63138bd53d1cd4" variable {π•œ E F G : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] noncomputable section open LinearMap (ker range) namespace Submodule variable [CompleteSpace E] (p q : Subspace π•œ E) def prodEquivOfClosedCompl (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : (p Γ— q) ≃L[π•œ] E := by haveI := hp.completeSpace_coe; haveI := hq.completeSpace_coe refine (p.prodEquivOfIsCompl q h).toContinuousLinearEquivOfContinuous ?_ exact (p.subtypeL.coprod q.subtypeL).continuous #align subspace.prod_equiv_of_closed_compl Submodule.prodEquivOfClosedCompl def linearProjOfClosedCompl (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : E β†’L[π•œ] p := ContinuousLinearMap.fst π•œ p q ∘L ↑(prodEquivOfClosedCompl p q h hp hq).symm #align subspace.linear_proj_of_closed_compl Submodule.linearProjOfClosedCompl variable {p q} @[simp] theorem coe_prodEquivOfClosedCompl (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : ⇑(p.prodEquivOfClosedCompl q h hp hq) = p.prodEquivOfIsCompl q h := rfl #align subspace.coe_prod_equiv_of_closed_compl Submodule.coe_prodEquivOfClosedCompl @[simp] theorem coe_prodEquivOfClosedCompl_symm (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : ⇑(p.prodEquivOfClosedCompl q h hp hq).symm = (p.prodEquivOfIsCompl q h).symm := rfl #align subspace.coe_prod_equiv_of_closed_compl_symm Submodule.coe_prodEquivOfClosedCompl_symm @[simp] theorem coe_continuous_linearProjOfClosedCompl (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : (p.linearProjOfClosedCompl q h hp hq : E β†’β‚—[π•œ] p) = p.linearProjOfIsCompl q h := rfl #align subspace.coe_continuous_linear_proj_of_closed_compl Submodule.coe_continuous_linearProjOfClosedCompl @[simp] theorem coe_continuous_linearProjOfClosedCompl' (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : ⇑(p.linearProjOfClosedCompl q h hp hq) = p.linearProjOfIsCompl q h := rfl #align subspace.coe_continuous_linear_proj_of_closed_compl' Submodule.coe_continuous_linearProjOfClosedCompl' theorem ClosedComplemented.of_isCompl_isClosed (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : p.ClosedComplemented := ⟨p.linearProjOfClosedCompl q h hp hq, Submodule.linearProjOfIsCompl_apply_left h⟩ #align subspace.closed_complemented_of_closed_compl Submodule.ClosedComplemented.of_isCompl_isClosed alias IsCompl.closedComplemented_of_isClosed := ClosedComplemented.of_isCompl_isClosed theorem closedComplemented_iff_isClosed_exists_isClosed_isCompl : p.ClosedComplemented ↔ IsClosed (p : Set E) ∧ βˆƒ q : Submodule π•œ E, IsClosed (q : Set E) ∧ IsCompl p q := ⟨fun h => ⟨h.isClosed, h.exists_isClosed_isCompl⟩, fun ⟨hp, ⟨_, hq, hpq⟩⟩ => .of_isCompl_isClosed hpq hp hq⟩ #align subspace.closed_complemented_iff_has_closed_compl Submodule.closedComplemented_iff_isClosed_exists_isClosed_isCompl
Mathlib/Analysis/NormedSpace/Complemented.lean
139
143
theorem ClosedComplemented.of_quotient_finiteDimensional [CompleteSpace π•œ] [FiniteDimensional π•œ (E β§Έ p)] (hp : IsClosed (p : Set E)) : p.ClosedComplemented := by
obtain ⟨q, hq⟩ : βˆƒ q, IsCompl p q := p.exists_isCompl haveI : FiniteDimensional π•œ q := (p.quotientEquivOfIsCompl q hq).finiteDimensional exact .of_isCompl_isClosed hq hp q.closed_of_finiteDimensional
1,865
import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv import Mathlib.Analysis.Calculus.FDeriv.Add import Mathlib.Analysis.Calculus.FDeriv.Prod import Mathlib.Analysis.NormedSpace.Complemented #align_import analysis.calculus.implicit from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Topology open Filter open ContinuousLinearMap (fst snd smulRight ker_prod) open ContinuousLinearEquiv (ofBijective) open LinearMap (ker range) -- Porting note(#5171): linter not yet ported @[nolint has_nonempty_instance] structure ImplicitFunctionData (π•œ : Type*) [NontriviallyNormedField π•œ] (E : Type*) [NormedAddCommGroup E] [NormedSpace π•œ E] [CompleteSpace E] (F : Type*) [NormedAddCommGroup F] [NormedSpace π•œ F] [CompleteSpace F] (G : Type*) [NormedAddCommGroup G] [NormedSpace π•œ G] [CompleteSpace G] where leftFun : E β†’ F leftDeriv : E β†’L[π•œ] F rightFun : E β†’ G rightDeriv : E β†’L[π•œ] G pt : E left_has_deriv : HasStrictFDerivAt leftFun leftDeriv pt right_has_deriv : HasStrictFDerivAt rightFun rightDeriv pt left_range : range leftDeriv = ⊀ right_range : range rightDeriv = ⊀ isCompl_ker : IsCompl (ker leftDeriv) (ker rightDeriv) #align implicit_function_data ImplicitFunctionData namespace ImplicitFunctionData variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] [CompleteSpace E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] [CompleteSpace F] {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] [CompleteSpace G] (Ο† : ImplicitFunctionData π•œ E F G) def prodFun (x : E) : F Γ— G := (Ο†.leftFun x, Ο†.rightFun x) #align implicit_function_data.prod_fun ImplicitFunctionData.prodFun @[simp] theorem prodFun_apply (x : E) : Ο†.prodFun x = (Ο†.leftFun x, Ο†.rightFun x) := rfl #align implicit_function_data.prod_fun_apply ImplicitFunctionData.prodFun_apply protected theorem hasStrictFDerivAt : HasStrictFDerivAt Ο†.prodFun (Ο†.leftDeriv.equivProdOfSurjectiveOfIsCompl Ο†.rightDeriv Ο†.left_range Ο†.right_range Ο†.isCompl_ker : E β†’L[π•œ] F Γ— G) Ο†.pt := Ο†.left_has_deriv.prod Ο†.right_has_deriv #align implicit_function_data.has_strict_fderiv_at ImplicitFunctionData.hasStrictFDerivAt def toPartialHomeomorph : PartialHomeomorph E (F Γ— G) := Ο†.hasStrictFDerivAt.toPartialHomeomorph _ #align implicit_function_data.to_local_homeomorph ImplicitFunctionData.toPartialHomeomorph def implicitFunction : F β†’ G β†’ E := Function.curry <| Ο†.toPartialHomeomorph.symm #align implicit_function_data.implicit_function ImplicitFunctionData.implicitFunction @[simp] theorem toPartialHomeomorph_coe : ⇑φ.toPartialHomeomorph = Ο†.prodFun := rfl #align implicit_function_data.to_local_homeomorph_coe ImplicitFunctionData.toPartialHomeomorph_coe theorem toPartialHomeomorph_apply (x : E) : Ο†.toPartialHomeomorph x = (Ο†.leftFun x, Ο†.rightFun x) := rfl #align implicit_function_data.to_local_homeomorph_apply ImplicitFunctionData.toPartialHomeomorph_apply theorem pt_mem_toPartialHomeomorph_source : Ο†.pt ∈ Ο†.toPartialHomeomorph.source := Ο†.hasStrictFDerivAt.mem_toPartialHomeomorph_source #align implicit_function_data.pt_mem_to_local_homeomorph_source ImplicitFunctionData.pt_mem_toPartialHomeomorph_source theorem map_pt_mem_toPartialHomeomorph_target : (Ο†.leftFun Ο†.pt, Ο†.rightFun Ο†.pt) ∈ Ο†.toPartialHomeomorph.target := Ο†.toPartialHomeomorph.map_source <| Ο†.pt_mem_toPartialHomeomorph_source #align implicit_function_data.map_pt_mem_to_local_homeomorph_target ImplicitFunctionData.map_pt_mem_toPartialHomeomorph_target theorem prod_map_implicitFunction : βˆ€αΆ  p : F Γ— G in 𝓝 (Ο†.prodFun Ο†.pt), Ο†.prodFun (Ο†.implicitFunction p.1 p.2) = p := Ο†.hasStrictFDerivAt.eventually_right_inverse.mono fun ⟨_, _⟩ h => h #align implicit_function_data.prod_map_implicit_function ImplicitFunctionData.prod_map_implicitFunction theorem left_map_implicitFunction : βˆ€αΆ  p : F Γ— G in 𝓝 (Ο†.prodFun Ο†.pt), Ο†.leftFun (Ο†.implicitFunction p.1 p.2) = p.1 := Ο†.prod_map_implicitFunction.mono fun _ => congr_arg Prod.fst #align implicit_function_data.left_map_implicit_function ImplicitFunctionData.left_map_implicitFunction theorem right_map_implicitFunction : βˆ€αΆ  p : F Γ— G in 𝓝 (Ο†.prodFun Ο†.pt), Ο†.rightFun (Ο†.implicitFunction p.1 p.2) = p.2 := Ο†.prod_map_implicitFunction.mono fun _ => congr_arg Prod.snd #align implicit_function_data.right_map_implicit_function ImplicitFunctionData.right_map_implicitFunction theorem implicitFunction_apply_image : βˆ€αΆ  x in 𝓝 Ο†.pt, Ο†.implicitFunction (Ο†.leftFun x) (Ο†.rightFun x) = x := Ο†.hasStrictFDerivAt.eventually_left_inverse #align implicit_function_data.implicit_function_apply_image ImplicitFunctionData.implicitFunction_apply_image theorem map_nhds_eq : map Ο†.leftFun (𝓝 Ο†.pt) = 𝓝 (Ο†.leftFun Ο†.pt) := show map (Prod.fst ∘ Ο†.prodFun) (𝓝 Ο†.pt) = 𝓝 (Ο†.prodFun Ο†.pt).1 by rw [← map_map, Ο†.hasStrictFDerivAt.map_nhds_eq_of_equiv, map_fst_nhds] #align implicit_function_data.map_nhds_eq ImplicitFunctionData.map_nhds_eq
Mathlib/Analysis/Calculus/Implicit.lean
201
214
theorem implicitFunction_hasStrictFDerivAt (g'inv : G β†’L[π•œ] E) (hg'inv : Ο†.rightDeriv.comp g'inv = ContinuousLinearMap.id π•œ G) (hg'invf : Ο†.leftDeriv.comp g'inv = 0) : HasStrictFDerivAt (Ο†.implicitFunction (Ο†.leftFun Ο†.pt)) g'inv (Ο†.rightFun Ο†.pt) := by
have := Ο†.hasStrictFDerivAt.to_localInverse simp only [prodFun] at this convert this.comp (Ο†.rightFun Ο†.pt) ((hasStrictFDerivAt_const _ _).prod (hasStrictFDerivAt_id _)) -- Porting note: added parentheses to help `simp` simp only [ContinuousLinearMap.ext_iff, (ContinuousLinearMap.comp_apply)] at hg'inv hg'invf ⊒ -- porting note (#10745): was `simp [ContinuousLinearEquiv.eq_symm_apply]`; -- both `simp` and `rw` fail here, `erw` works intro x erw [ContinuousLinearEquiv.eq_symm_apply] simp [*]
1,866
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Analysis.Analytic.Constructions import Mathlib.Topology.Algebra.Module.FiniteDimension variable {π•œ E A B : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [CommSemiring A] {z : E} {s : Set E} section Polynomial open Polynomial variable [NormedRing B] [NormedAlgebra π•œ B] [Algebra A B] {f : E β†’ B}
Mathlib/Analysis/Analytic/Polynomial.lean
26
32
theorem AnalyticAt.aeval_polynomial (hf : AnalyticAt π•œ f z) (p : A[X]) : AnalyticAt π•œ (fun x ↦ aeval (f x) p) z := by
refine p.induction_on (fun k ↦ ?_) (fun p q hp hq ↦ ?_) fun p i hp ↦ ?_ Β· simp_rw [aeval_C]; apply analyticAt_const Β· simp_rw [aeval_add]; exact hp.add hq Β· convert hp.mul hf simp_rw [pow_succ, aeval_mul, ← mul_assoc, aeval_X]
1,867
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Analysis.Analytic.Constructions import Mathlib.Topology.Algebra.Module.FiniteDimension variable {π•œ E A B : Type*} [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [CommSemiring A] {z : E} {s : Set E} section MvPolynomial open MvPolynomial variable [NormedCommRing B] [NormedAlgebra π•œ B] [Algebra A B] {Οƒ : Type*} {f : E β†’ Οƒ β†’ B}
Mathlib/Analysis/Analytic/Polynomial.lean
47
52
theorem AnalyticAt.aeval_mvPolynomial (hf : βˆ€ i, AnalyticAt π•œ (f Β· i) z) (p : MvPolynomial Οƒ A) : AnalyticAt π•œ (fun x ↦ aeval (f x) p) z := by
apply p.induction_on (fun k ↦ ?_) (fun p q hp hq ↦ ?_) fun p i hp ↦ ?_ -- `refine` doesn't work Β· simp_rw [aeval_C]; apply analyticAt_const Β· simp_rw [map_add]; exact hp.add hq Β· simp_rw [map_mul, aeval_X]; exact hp.mul (hf i)
1,867
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] [CompleteSpace π•œ]
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
163
176
theorem ContinuousLinearMap.continuous_det : Continuous fun f : E β†’L[π•œ] E => f.det := by
change Continuous fun f : E β†’L[π•œ] E => LinearMap.det (f : E β†’β‚—[π•œ] E) -- Porting note: this could be easier with `det_cases` by_cases h : βˆƒ s : Finset E, Nonempty (Basis (β†₯s) π•œ E) Β· rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional π•œ E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM π•œ)).continuous_of_finiteDimensional Β· -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const
1,868
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] [CompleteSpace π•œ] theorem ContinuousLinearMap.continuous_det : Continuous fun f : E β†’L[π•œ] E => f.det := by change Continuous fun f : E β†’L[π•œ] E => LinearMap.det (f : E β†’β‚—[π•œ] E) -- Porting note: this could be easier with `det_cases` by_cases h : βˆƒ s : Finset E, Nonempty (Basis (β†₯s) π•œ E) Β· rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional π•œ E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM π•œ)).continuous_of_finiteDimensional Β· -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const #align continuous_linear_map.continuous_det ContinuousLinearMap.continuous_det irreducible_def lipschitzExtensionConstant (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : ℝβ‰₯0 := let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv max (β€–A.symm.toContinuousLinearMapβ€–β‚Š * β€–A.toContinuousLinearMapβ€–β‚Š) 1 #align lipschitz_extension_constant lipschitzExtensionConstant
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
189
192
theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : 0 < lipschitzExtensionConstant E' := by
rw [lipschitzExtensionConstant] exact zero_lt_one.trans_le (le_max_right _ _)
1,868
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] [CompleteSpace π•œ] theorem ContinuousLinearMap.continuous_det : Continuous fun f : E β†’L[π•œ] E => f.det := by change Continuous fun f : E β†’L[π•œ] E => LinearMap.det (f : E β†’β‚—[π•œ] E) -- Porting note: this could be easier with `det_cases` by_cases h : βˆƒ s : Finset E, Nonempty (Basis (β†₯s) π•œ E) Β· rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional π•œ E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM π•œ)).continuous_of_finiteDimensional Β· -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const #align continuous_linear_map.continuous_det ContinuousLinearMap.continuous_det irreducible_def lipschitzExtensionConstant (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : ℝβ‰₯0 := let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv max (β€–A.symm.toContinuousLinearMapβ€–β‚Š * β€–A.toContinuousLinearMapβ€–β‚Š) 1 #align lipschitz_extension_constant lipschitzExtensionConstant theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : 0 < lipschitzExtensionConstant E' := by rw [lipschitzExtensionConstant] exact zero_lt_one.trans_le (le_max_right _ _) #align lipschitz_extension_constant_pos lipschitzExtensionConstant_pos
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
198
220
theorem LipschitzOnWith.extend_finite_dimension {Ξ± : Type*} [PseudoMetricSpace Ξ±] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] {s : Set Ξ±} {f : Ξ± β†’ E'} {K : ℝβ‰₯0} (hf : LipschitzOnWith K f s) : βˆƒ g : Ξ± β†’ E', LipschitzWith (lipschitzExtensionConstant E' * K) g ∧ EqOn f g s := by
/- This result is already known for spaces `ΞΉ β†’ ℝ`. We use a continuous linear equiv between `E'` and such a space to transfer the result to `E'`. -/ let ΞΉ : Type _ := Basis.ofVectorSpaceIndex ℝ E' let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv have LA : LipschitzWith β€–A.toContinuousLinearMapβ€–β‚Š A := by apply A.lipschitz have L : LipschitzOnWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) (A ∘ f) s := LA.comp_lipschitzOnWith hf obtain ⟨g, hg, gs⟩ : βˆƒ g : Ξ± β†’ ΞΉ β†’ ℝ, LipschitzWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) g ∧ EqOn (A ∘ f) g s := L.extend_pi refine ⟨A.symm ∘ g, ?_, ?_⟩ Β· have LAsymm : LipschitzWith β€–A.symm.toContinuousLinearMapβ€–β‚Š A.symm := by apply A.symm.lipschitz apply (LAsymm.comp hg).weaken rw [lipschitzExtensionConstant, ← mul_assoc] exact mul_le_mul' (le_max_left _ _) le_rfl Β· intro x hx have : A (f x) = g x := gs hx simp only [(Β· ∘ Β·), ← this, A.symm_apply_apply]
1,868
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] [CompleteSpace π•œ] theorem ContinuousLinearMap.continuous_det : Continuous fun f : E β†’L[π•œ] E => f.det := by change Continuous fun f : E β†’L[π•œ] E => LinearMap.det (f : E β†’β‚—[π•œ] E) -- Porting note: this could be easier with `det_cases` by_cases h : βˆƒ s : Finset E, Nonempty (Basis (β†₯s) π•œ E) Β· rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional π•œ E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM π•œ)).continuous_of_finiteDimensional Β· -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const #align continuous_linear_map.continuous_det ContinuousLinearMap.continuous_det irreducible_def lipschitzExtensionConstant (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : ℝβ‰₯0 := let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv max (β€–A.symm.toContinuousLinearMapβ€–β‚Š * β€–A.toContinuousLinearMapβ€–β‚Š) 1 #align lipschitz_extension_constant lipschitzExtensionConstant theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : 0 < lipschitzExtensionConstant E' := by rw [lipschitzExtensionConstant] exact zero_lt_one.trans_le (le_max_right _ _) #align lipschitz_extension_constant_pos lipschitzExtensionConstant_pos theorem LipschitzOnWith.extend_finite_dimension {Ξ± : Type*} [PseudoMetricSpace Ξ±] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] {s : Set Ξ±} {f : Ξ± β†’ E'} {K : ℝβ‰₯0} (hf : LipschitzOnWith K f s) : βˆƒ g : Ξ± β†’ E', LipschitzWith (lipschitzExtensionConstant E' * K) g ∧ EqOn f g s := by let ΞΉ : Type _ := Basis.ofVectorSpaceIndex ℝ E' let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv have LA : LipschitzWith β€–A.toContinuousLinearMapβ€–β‚Š A := by apply A.lipschitz have L : LipschitzOnWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) (A ∘ f) s := LA.comp_lipschitzOnWith hf obtain ⟨g, hg, gs⟩ : βˆƒ g : Ξ± β†’ ΞΉ β†’ ℝ, LipschitzWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) g ∧ EqOn (A ∘ f) g s := L.extend_pi refine ⟨A.symm ∘ g, ?_, ?_⟩ Β· have LAsymm : LipschitzWith β€–A.symm.toContinuousLinearMapβ€–β‚Š A.symm := by apply A.symm.lipschitz apply (LAsymm.comp hg).weaken rw [lipschitzExtensionConstant, ← mul_assoc] exact mul_le_mul' (le_max_left _ _) le_rfl Β· intro x hx have : A (f x) = g x := gs hx simp only [(Β· ∘ Β·), ← this, A.symm_apply_apply] #align lipschitz_on_with.extend_finite_dimension LipschitzOnWith.extend_finite_dimension
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
223
229
theorem LinearMap.exists_antilipschitzWith [FiniteDimensional π•œ E] (f : E β†’β‚—[π•œ] F) (hf : LinearMap.ker f = βŠ₯) : βˆƒ K > 0, AntilipschitzWith K f := by
cases subsingleton_or_nontrivial E Β· exact ⟨1, zero_lt_one, AntilipschitzWith.of_subsingleton⟩ Β· rw [LinearMap.ker_eq_bot] at hf let e : E ≃L[π•œ] LinearMap.range f := (LinearEquiv.ofInjective f hf).toContinuousLinearEquiv exact ⟨_, e.nnnorm_symm_pos, e.antilipschitz⟩
1,868
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] [CompleteSpace π•œ] theorem ContinuousLinearMap.continuous_det : Continuous fun f : E β†’L[π•œ] E => f.det := by change Continuous fun f : E β†’L[π•œ] E => LinearMap.det (f : E β†’β‚—[π•œ] E) -- Porting note: this could be easier with `det_cases` by_cases h : βˆƒ s : Finset E, Nonempty (Basis (β†₯s) π•œ E) Β· rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional π•œ E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM π•œ)).continuous_of_finiteDimensional Β· -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const #align continuous_linear_map.continuous_det ContinuousLinearMap.continuous_det irreducible_def lipschitzExtensionConstant (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : ℝβ‰₯0 := let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv max (β€–A.symm.toContinuousLinearMapβ€–β‚Š * β€–A.toContinuousLinearMapβ€–β‚Š) 1 #align lipschitz_extension_constant lipschitzExtensionConstant theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : 0 < lipschitzExtensionConstant E' := by rw [lipschitzExtensionConstant] exact zero_lt_one.trans_le (le_max_right _ _) #align lipschitz_extension_constant_pos lipschitzExtensionConstant_pos theorem LipschitzOnWith.extend_finite_dimension {Ξ± : Type*} [PseudoMetricSpace Ξ±] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] {s : Set Ξ±} {f : Ξ± β†’ E'} {K : ℝβ‰₯0} (hf : LipschitzOnWith K f s) : βˆƒ g : Ξ± β†’ E', LipschitzWith (lipschitzExtensionConstant E' * K) g ∧ EqOn f g s := by let ΞΉ : Type _ := Basis.ofVectorSpaceIndex ℝ E' let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv have LA : LipschitzWith β€–A.toContinuousLinearMapβ€–β‚Š A := by apply A.lipschitz have L : LipschitzOnWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) (A ∘ f) s := LA.comp_lipschitzOnWith hf obtain ⟨g, hg, gs⟩ : βˆƒ g : Ξ± β†’ ΞΉ β†’ ℝ, LipschitzWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) g ∧ EqOn (A ∘ f) g s := L.extend_pi refine ⟨A.symm ∘ g, ?_, ?_⟩ Β· have LAsymm : LipschitzWith β€–A.symm.toContinuousLinearMapβ€–β‚Š A.symm := by apply A.symm.lipschitz apply (LAsymm.comp hg).weaken rw [lipschitzExtensionConstant, ← mul_assoc] exact mul_le_mul' (le_max_left _ _) le_rfl Β· intro x hx have : A (f x) = g x := gs hx simp only [(Β· ∘ Β·), ← this, A.symm_apply_apply] #align lipschitz_on_with.extend_finite_dimension LipschitzOnWith.extend_finite_dimension theorem LinearMap.exists_antilipschitzWith [FiniteDimensional π•œ E] (f : E β†’β‚—[π•œ] F) (hf : LinearMap.ker f = βŠ₯) : βˆƒ K > 0, AntilipschitzWith K f := by cases subsingleton_or_nontrivial E Β· exact ⟨1, zero_lt_one, AntilipschitzWith.of_subsingleton⟩ Β· rw [LinearMap.ker_eq_bot] at hf let e : E ≃L[π•œ] LinearMap.range f := (LinearEquiv.ofInjective f hf).toContinuousLinearEquiv exact ⟨_, e.nnnorm_symm_pos, e.antilipschitz⟩ #align linear_map.exists_antilipschitz_with LinearMap.exists_antilipschitzWith open Function in
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
235
241
theorem LinearMap.injective_iff_antilipschitz [FiniteDimensional π•œ E] (f : E β†’β‚—[π•œ] F) : Injective f ↔ βˆƒ K > 0, AntilipschitzWith K f := by
constructor Β· rw [← LinearMap.ker_eq_bot] exact f.exists_antilipschitzWith Β· rintro ⟨K, -, H⟩ exact H.injective
1,868
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Normed.Group.Lemmas import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.AffineIsometry import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.RieszLemma import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.Matrix #align_import analysis.normed_space.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter Asymptotics Classical Topology NNReal Metric section CompleteField variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type v} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type w} [NormedAddCommGroup F] [NormedSpace π•œ F] {F' : Type x} [AddCommGroup F'] [Module π•œ F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul π•œ F'] [CompleteSpace π•œ] theorem ContinuousLinearMap.continuous_det : Continuous fun f : E β†’L[π•œ] E => f.det := by change Continuous fun f : E β†’L[π•œ] E => LinearMap.det (f : E β†’β‚—[π•œ] E) -- Porting note: this could be easier with `det_cases` by_cases h : βˆƒ s : Finset E, Nonempty (Basis (β†₯s) π•œ E) Β· rcases h with ⟨s, ⟨b⟩⟩ haveI : FiniteDimensional π•œ E := FiniteDimensional.of_fintype_basis b simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ exact ((LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM π•œ)).continuous_of_finiteDimensional Β· -- Porting note: was `unfold LinearMap.det` rw [LinearMap.det_def] simpa only [h, MonoidHom.one_apply, dif_neg, not_false_iff] using continuous_const #align continuous_linear_map.continuous_det ContinuousLinearMap.continuous_det irreducible_def lipschitzExtensionConstant (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : ℝβ‰₯0 := let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv max (β€–A.symm.toContinuousLinearMapβ€–β‚Š * β€–A.toContinuousLinearMapβ€–β‚Š) 1 #align lipschitz_extension_constant lipschitzExtensionConstant theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] : 0 < lipschitzExtensionConstant E' := by rw [lipschitzExtensionConstant] exact zero_lt_one.trans_le (le_max_right _ _) #align lipschitz_extension_constant_pos lipschitzExtensionConstant_pos theorem LipschitzOnWith.extend_finite_dimension {Ξ± : Type*} [PseudoMetricSpace Ξ±] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] {s : Set Ξ±} {f : Ξ± β†’ E'} {K : ℝβ‰₯0} (hf : LipschitzOnWith K f s) : βˆƒ g : Ξ± β†’ E', LipschitzWith (lipschitzExtensionConstant E' * K) g ∧ EqOn f g s := by let ΞΉ : Type _ := Basis.ofVectorSpaceIndex ℝ E' let A := (Basis.ofVectorSpace ℝ E').equivFun.toContinuousLinearEquiv have LA : LipschitzWith β€–A.toContinuousLinearMapβ€–β‚Š A := by apply A.lipschitz have L : LipschitzOnWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) (A ∘ f) s := LA.comp_lipschitzOnWith hf obtain ⟨g, hg, gs⟩ : βˆƒ g : Ξ± β†’ ΞΉ β†’ ℝ, LipschitzWith (β€–A.toContinuousLinearMapβ€–β‚Š * K) g ∧ EqOn (A ∘ f) g s := L.extend_pi refine ⟨A.symm ∘ g, ?_, ?_⟩ Β· have LAsymm : LipschitzWith β€–A.symm.toContinuousLinearMapβ€–β‚Š A.symm := by apply A.symm.lipschitz apply (LAsymm.comp hg).weaken rw [lipschitzExtensionConstant, ← mul_assoc] exact mul_le_mul' (le_max_left _ _) le_rfl Β· intro x hx have : A (f x) = g x := gs hx simp only [(Β· ∘ Β·), ← this, A.symm_apply_apply] #align lipschitz_on_with.extend_finite_dimension LipschitzOnWith.extend_finite_dimension theorem LinearMap.exists_antilipschitzWith [FiniteDimensional π•œ E] (f : E β†’β‚—[π•œ] F) (hf : LinearMap.ker f = βŠ₯) : βˆƒ K > 0, AntilipschitzWith K f := by cases subsingleton_or_nontrivial E Β· exact ⟨1, zero_lt_one, AntilipschitzWith.of_subsingleton⟩ Β· rw [LinearMap.ker_eq_bot] at hf let e : E ≃L[π•œ] LinearMap.range f := (LinearEquiv.ofInjective f hf).toContinuousLinearEquiv exact ⟨_, e.nnnorm_symm_pos, e.antilipschitz⟩ #align linear_map.exists_antilipschitz_with LinearMap.exists_antilipschitzWith open Function in theorem LinearMap.injective_iff_antilipschitz [FiniteDimensional π•œ E] (f : E β†’β‚—[π•œ] F) : Injective f ↔ βˆƒ K > 0, AntilipschitzWith K f := by constructor Β· rw [← LinearMap.ker_eq_bot] exact f.exists_antilipschitzWith Β· rintro ⟨K, -, H⟩ exact H.injective open Function in
Mathlib/Analysis/NormedSpace/FiniteDimension.lean
246
255
theorem ContinuousLinearMap.isOpen_injective [FiniteDimensional π•œ E] : IsOpen { L : E β†’L[π•œ] F | Injective L } := by
rw [isOpen_iff_eventually] rintro Ο†β‚€ hΟ†β‚€ rcases Ο†β‚€.injective_iff_antilipschitz.mp hΟ†β‚€ with ⟨K, K_pos, H⟩ have : βˆ€αΆ  Ο† in 𝓝 Ο†β‚€, β€–Ο† - Ο†β‚€β€–β‚Š < K⁻¹ := eventually_nnnorm_sub_lt _ <| inv_pos_of_pos K_pos filter_upwards [this] with Ο† hΟ† apply Ο†.injective_iff_antilipschitz.mpr exact ⟨(K⁻¹ - β€–Ο† - Ο†β‚€β€–β‚Š)⁻¹, inv_pos_of_pos (tsub_pos_of_lt hΟ†), H.add_sub_lipschitzWith (Ο† - Ο†β‚€).lipschitz hΟ†βŸ©
1,868
import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn import Mathlib.Analysis.NormedSpace.FiniteDimension open Set open scoped NNReal namespace ApproximatesLinearOn
Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean
27
47
theorem exists_homeomorph_extension {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] {s : Set E} {f : E β†’ F} {f' : E ≃L[ℝ] F} {c : ℝβ‰₯0} (hf : ApproximatesLinearOn f (f' : E β†’L[ℝ] F) s c) (hc : Subsingleton E ∨ lipschitzExtensionConstant F * c < β€–(f'.symm : F β†’L[ℝ] E)β€–β‚Šβ»ΒΉ) : βˆƒ g : E β‰ƒβ‚œ F, EqOn f g s := by
-- the difference `f - f'` is Lipschitz on `s`. It can be extended to a Lipschitz function `u` -- on the whole space, with a slightly worse Lipschitz constant. Then `f' + u` will be the -- desired homeomorphism. obtain ⟨u, hu, uf⟩ : βˆƒ u : E β†’ F, LipschitzWith (lipschitzExtensionConstant F * c) u ∧ EqOn (f - ⇑f') u s := hf.lipschitzOnWith.extend_finite_dimension let g : E β†’ F := fun x => f' x + u x have fg : EqOn f g s := fun x hx => by simp_rw [g, ← uf hx, Pi.sub_apply, add_sub_cancel] have hg : ApproximatesLinearOn g (f' : E β†’L[ℝ] F) univ (lipschitzExtensionConstant F * c) := by apply LipschitzOnWith.approximatesLinearOn rw [lipschitzOn_univ] convert hu ext x simp only [g, add_sub_cancel_left, ContinuousLinearEquiv.coe_coe, Pi.sub_apply] haveI : FiniteDimensional ℝ E := f'.symm.finiteDimensional exact ⟨hg.toHomeomorph g hc, fg⟩
1,869
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ]
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
35
43
theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by
refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _)
1,870
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ] theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _) #align cont_diff_on_clm_apply contDiffOn_clm_apply
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
46
48
theorem contDiff_clm_apply_iff {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} [FiniteDimensional π•œ F] : ContDiff π•œ n f ↔ βˆ€ y, ContDiff π•œ n fun x => f x y := by
simp_rw [← contDiffOn_univ, contDiffOn_clm_apply]
1,870
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ] theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _) #align cont_diff_on_clm_apply contDiffOn_clm_apply theorem contDiff_clm_apply_iff {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} [FiniteDimensional π•œ F] : ContDiff π•œ n f ↔ βˆ€ y, ContDiff π•œ n fun x => f x y := by simp_rw [← contDiffOn_univ, contDiffOn_clm_apply] #align cont_diff_clm_apply_iff contDiff_clm_apply_iff
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
60
62
theorem contDiff_succ_iff_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} : ContDiff π•œ (n + 1 : β„•) f ↔ Differentiable π•œ f ∧ βˆ€ y, ContDiff π•œ n fun x => fderiv π•œ f x y := by
rw [contDiff_succ_iff_fderiv, contDiff_clm_apply_iff]
1,870
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ] theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _) #align cont_diff_on_clm_apply contDiffOn_clm_apply theorem contDiff_clm_apply_iff {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} [FiniteDimensional π•œ F] : ContDiff π•œ n f ↔ βˆ€ y, ContDiff π•œ n fun x => f x y := by simp_rw [← contDiffOn_univ, contDiffOn_clm_apply] #align cont_diff_clm_apply_iff contDiff_clm_apply_iff theorem contDiff_succ_iff_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} : ContDiff π•œ (n + 1 : β„•) f ↔ Differentiable π•œ f ∧ βˆ€ y, ContDiff π•œ n fun x => fderiv π•œ f x y := by rw [contDiff_succ_iff_fderiv, contDiff_clm_apply_iff] #align cont_diff_succ_iff_fderiv_apply contDiff_succ_iff_fderiv_apply theorem contDiffOn_succ_of_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} {s : Set E} (hf : DifferentiableOn π•œ f s) (h : βˆ€ y, ContDiffOn π•œ n (fun x => fderivWithin π•œ f s x y) s) : ContDiffOn π•œ (n + 1 : β„•) f s := contDiffOn_succ_of_fderivWithin hf <| contDiffOn_clm_apply.mpr h #align cont_diff_on_succ_of_fderiv_apply contDiffOn_succ_of_fderiv_apply
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
71
75
theorem contDiffOn_succ_iff_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} {s : Set E} (hs : UniqueDiffOn π•œ s) : ContDiffOn π•œ (n + 1 : β„•) f s ↔ DifferentiableOn π•œ f s ∧ βˆ€ y, ContDiffOn π•œ n (fun x => fderivWithin π•œ f s x y) s := by
rw [contDiffOn_succ_iff_fderivWithin hs, contDiffOn_clm_apply]
1,870
import Mathlib.Analysis.Complex.Isometry import Mathlib.Analysis.NormedSpace.ConformalLinearMap import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.complex.conformal from "leanprover-community/mathlib"@"468b141b14016d54b479eb7a0fff1e360b7e3cf6" noncomputable section open Complex ContinuousLinearMap ComplexConjugate theorem isConformalMap_conj : IsConformalMap (conjLIE : β„‚ β†’L[ℝ] β„‚) := conjLIE.toLinearIsometry.isConformalMap #align is_conformal_map_conj isConformalMap_conj section ConformalIntoComplexNormed variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedSpace β„‚ E] {z : β„‚} {g : β„‚ β†’L[ℝ] E} {f : β„‚ β†’ E}
Mathlib/Analysis/Complex/Conformal.lean
49
62
theorem isConformalMap_complex_linear {map : β„‚ β†’L[β„‚] E} (nonzero : map β‰  0) : IsConformalMap (map.restrictScalars ℝ) := by
have minor₁ : β€–map 1β€– β‰  0 := by simpa only [ext_ring_iff, Ne, norm_eq_zero] using nonzero refine βŸ¨β€–map 1β€–, minor₁, βŸ¨β€–map 1‖⁻¹ β€’ ((map : β„‚ β†’β‚—[β„‚] E) : β„‚ β†’β‚—[ℝ] E), ?_⟩, ?_⟩ Β· intro x simp only [LinearMap.smul_apply] have : x = x β€’ (1 : β„‚) := by rw [smul_eq_mul, mul_one] nth_rw 1 [this] rw [LinearMap.coe_restrictScalars] simp only [map.coe_coe, map.map_smul, norm_smul, norm_inv, norm_norm] field_simp only [one_mul] Β· ext1 -- porting note (#10745): was `simp`; explicitly supplied simp lemma simp [smul_inv_smulβ‚€ minor₁]
1,871
import Mathlib.Analysis.Complex.Isometry import Mathlib.Analysis.NormedSpace.ConformalLinearMap import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.complex.conformal from "leanprover-community/mathlib"@"468b141b14016d54b479eb7a0fff1e360b7e3cf6" noncomputable section open Complex ContinuousLinearMap ComplexConjugate theorem isConformalMap_conj : IsConformalMap (conjLIE : β„‚ β†’L[ℝ] β„‚) := conjLIE.toLinearIsometry.isConformalMap #align is_conformal_map_conj isConformalMap_conj section ConformalIntoComplexPlane open ContinuousLinearMap variable {f : β„‚ β†’ β„‚} {z : β„‚} {g : β„‚ β†’L[ℝ] β„‚}
Mathlib/Analysis/Complex/Conformal.lean
78
91
theorem IsConformalMap.is_complex_or_conj_linear (h : IsConformalMap g) : (βˆƒ map : β„‚ β†’L[β„‚] β„‚, map.restrictScalars ℝ = g) ∨ βˆƒ map : β„‚ β†’L[β„‚] β„‚, map.restrictScalars ℝ = g ∘L ↑conjCLE := by
rcases h with ⟨c, -, li, rfl⟩ obtain ⟨li, rfl⟩ : βˆƒ li' : β„‚ ≃ₗᡒ[ℝ] β„‚, li'.toLinearIsometry = li := ⟨li.toLinearIsometryEquiv rfl, by ext1; rfl⟩ rcases linear_isometry_complex li with ⟨a, rfl | rfl⟩ -- let rot := c β€’ (a : β„‚) β€’ ContinuousLinearMap.id β„‚ β„‚, Β· refine Or.inl ⟨c β€’ (a : β„‚) β€’ ContinuousLinearMap.id β„‚ β„‚, ?_⟩ ext1 simp Β· refine Or.inr ⟨c β€’ (a : β„‚) β€’ ContinuousLinearMap.id β„‚ β„‚, ?_⟩ ext1 simp
1,871
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ}
Mathlib/Analysis/Complex/RealDeriv.lean
49
62
theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by
have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex
Mathlib/Analysis/Complex/RealDeriv.lean
68
81
theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by
have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex
Mathlib/Analysis/Complex/RealDeriv.lean
84
89
theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by
have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A)
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A) #align cont_diff_at.real_of_complex ContDiffAt.real_of_complex theorem ContDiff.real_of_complex {n : β„•βˆž} (h : ContDiff β„‚ n e) : ContDiff ℝ n fun x : ℝ => (e x).re := contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex #align cont_diff.real_of_complex ContDiff.real_of_complex variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E]
Mathlib/Analysis/Complex/RealDeriv.lean
99
103
theorem HasStrictDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by
simpa only [Complex.restrictScalars_one_smulRight'] using h.hasStrictFDerivAt.restrictScalars ℝ
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A) #align cont_diff_at.real_of_complex ContDiffAt.real_of_complex theorem ContDiff.real_of_complex {n : β„•βˆž} (h : ContDiff β„‚ n e) : ContDiff ℝ n fun x : ℝ => (e x).re := contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex #align cont_diff.real_of_complex ContDiff.real_of_complex variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] theorem HasStrictDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv'
Mathlib/Analysis/Complex/RealDeriv.lean
106
108
theorem HasDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasDerivAt f f' x) : HasFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by
simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars ℝ
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A) #align cont_diff_at.real_of_complex ContDiffAt.real_of_complex theorem ContDiff.real_of_complex {n : β„•βˆž} (h : ContDiff β„‚ n e) : ContDiff ℝ n fun x : ℝ => (e x).re := contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex #align cont_diff.real_of_complex ContDiff.real_of_complex variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] theorem HasStrictDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv' theorem HasDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasDerivAt f f' x) : HasFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars ℝ #align has_deriv_at.complex_to_real_fderiv' HasDerivAt.complexToReal_fderiv'
Mathlib/Analysis/Complex/RealDeriv.lean
111
115
theorem HasDerivWithinAt.complexToReal_fderiv' {f : β„‚ β†’ E} {s : Set β„‚} {x : β„‚} {f' : E} (h : HasDerivWithinAt f f' s x) : HasFDerivWithinAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') s x := by
simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivWithinAt.restrictScalars ℝ
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A) #align cont_diff_at.real_of_complex ContDiffAt.real_of_complex theorem ContDiff.real_of_complex {n : β„•βˆž} (h : ContDiff β„‚ n e) : ContDiff ℝ n fun x : ℝ => (e x).re := contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex #align cont_diff.real_of_complex ContDiff.real_of_complex variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] theorem HasStrictDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv' theorem HasDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasDerivAt f f' x) : HasFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars ℝ #align has_deriv_at.complex_to_real_fderiv' HasDerivAt.complexToReal_fderiv' theorem HasDerivWithinAt.complexToReal_fderiv' {f : β„‚ β†’ E} {s : Set β„‚} {x : β„‚} {f' : E} (h : HasDerivWithinAt f f' s x) : HasFDerivWithinAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') s x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivWithinAt.restrictScalars ℝ #align has_deriv_within_at.complex_to_real_fderiv' HasDerivWithinAt.complexToReal_fderiv'
Mathlib/Analysis/Complex/RealDeriv.lean
118
120
theorem HasStrictDerivAt.complexToReal_fderiv {f : β„‚ β†’ β„‚} {f' x : β„‚} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (f' β€’ (1 : β„‚ β†’L[ℝ] β„‚)) x := by
simpa only [Complex.restrictScalars_one_smulRight] using h.hasStrictFDerivAt.restrictScalars ℝ
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A) #align cont_diff_at.real_of_complex ContDiffAt.real_of_complex theorem ContDiff.real_of_complex {n : β„•βˆž} (h : ContDiff β„‚ n e) : ContDiff ℝ n fun x : ℝ => (e x).re := contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex #align cont_diff.real_of_complex ContDiff.real_of_complex variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] theorem HasStrictDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv' theorem HasDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasDerivAt f f' x) : HasFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars ℝ #align has_deriv_at.complex_to_real_fderiv' HasDerivAt.complexToReal_fderiv' theorem HasDerivWithinAt.complexToReal_fderiv' {f : β„‚ β†’ E} {s : Set β„‚} {x : β„‚} {f' : E} (h : HasDerivWithinAt f f' s x) : HasFDerivWithinAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') s x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivWithinAt.restrictScalars ℝ #align has_deriv_within_at.complex_to_real_fderiv' HasDerivWithinAt.complexToReal_fderiv' theorem HasStrictDerivAt.complexToReal_fderiv {f : β„‚ β†’ β„‚} {f' x : β„‚} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (f' β€’ (1 : β„‚ β†’L[ℝ] β„‚)) x := by simpa only [Complex.restrictScalars_one_smulRight] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv HasStrictDerivAt.complexToReal_fderiv
Mathlib/Analysis/Complex/RealDeriv.lean
123
125
theorem HasDerivAt.complexToReal_fderiv {f : β„‚ β†’ β„‚} {f' x : β„‚} (h : HasDerivAt f f' x) : HasFDerivAt f (f' β€’ (1 : β„‚ β†’L[ℝ] β„‚)) x := by
simpa only [Complex.restrictScalars_one_smulRight] using h.hasFDerivAt.restrictScalars ℝ
1,872
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.Calculus.Deriv.Linear import Mathlib.Analysis.Complex.Conformal import Mathlib.Analysis.Calculus.Conformal.NormedSpace #align_import analysis.complex.real_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" section RealDerivOfComplex open Complex variable {e : β„‚ β†’ β„‚} {e' : β„‚} {z : ℝ} theorem HasStrictDerivAt.real_of_complex (h : HasStrictDerivAt e e' z) : HasStrictDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasStrictFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasStrictFDerivAt have B : HasStrictFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasStrictFDerivAt.restrictScalars ℝ have C : HasStrictFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasStrictFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasStrictDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_strict_deriv_at.real_of_complex HasStrictDerivAt.real_of_complex theorem HasDerivAt.real_of_complex (h : HasDerivAt e e' z) : HasDerivAt (fun x : ℝ => (e x).re) e'.re z := by have A : HasFDerivAt ((↑) : ℝ β†’ β„‚) ofRealCLM z := ofRealCLM.hasFDerivAt have B : HasFDerivAt e ((ContinuousLinearMap.smulRight 1 e' : β„‚ β†’L[β„‚] β„‚).restrictScalars ℝ) (ofRealCLM z) := h.hasFDerivAt.restrictScalars ℝ have C : HasFDerivAt re reCLM (e (ofRealCLM z)) := reCLM.hasFDerivAt -- Porting note: this should be by: -- simpa using (C.comp z (B.comp z A)).hasStrictDerivAt -- but for some reason simp can not use `ContinuousLinearMap.comp_apply` convert (C.comp z (B.comp z A)).hasDerivAt rw [ContinuousLinearMap.comp_apply, ContinuousLinearMap.comp_apply] simp #align has_deriv_at.real_of_complex HasDerivAt.real_of_complex theorem ContDiffAt.real_of_complex {n : β„•βˆž} (h : ContDiffAt β„‚ n e z) : ContDiffAt ℝ n (fun x : ℝ => (e x).re) z := by have A : ContDiffAt ℝ n ((↑) : ℝ β†’ β„‚) z := ofRealCLM.contDiff.contDiffAt have B : ContDiffAt ℝ n e z := h.restrict_scalars ℝ have C : ContDiffAt ℝ n re (e z) := reCLM.contDiff.contDiffAt exact C.comp z (B.comp z A) #align cont_diff_at.real_of_complex ContDiffAt.real_of_complex theorem ContDiff.real_of_complex {n : β„•βˆž} (h : ContDiff β„‚ n e) : ContDiff ℝ n fun x : ℝ => (e x).re := contDiff_iff_contDiffAt.2 fun _ => h.contDiffAt.real_of_complex #align cont_diff.real_of_complex ContDiff.real_of_complex variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] theorem HasStrictDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv' HasStrictDerivAt.complexToReal_fderiv' theorem HasDerivAt.complexToReal_fderiv' {f : β„‚ β†’ E} {x : β„‚} {f' : E} (h : HasDerivAt f f' x) : HasFDerivAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivAt.restrictScalars ℝ #align has_deriv_at.complex_to_real_fderiv' HasDerivAt.complexToReal_fderiv' theorem HasDerivWithinAt.complexToReal_fderiv' {f : β„‚ β†’ E} {s : Set β„‚} {x : β„‚} {f' : E} (h : HasDerivWithinAt f f' s x) : HasFDerivWithinAt f (reCLM.smulRight f' + I β€’ imCLM.smulRight f') s x := by simpa only [Complex.restrictScalars_one_smulRight'] using h.hasFDerivWithinAt.restrictScalars ℝ #align has_deriv_within_at.complex_to_real_fderiv' HasDerivWithinAt.complexToReal_fderiv' theorem HasStrictDerivAt.complexToReal_fderiv {f : β„‚ β†’ β„‚} {f' x : β„‚} (h : HasStrictDerivAt f f' x) : HasStrictFDerivAt f (f' β€’ (1 : β„‚ β†’L[ℝ] β„‚)) x := by simpa only [Complex.restrictScalars_one_smulRight] using h.hasStrictFDerivAt.restrictScalars ℝ #align has_strict_deriv_at.complex_to_real_fderiv HasStrictDerivAt.complexToReal_fderiv theorem HasDerivAt.complexToReal_fderiv {f : β„‚ β†’ β„‚} {f' x : β„‚} (h : HasDerivAt f f' x) : HasFDerivAt f (f' β€’ (1 : β„‚ β†’L[ℝ] β„‚)) x := by simpa only [Complex.restrictScalars_one_smulRight] using h.hasFDerivAt.restrictScalars ℝ #align has_deriv_at.complex_to_real_fderiv HasDerivAt.complexToReal_fderiv
Mathlib/Analysis/Complex/RealDeriv.lean
128
130
theorem HasDerivWithinAt.complexToReal_fderiv {f : β„‚ β†’ β„‚} {s : Set β„‚} {f' x : β„‚} (h : HasDerivWithinAt f f' s x) : HasFDerivWithinAt f (f' β€’ (1 : β„‚ β†’L[ℝ] β„‚)) s x := by
simpa only [Complex.restrictScalars_one_smulRight] using h.hasFDerivWithinAt.restrictScalars ℝ
1,872