diff --git a/Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean b/Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean index 00a09a5d6..d0a30cc3f 100644 --- a/Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean +++ b/Physlib/ClassicalMechanics/DampedHarmonicOscillator/Solution.lean @@ -534,7 +534,7 @@ lemma equationOfMotion_unique (x y : Time → EuclideanSpace ℝ (Fin 1)) (v := fun _ p => S.phaseVectorField p) (s := fun _ => Set.univ) (t₀ := (0 : ℝ)) (f := fun τ : ℝ => (x (Time.toRealCLE.symm τ), ∂ₜ x (Time.toRealCLE.symm τ))) (g := fun τ : ℝ => (y (Time.toRealCLE.symm τ), ∂ₜ y (Time.toRealCLE.symm τ))) - (fun _ => S.phaseVectorField.lipschitz.lipschitzOnWith) + (fun _ => S.phaseVectorField.lipschitzWith.lipschitzOnWith) (fun τ => ⟨S.phaseCurve_hasDerivAt x hx hEOMx τ, Set.mem_univ _⟩) (fun τ => ⟨S.phaseCurve_hasDerivAt y hy hEOMy τ, Set.mem_univ _⟩) hIC diff --git a/Physlib/CondensedMatter/Thermoelectric/Basic.lean b/Physlib/CondensedMatter/Thermoelectric/Basic.lean index fff71ce12..eedd43c98 100644 --- a/Physlib/CondensedMatter/Thermoelectric/Basic.lean +++ b/Physlib/CondensedMatter/Thermoelectric/Basic.lean @@ -5,7 +5,7 @@ Authors: Giuseppe Barbalinardo -/ module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Tactic.Ring public import Mathlib.Tactic.Positivity /-! diff --git a/Physlib/CondensedMatter/TightBindingChain/Basic.lean b/Physlib/CondensedMatter/TightBindingChain/Basic.lean index 4a51de07b..bf571eedf 100644 --- a/Physlib/CondensedMatter/TightBindingChain/Basic.lean +++ b/Physlib/CondensedMatter/TightBindingChain/Basic.lean @@ -246,7 +246,7 @@ lemma hamiltonian_apply_localizedState (n : Fin T.N) : simp only [hamiltonian, LinearMap.sub_apply, LinearMap.smul_apply, LinearMap.coe_sum, Finset.sum_apply, LinearMap.add_apply, smul_add, Finset.sum_add_distrib, localizedComp_apply_localizedState, ← eq_sub_iff_add_eq, Finset.sum_ite_eq', Finset.mem_univ, - if_true] + ite_true] module /-! diff --git a/Physlib/Electromagnetism/Distributional/Basic.lean b/Physlib/Electromagnetism/Distributional/Basic.lean index 667a6cd85..45c4d48cc 100644 --- a/Physlib/Electromagnetism/Distributional/Basic.lean +++ b/Physlib/Electromagnetism/Distributional/Basic.lean @@ -189,8 +189,7 @@ lemma toTensor_distTensorDeriv_basis_repr_apply {d} (A : DistElectromagneticPote distDeriv (b 0) A ε (b 1) := by rw [Tensorial.basis_toTensor_apply] rw [Tensorial.basis_map_prod] - simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Finsupp.mapDomain_equiv_apply, - Equiv.symm_symm, Fin.isValue] + simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Fin.isValue] rw [Lorentz.Vector.tensor_basis_map_eq_basis_reindex, Lorentz.CoVector.tensor_basis_map_eq_basis_reindex] have hb : (((Lorentz.CoVector.basis (d := d)).reindex @@ -203,7 +202,8 @@ lemma toTensor_distTensorDeriv_basis_repr_apply {d} (A : DistElectromagneticPote | ⟨i, j⟩ => simp rw [hb] - rw [Module.Basis.repr_reindex_apply, distTensorDeriv_basis_repr_apply] + rw [Finsupp.equivMapDomain_apply, Module.Basis.repr_reindex_apply, + distTensorDeriv_basis_repr_apply] rfl end DistElectromagneticPotential diff --git a/Physlib/Electromagnetism/Distributional/Dynamics/KineticTerm.lean b/Physlib/Electromagnetism/Distributional/Dynamics/KineticTerm.lean index 4ceb0f747..5de4e9711 100644 --- a/Physlib/Electromagnetism/Distributional/Dynamics/KineticTerm.lean +++ b/Physlib/Electromagnetism/Distributional/Dynamics/KineticTerm.lean @@ -197,8 +197,7 @@ lemma gradKineticTerm_eq_distTensorDeriv {d} {𝓕 : FreeSpace} (fun | 0 => μ | 1 => ν) · generalize (distDeriv μ (A.fieldStrength) ε) = t at * rw [Tensorial.basis_toTensor_apply, Tensorial.basis_map_prod] - simp only [Basis.repr_reindex, Finsupp.mapDomain_equiv_apply, - Equiv.symm_symm] + simp only [Basis.repr_reindex] rw [Lorentz.Vector.tensor_basis_map_eq_basis_reindex] have hb : (((Lorentz.Vector.basis (d := d)).reindex Lorentz.Vector.indexEquiv.symm).tensorProduct @@ -207,7 +206,7 @@ lemma gradKineticTerm_eq_distTensorDeriv {d} {𝓕 : FreeSpace} (Lorentz.Vector.indexEquiv.symm.prodCongr Lorentz.Vector.indexEquiv.symm) := by ext ⟨i, j⟩ simp - rw [hb, Module.Basis.repr_reindex_apply] + rw [hb, Finsupp.equivMapDomain_apply, Module.Basis.repr_reindex_apply] rfl apply congr · simp diff --git a/Physlib/Electromagnetism/Distributional/FieldStrength.lean b/Physlib/Electromagnetism/Distributional/FieldStrength.lean index 32f170483..375057078 100644 --- a/Physlib/Electromagnetism/Distributional/FieldStrength.lean +++ b/Physlib/Electromagnetism/Distributional/FieldStrength.lean @@ -131,8 +131,7 @@ lemma fieldStrengthAux_tensor_basis_eq_basis {d} (A : DistElectromagneticPotenti (b 0, b 1) := by rw [Tensorial.basis_toTensor_apply] rw [Tensorial.basis_map_prod] - simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Finsupp.mapDomain_equiv_apply, - Equiv.symm_symm, Fin.isValue] + simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Fin.isValue] rw [Lorentz.Vector.tensor_basis_map_eq_basis_reindex] have hb : (((Lorentz.Vector.basis (d := d)).reindex Lorentz.Vector.indexEquiv.symm).tensorProduct (Lorentz.Vector.basis.reindex Lorentz.Vector.indexEquiv.symm)) = @@ -143,7 +142,7 @@ lemma fieldStrengthAux_tensor_basis_eq_basis {d} (A : DistElectromagneticPotenti | ⟨i, j⟩ => simp rw [hb] - rw [Module.Basis.repr_reindex_apply] + rw [Finsupp.equivMapDomain_apply, Module.Basis.repr_reindex_apply] congr 1 lemma fieldStrengthAux_basis_repr_apply {d} {μν : (Fin 1 ⊕ Fin d) × (Fin 1 ⊕ Fin d)} diff --git a/Physlib/Electromagnetism/Kinematics/EMPotential.lean b/Physlib/Electromagnetism/Kinematics/EMPotential.lean index 7310d262a..78e3f59b0 100644 --- a/Physlib/Electromagnetism/Kinematics/EMPotential.lean +++ b/Physlib/Electromagnetism/Kinematics/EMPotential.lean @@ -643,8 +643,7 @@ lemma toTensor_deriv_basis_repr_apply {d} (A : ElectromagneticPotential d) (Tensor.basis _).repr (Tensorial.toTensor (deriv A x)) b = ∂_ (b 0) A x (b 1) := by rw [Tensorial.basis_toTensor_apply, Tensorial.basis_map_prod] - simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Finsupp.mapDomain_equiv_apply, - Equiv.symm_symm, Fin.isValue] + simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Fin.isValue] rw [Lorentz.Vector.tensor_basis_map_eq_basis_reindex, Lorentz.CoVector.tensor_basis_map_eq_basis_reindex] have hb : (((Lorentz.CoVector.basis (d := d)).reindex @@ -654,7 +653,7 @@ lemma toTensor_deriv_basis_repr_apply {d} (A : ElectromagneticPotential d) (Lorentz.CoVector.indexEquiv.symm.prodCongr Lorentz.Vector.indexEquiv.symm) := by ext ⟨i, j⟩ simp - rw [hb, Module.Basis.repr_reindex_apply, deriv_basis_repr_apply] + rw [hb, Finsupp.equivMapDomain_apply, Module.Basis.repr_reindex_apply, deriv_basis_repr_apply] rfl /-! diff --git a/Physlib/Electromagnetism/Kinematics/FieldStrength.lean b/Physlib/Electromagnetism/Kinematics/FieldStrength.lean index 5124eedcb..a55f126e8 100644 --- a/Physlib/Electromagnetism/Kinematics/FieldStrength.lean +++ b/Physlib/Electromagnetism/Kinematics/FieldStrength.lean @@ -160,7 +160,7 @@ lemma toFieldStrength_eq_sum_basis {d} {A : ElectromagneticPotential d} Vector.basis_eq_map_tensor_basis, toFieldStrength_eq_sub_tensorDeriv hA, ← deriv_eq_tensorDeriv _ hA, map_sub, Basis.repr_reindex, Basis.map_repr, LinearEquiv.symm_symm, LinearEquiv.trans_apply, LinearEquiv.apply_symm_apply, - Finsupp.coe_sub, Pi.sub_apply, Finsupp.mapDomain_equiv_apply, permT_basis_repr_symm_apply, + Finsupp.coe_sub, Pi.sub_apply, Finsupp.equivMapDomain_apply, permT_basis_repr_symm_apply, Function.comp_apply, contrT_basis_repr_apply_eq_fin, prodT_basis_repr_apply, contrMetric_repr_apply_eq_minkowskiMatrix, prod_tensor_basis_eq_map_reindex CoVector.basis_eq_map_tensor_basis @@ -367,8 +367,7 @@ lemma toFieldStrength_eval_equivariant {d} (A : ElectromagneticPotential d) simp only [Vector.toField_eval_eval_eq_tensorProduct_repr] rw [toFieldStrength_equivariant A Λ hf x] generalize A.toFieldStrength (Λ⁻¹ • x) = F - induction F using TensorProduct.induction_on with - | zero => simp + induction F using TensorProduct.inductionOn with | tmul v w => rw [Tensorial.smul_prod] simp only [Basis.tensorProduct_repr_tmul_apply, Lorentz.Vector.basis_repr_apply, smul_eq_mul] diff --git a/Physlib/Electromagnetism/Kinematics/GaugeTransformation.lean b/Physlib/Electromagnetism/Kinematics/GaugeTransformation.lean index b386d480a..07a6c5e16 100644 --- a/Physlib/Electromagnetism/Kinematics/GaugeTransformation.lean +++ b/Physlib/Electromagnetism/Kinematics/GaugeTransformation.lean @@ -378,7 +378,7 @@ lemma toFieldStrength_eval_bareGradient_inl_inr {d : ℕ} (i : Fin d) simp_rw [hfderiv] simp only [_root_.add_apply, FunLike.coe_smul, Pi.smul_apply, Lorentz.Vector.coordCLM_apply, smul_eq_mul, Lorentz.Vector.basis_apply] - simp only [mul_ite, mul_one, mul_zero, ite_add, zero_add, if_true] + simp only [mul_ite, mul_one, mul_zero, ite_add, zero_add, ite_true] simp only [minkowskiMatrix.inl_0_inl_0, minkowskiMatrix.inr_i_inr_i] simp only [reduceCtorEq, ↓reduceIte, add_zero] simp only [Lorentz.Vector.fderiv_coord, Lorentz.Vector.coordCLM_apply, diff --git a/Physlib/Mathematics/Calculus/Wirtinger/Coordinate.lean b/Physlib/Mathematics/Calculus/Wirtinger/Coordinate.lean index 53f060eea..77e67ffdf 100644 --- a/Physlib/Mathematics/Calculus/Wirtinger/Coordinate.lean +++ b/Physlib/Mathematics/Calculus/Wirtinger/Coordinate.lean @@ -270,7 +270,7 @@ coordinate-difference rule `dWirtingerCoord_coordDiff` and the conjugate-coordin funext u rw [dWirtingerCoord_apply I, fderiv_coordProj, fderiv_coordProj] by_cases h : I = J - · subst h; rw [Pi.single_eq_same, Pi.single_eq_same, if_pos rfl, Complex.I_mul_I]; ring + · subst h; rw [Pi.single_eq_same, Pi.single_eq_same, ite_eq_left rfl, Complex.I_mul_I]; ring · simp [h] /-- Pointwise additivity of the holomorphic coordinate derivative at `u`: diff --git a/Physlib/Mathematics/CrossProduct.lean b/Physlib/Mathematics/CrossProduct.lean index 9aaf60ba1..185aa890c 100644 --- a/Physlib/Mathematics/CrossProduct.lean +++ b/Physlib/Mathematics/CrossProduct.lean @@ -7,7 +7,7 @@ module public import Mathlib.Analysis.Calculus.ContDiff.Operations public import Mathlib.Data.Matrix.Mul -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.LinearAlgebra.CrossProduct /-! diff --git a/Physlib/Mathematics/CrossProductMatrix.lean b/Physlib/Mathematics/CrossProductMatrix.lean index 898d612eb..e48a8c101 100644 --- a/Physlib/Mathematics/CrossProductMatrix.lean +++ b/Physlib/Mathematics/CrossProductMatrix.lean @@ -6,7 +6,7 @@ Authors: Giuseppe Sorge module public import Mathlib.Data.Matrix.Mul -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.LinearAlgebra.CrossProduct public import Mathlib.LinearAlgebra.Matrix.Notation /-! diff --git a/Physlib/Mathematics/DataStructures/Matrix/LieTrace.lean b/Physlib/Mathematics/DataStructures/Matrix/LieTrace.lean index 537f4b33c..c2b36501b 100644 --- a/Physlib/Mathematics/DataStructures/Matrix/LieTrace.lean +++ b/Physlib/Mathematics/DataStructures/Matrix/LieTrace.lean @@ -60,9 +60,9 @@ lemma matrix_tsum_apply have h := Pi.summable.1 hf exact h i have h₁ : ((∑' n, f n) : Matrix m m 𝕂) i = (∑' n, (f n) i) := by - exact tsum_apply hf + exact Pi.tsum_apply hf have h₂ : ((∑' n, (f n) i) : m → 𝕂) j = (∑' n, (f n) i j) := by - exact tsum_apply h_row_summable + exact Pi.tsum_apply h_row_summable rw [h₁, h₂] variable [Fintype m] [LinearOrder m] diff --git a/Physlib/Mathematics/Distribution/Basic.lean b/Physlib/Mathematics/Distribution/Basic.lean index 80cbd1a01..92b7a0b20 100644 --- a/Physlib/Mathematics/Distribution/Basic.lean +++ b/Physlib/Mathematics/Distribution/Basic.lean @@ -476,8 +476,10 @@ private lemma lipschitzWith_integral_of_le {μ ρ : Measure E} (hμρ : μ ≤ MeasureTheory.norm_integral_le_lintegral_norm (μ := μ) (fun x => f x - g x) _ ≤ (eLpNorm (fun x => f x - g x) 1 ρ).toReal := by refine ENNReal.toReal_mono hfg_top ?_ - simpa [eLpNorm_one_eq_lintegral_enorm] using - eLpNorm_mono_measure (p := (1 : ℝ≥0∞)) (fun x => f x - g x) hμρ + have hfg_meas : AEStronglyMeasurable (fun x => f x - g x) μ := + (hfμ.sub hgμ).aestronglyMeasurable + rw [← eLpNorm_one_eq_lintegral_enorm hfg_meas] + exact eLpNorm_mono_measure (p := (1 : ℝ≥0∞)) (fun x => f x - g x) hμρ _ = ‖f - g‖ := by rw [Lp.norm_def, eLpNorm_congr_ae hfg_ae] private lemma integral_boundedContinuous_eq_of_forall_schwartz_integral_eq diff --git a/Physlib/Mathematics/Fin.lean b/Physlib/Mathematics/Fin.lean index d78163ead..5aaa564d9 100644 --- a/Physlib/Mathematics/Fin.lean +++ b/Physlib/Mathematics/Fin.lean @@ -114,7 +114,7 @@ lemma finExtractOne_symm_inr {n : ℕ} (i : Fin n.succ) : · rfl rename_i hn simp_all only [Nat.succ_eq_add_one, not_lt, Fin.le_def, Fin.val_castSucc, Fin.val_succ, - left_eq_add, one_ne_zero] + left_eq_add] omega · generalize_proofs hp have h1 : (finSumFinEquiv.symm (Fin.cast hp x)) = diff --git a/Physlib/Mathematics/Fin/Involutions.lean b/Physlib/Mathematics/Fin/Involutions.lean index c65067e45..bb4e123b3 100644 --- a/Physlib/Mathematics/Fin/Involutions.lean +++ b/Physlib/Mathematics/Fin/Involutions.lean @@ -64,12 +64,12 @@ def involutionCons (n : ℕ) : {f : Fin n.succ → Fin n.succ // Function.Involu by_cases hja : j = a · subst hja simp - · rw [Function.update_apply, if_neg hja] + · rw [Function.update_apply, ite_eq_right hja] simp only [Function.comp_apply, Fin.cons_succ] have hf2 := f.2.2 hs change f.1.1 a = a at hf2 have hjf1 : f.1.1 j ≠ a := fun hn => hja (by rw [← f.1.2 j, hn, hf2]) - rw [Function.update_apply, if_neg hjf1] + rw [Function.update_apply, ite_eq_right hjf1] simp only [Function.comp_apply, Fin.succ_inj] rw [f.1.2] · simp only [succ_eq_add_one, hs, Bool.false_eq_true, ↓reduceDIte] @@ -85,7 +85,7 @@ def involutionCons (n : ℕ) : {f : Fin n.succ → Fin n.succ // Function.Involu | ⟨f, hf⟩ => have hpred (j : Fin n) (hj : f j.succ ≠ 0) : (↑(if h : f j.succ = 0 then j else (f j.succ).pred h) + 1 : ℕ) = ↑(f j.succ) := by - rw [dif_neg hj, Fin.val_pred] + rw [dite_eq_right hj, Fin.val_pred] have hv : (f j.succ).val ≠ 0 := fun h => hj (Fin.ext (by simpa using h)) omega simp only [succ_eq_add_one, Option.isSome_dite', Option.get_dite', Fin.succ_pred, @@ -99,13 +99,13 @@ def involutionCons (n : ℕ) : {f : Fin n.succ → Fin n.succ // Function.Involu · subst hj simp only [Fin.cons_succ, Function.comp_apply, Fin.val_succ] refine hpred j fun hj => Fin.succ_ne_zero j (hf.injective (hj.trans h0.symm)) - · rw [if_neg h0] + · rw [ite_eq_right h0] by_cases hf' : i = f 0 · subst hf' simp only [Function.update_self, Fin.val_zero] rw [hf] simp - · rw [Function.update_apply, if_neg hf'] + · rw [Function.update_apply, ite_eq_right hf'] rcases Fin.eq_zero_or_eq_succ i with hi | ⟨j, hj⟩ · subst hi simp @@ -125,10 +125,10 @@ def involutionCons (n : ℕ) : {f : Fin n.succ → Fin n.succ // Function.Involu exact Eq.symm (Fin.val_eq_of_eq (hf0 hs)) · simp only [ne_eq, Fin.succ_inj, hi, not_false_eq_true, Function.update_of_ne, Fin.cons_succ, Function.comp_apply, Fin.pred_succ, dite_eq_ite] - rw [if_neg (Fin.succ_ne_zero (f i))] + rw [ite_eq_right (Fin.succ_ne_zero (f i))] · simp only [hs, Bool.false_eq_true, ↓reduceDIte, Fin.cons_succ, Function.comp_apply, Fin.pred_succ, dite_eq_ite] - rw [if_neg (Fin.succ_ne_zero (f i))] + rw [ite_eq_right (Fin.succ_ne_zero (f i))] · simp only [Nat.succ_eq_add_one, Option.dite_none_left_eq_some, Option.some.injEq] by_cases hs : f0.isSome · simp only [hs, ↓reduceDIte] @@ -193,7 +193,7 @@ lemma involutionAddEquiv_none_image_zero {n : ℕ} : by_contra hf0 simp only [Fin.zero_eta] at hf0 simp only [succ_eq_add_one, involutionCons, Equiv.coe_fn_mk, involutionAddEquiv, - Option.isSome_some, Option.get_some, Option.isSome_none, dif_neg hf0] at h + Option.isSome_some, Option.get_some, Option.isSome_none, dite_eq_right hf0] at h exact absurd h (Option.some_ne_none _) lemma involutionAddEquiv_cast {n : ℕ} {f1 f2 : {f : Fin n → Fin n // Function.Involutive f}} diff --git a/Physlib/Mathematics/KroneckerDelta/Basic.lean b/Physlib/Mathematics/KroneckerDelta/Basic.lean index c4ef1e23a..5c639f805 100644 --- a/Physlib/Mathematics/KroneckerDelta/Basic.lean +++ b/Physlib/Mathematics/KroneckerDelta/Basic.lean @@ -58,9 +58,9 @@ def kroneckerDelta (i j : α) : ℕ := if i = j then 1 else 0 notation "δ[" i "," j "]" => kroneckerDelta i j @[simp] -lemma eq_one_of_same (i : α) : δ[i,i] = 1 := if_pos rfl +lemma eq_one_of_same (i : α) : δ[i,i] = 1 := ite_eq_left rfl -lemma eq_zero_of_ne {i j : α} (h : i ≠ j) : δ[i,j] = 0 := if_neg h +lemma eq_zero_of_ne {i j : α} (h : i ≠ j) : δ[i,j] = 0 := ite_eq_right h @[simp] lemma eq_of_coe {p : α → Prop} (i j : Subtype p) : δ[(i : α),j] = δ[i,j] := by diff --git a/Physlib/Mathematics/LinearPMap.lean b/Physlib/Mathematics/LinearPMap.lean index c28b8e207..a35b7df53 100644 --- a/Physlib/Mathematics/LinearPMap.lean +++ b/Physlib/Mathematics/LinearPMap.lean @@ -357,25 +357,31 @@ end Monoid section Inverses +/-- The kernel of `f.toFun` is trivial exactly when the kernel of `f` is. -/ +lemma toFun_ker_eq_bot_iff {f : E →ₗ.[R] F} : f.toFun.ker = ⊥ ↔ f.ker = ⊥ := by + rw [LinearMap.ker_eq_bot', LinearPMap.ker_eq_bot'] + rfl + variable {f : E →ₗ.[R] F} (h_ker : f.toFun.ker = ⊥) include h_ker lemma inverse_ker : f.inverse.toFun.ker = ⊥ := by refine LinearMap.ker_eq_bot'.mpr fun ⟨y, hy⟩ hy' ↦ ?_ obtain ⟨x, hx⟩ := inverse_domain (f := f) ▸ hy - simp_all [inverse_apply_eq (x := x) (y := ⟨y, hy⟩) h_ker hx] + simp_all [inverse_apply_eq (x := x) (y := ⟨y, hy⟩) (toFun_ker_eq_bot_iff.mp h_ker) hx] lemma inverse_inverse : f.inverse.inverse = f := by ext x hx hx' - · rw [inverse_domain, inverse_range h_ker] + · rw [inverse_domain, inverse_range (toFun_ker_eq_bot_iff.mp h_ker)] · refine inverse_apply_eq (y := ⟨x, hx⟩) (x := ⟨f ⟨x, hx'⟩, by simp [inverse_domain]⟩) ?_ ?_ - · exact inverse_ker h_ker - · exact inverse_apply_eq (y := ⟨f ⟨x, hx'⟩, by simp [inverse_domain]⟩) (x := ⟨x, hx'⟩) h_ker rfl + · exact toFun_ker_eq_bot_iff.mp (inverse_ker h_ker) + · exact inverse_apply_eq (y := ⟨f ⟨x, hx'⟩, by simp [inverse_domain]⟩) (x := ⟨x, hx'⟩) + (toFun_ker_eq_bot_iff.mp h_ker) rfl lemma inverse_compRestricted_eq : f.inverse ∘ᵣ f = domRestrict 1 f.domain := by ext x hx hx' - · simp [mem_compRestricted_domain_iff, inverse_domain, ← toFun_eq_coe] - · exact inverse_apply_eq (x := ⟨x, hx.2⟩) h_ker rfl + · simp [mem_compRestricted_domain_iff, inverse_domain, ← toFun_eq_coe, -coe_toFun_eq_coe] + · exact inverse_apply_eq (x := ⟨x, hx.2⟩) (toFun_ker_eq_bot_iff.mp h_ker) rfl lemma compRestricted_inverse_eq : f ∘ᵣ f.inverse = domRestrict 1 f.inverse.domain := by nth_rw 1 [← inverse_inverse h_ker] diff --git a/Physlib/Mathematics/List.lean b/Physlib/Mathematics/List.lean index 741ef44a0..717c41056 100644 --- a/Physlib/Mathematics/List.lean +++ b/Physlib/Mathematics/List.lean @@ -287,7 +287,7 @@ lemma orderedInsert_eraseIdx_orderedInsertPos_le {I : Type} (le1 : I → I → P omega rw [hn] simp only [List.eraseIdx_cons_succ, List.cons.injEq, true_and] - rw [dropWile_eraseIdx, if_pos] + rw [dropWile_eraseIdx, ite_eq_left] · rw [orderedInsertPos] at hi omega · exact hr @@ -467,7 +467,7 @@ lemma orderedInsert_eq_insertIdx_orderedInsertPos {I : Type} (le1 : I → I → apply List.ext_get · simp only [List.orderedInsert_length] rw [List.length_insertIdx] - exact (if_pos (Nat.le_of_succ_le_succ (orderedInsertPos_lt_length le1 r r0))).symm + exact (ite_eq_left (Nat.le_of_succ_le_succ (orderedInsertPos_lt_length le1 r r0))).symm intro n h1 h2 obtain ⟨n', hn'⟩ := (orderedInsertEquiv le1 r r0).surjective ⟨n, h1⟩ rw [← hn'] @@ -730,7 +730,7 @@ lemma mem_take_finrange : (n m : ℕ) → (a : Fin n) → a ∈ List.take m (Lis simp [List.finRange_succ] | n +1, m + 1, ⟨i + 1, h⟩ => by simp only [List.finRange_succ, List.take_succ_cons, List.mem_cons, Fin.ext_iff, Fin.val_zero, - AddLeftCancelMonoid.add_eq_zero, one_ne_zero, and_false, false_or, add_lt_add_iff_right] + Nat.add_eq_zero_iff, one_ne_zero, and_false, false_or, add_lt_add_iff_right] rw [← List.map_take, @List.mem_map] apply Iff.intro · intro h diff --git a/Physlib/Mathematics/List/InsertionSort.lean b/Physlib/Mathematics/List/InsertionSort.lean index 0eda43b81..aa9145772 100644 --- a/Physlib/Mathematics/List/InsertionSort.lean +++ b/Physlib/Mathematics/List/InsertionSort.lean @@ -102,7 +102,7 @@ lemma orderedInsert_commute {α : Type} (r : α → α → Prop) [DecidableRel r simp only [List.orderedInsert] by_cases h : r a c · simp only [h, ↓reduceIte, List.orderedInsert.eq_2, hrb] - rw [if_pos (IsTrans.trans (r := r) _ _ _ hrb h)] + rw [ite_eq_left (IsTrans.trans (r := r) _ _ _ hrb h)] simp only [List.orderedInsert, hr, ↓reduceIte, h] · simp only [h, ↓reduceIte, List.orderedInsert.eq_2] by_cases hbc : r b c diff --git a/Physlib/Mathematics/SO3/Basic.lean b/Physlib/Mathematics/SO3/Basic.lean index 47e4440cc..1eb177581 100644 --- a/Physlib/Mathematics/SO3/Basic.lean +++ b/Physlib/Mathematics/SO3/Basic.lean @@ -7,6 +7,7 @@ module public import Mathlib.LinearAlgebra.Eigenspace.Basic public import Mathlib.Analysis.InnerProductSpace.PiL2 +public import Mathlib.Topology.Algebra.Group.Units /-! # The group SO(3) @@ -109,7 +110,7 @@ lemma toGL_embedding : IsEmbedding toGL.toFun where /-- The instance of a topological group on `SO(3)`, defined through the embedding of `SO(3)` into `GL(n)`. -/ instance : IsTopologicalGroup SO(3) := - IsInducing.topologicalGroup toGL toGL_embedding.toIsInducing + IsInducing.isTopologicalGroup toGL toGL_embedding.toIsInducing /-- The determinant of an `SO(3)` matrix minus the identity is equal to zero. -/ lemma det_minus_id (A : SO(3)) : det (A.1 - 1) = 0 := by diff --git a/Physlib/Mathematics/SchurTriangulation.lean b/Physlib/Mathematics/SchurTriangulation.lean index cbb05dade..3620babde 100644 --- a/Physlib/Mathematics/SchurTriangulation.lean +++ b/Physlib/Mathematics/SchurTriangulation.lean @@ -167,11 +167,11 @@ protected noncomputable def SchurTriangulationAux.of | ⟨true, i⟩ => show bE ⟨true, i⟩ = bV i from show (int.collectedBasis fun b => (B b).toBasis).toOrthonormalBasis _ ⟨true, i⟩ = bV i by simp only [Basis.coe_toOrthonormalBasis, DirectSum.IsInternal.collectedBasis_coe, - cond_true, OrthonormalBasis.coe_toBasis, B, V, W] + Bool.cond_true, OrthonormalBasis.coe_toBasis, B, V, W] | ⟨false, j⟩ => show bE ⟨false, j⟩ = bW j from show (int.collectedBasis fun b => (B b).toBasis).toOrthonormalBasis _ ⟨false, j⟩ = bW j by simp only [Basis.coe_toOrthonormalBasis, DirectSum.IsInternal.collectedBasis_coe, - cond_false, OrthonormalBasis.coe_toBasis, B, V, W] + Bool.cond_false, OrthonormalBasis.coe_toBasis, B, V, W] have hf {bi i' bj j'} (hi : e i = ⟨bi, i'⟩) (hj : e j = ⟨bj, j'⟩) := calc toMatrixOrthonormal basis f i j _ = toMatrixOrthonormal bE f (e i) (e j) := by diff --git a/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/FamilyMaps.lean b/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/FamilyMaps.lean index 2b79906aa..6a6a22f0a 100644 --- a/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/FamilyMaps.lean +++ b/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/FamilyMaps.lean @@ -69,16 +69,16 @@ def speciesEmbed (m n : ℕ) : funext i simp only [ACCSystemCharges.chargesAddCommMonoid_add] by_cases hi : i.val < m - · rw [dif_pos hi, dif_pos hi, dif_pos hi] - · rw [dif_neg hi, dif_neg hi, dif_neg hi] + · rw [dite_eq_left hi, dite_eq_left hi, dite_eq_left hi] + · rw [dite_eq_right hi, dite_eq_right hi, dite_eq_right hi] with_unfolding_all rfl map_smul' a S := by funext i simp only [HSMul.hSMul, ACCSystemCharges.chargesModule_smul, eq_ratCast, Rat.cast_eq_id, id_eq] by_cases hi : i.val < m - · rw [dif_pos hi, dif_pos hi] - · rw [dif_neg hi, dif_neg hi] + · rw [dite_eq_left hi, dite_eq_left hi] + · rw [dite_eq_right hi, dite_eq_right hi] exact Eq.symm (Rat.mul_zero a) /-- The embedding of the `m`-family charges onto the `n`-family charges, with all diff --git a/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSol.lean b/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSol.lean index 7aac19a8c..972f0054f 100644 --- a/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSol.lean +++ b/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSol.lean @@ -119,21 +119,21 @@ lemma toQuadInv_special (S : (PlusU1 n).QuadSols) (h : α₁ C S.1 = 0) : specialToQuad C (toQuadInv C S).1 (toQuadInv C S).2.1 (toQuadInv C S).2.2 ((toQuadInv_α₁_α₂ C S).mp h).1 ((toQuadInv_α₁_α₂ C S).mp h).2 = S := by simp only [toQuadInv_fst] - rw [show (toQuadInv C S).2.1 = 1 by rw [toQuadInv, if_pos h], - show (toQuadInv C S).2.2 = 0 by rw [toQuadInv, if_pos h], special_on_quad] + rw [show (toQuadInv C S).2.1 = 1 by rw [toQuadInv, ite_eq_left h], + show (toQuadInv C S).2.2 = 0 by rw [toQuadInv, ite_eq_left h], special_on_quad] lemma toQuadInv_generic (S : (PlusU1 n).QuadSols) (h : α₁ C S.1 ≠ 0) : (toQuadInv C S).2.1 • genericToQuad C (toQuadInv C S).1 = S := by simp only [toQuadInv_fst] - rw [show (toQuadInv C S).2.1 = (α₁ C S.1)⁻¹ by rw [toQuadInv, if_neg h], + rw [show (toQuadInv C S).2.1 = (α₁ C S.1)⁻¹ by rw [toQuadInv, ite_eq_right h], genericToQuad_ne_zero C S h] lemma toQuad_rightInverse : Function.RightInverse (@toQuadInv n C) (toQuad C) := by intro S by_cases h : α₁ C S.1 = 0 - · rw [toQuad, dif_pos ((toQuadInv_α₁_α₂ C S).mp h)] + · rw [toQuad, dite_eq_left ((toQuadInv_α₁_α₂ C S).mp h)] exact toQuadInv_special C S h - · rw [toQuad, dif_neg ((toQuadInv_α₁_α₂ C S).mpr.mt h)] + · rw [toQuad, dite_eq_right ((toQuadInv_α₁_α₂ C S).mpr.mt h)] exact toQuadInv_generic C S h theorem toQuad_surjective : Function.Surjective (toQuad C) := diff --git a/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSolToSol.lean b/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSolToSol.lean index bfe589ce2..69c90bdf6 100644 --- a/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSolToSol.lean +++ b/Physlib/Particles/BeyondTheStandardModel/RHN/AnomalyCancellation/PlusU1/QuadSolToSol.lean @@ -121,22 +121,22 @@ lemma quadSolToSolInv_special (S : (PlusU1 n).Sols) (h : α₁ S.1 = 0) : special (quadSolToSolInv S).1 (quadSolToSolInv S).2.1 (quadSolToSolInv S).2.2 (quadSolToSolInv_α₁_α₂_zero S h).1 (quadSolToSolInv_α₁_α₂_zero S h).2 = S := by simp only [quadSolToSolInv_1] - rw [show (quadSolToSolInv S).2.1 = 1 by rw [quadSolToSolInv, if_pos h]] - rw [show (quadSolToSolInv S).2.2 = 0 by rw [quadSolToSolInv, if_pos h]] + rw [show (quadSolToSolInv S).2.1 = 1 by rw [quadSolToSolInv, ite_eq_left h]] + rw [show (quadSolToSolInv S).2.2 = 0 by rw [quadSolToSolInv, ite_eq_left h]] rw [special_on_AF] lemma quadSolToSolInv_generic (S : (PlusU1 n).Sols) (h : α₁ S.1 ≠ 0) : (quadSolToSolInv S).2.1 • generic (quadSolToSolInv S).1 = S := by simp only [quadSolToSolInv_1] - rw [show (quadSolToSolInv S).2.1 = (α₁ S.1)⁻¹ by rw [quadSolToSolInv, if_neg h]] + rw [show (quadSolToSolInv S).2.1 = (α₁ S.1)⁻¹ by rw [quadSolToSolInv, ite_eq_right h]] rw [generic_on_AF_α₁_ne_zero S h] lemma quadSolToSolInv_rightInverse : Function.RightInverse (@quadSolToSolInv n) quadSolToSol := by intro S by_cases h : α₁ S.1 = 0 - · rw [quadSolToSol, dif_pos (quadSolToSolInv_α₁_α₂_zero S h)] + · rw [quadSolToSol, dite_eq_left (quadSolToSolInv_α₁_α₂_zero S h)] exact quadSolToSolInv_special S h - · rw [quadSolToSol, dif_neg (quadSolToSolInv_α₁_α₂_ne_zero S h)] + · rw [quadSolToSol, dite_eq_right (quadSolToSolInv_α₁_α₂_ne_zero S h)] exact quadSolToSolInv_generic S h theorem quadSolToSol_surjective : Function.Surjective (@quadSolToSol n) := diff --git a/Physlib/Particles/FlavorPhysics/CKMMatrix/StandardParameterization/StandardParameters.lean b/Physlib/Particles/FlavorPhysics/CKMMatrix/StandardParameterization/StandardParameters.lean index fd28c332b..baec2a4fc 100644 --- a/Physlib/Particles/FlavorPhysics/CKMMatrix/StandardParameterization/StandardParameters.lean +++ b/Physlib/Particles/FlavorPhysics/CKMMatrix/StandardParameterization/StandardParameters.lean @@ -144,11 +144,11 @@ lemma S₁₂_of_Vub_one {V : Quotient CKMMatrixSetoid} (ha : VubAbs V = 1) : S lemma S₁₃_of_Vub_one {V : Quotient CKMMatrixSetoid} (ha : VubAbs V = 1) : S₁₃ V = 1 := ha lemma S₂₃_of_Vub_eq_one {V : Quotient CKMMatrixSetoid} (ha : VubAbs V = 1) : S₂₃ V = VcdAbs V := by - rw [S₂₃, if_pos ha] + rw [S₂₃, ite_eq_left ha] lemma S₂₃_of_Vub_ne_one {V : Quotient CKMMatrixSetoid} (ha : VubAbs V ≠ 1) : S₂₃ V = VcbAbs V / √ (VudAbs V ^ 2 + VusAbs V ^ 2) := by - rw [S₂₃, if_neg ha] + rw [S₂₃, ite_eq_right ha] end sines diff --git a/Physlib/Particles/StandardModel/AnomalyCancellation/FamilyMaps.lean b/Physlib/Particles/StandardModel/AnomalyCancellation/FamilyMaps.lean index 0ab7eb238..6ba2f01e0 100644 --- a/Physlib/Particles/StandardModel/AnomalyCancellation/FamilyMaps.lean +++ b/Physlib/Particles/StandardModel/AnomalyCancellation/FamilyMaps.lean @@ -67,15 +67,15 @@ def speciesEmbed (m n : ℕ) : funext i simp only [ACCSystemCharges.chargesAddCommMonoid_add] by_cases hi : i.val < m - · rw [dif_pos hi, dif_pos hi, dif_pos hi] - · rw [dif_neg hi, dif_neg hi, dif_neg hi] + · rw [dite_eq_left hi, dite_eq_left hi, dite_eq_left hi] + · rw [dite_eq_right hi, dite_eq_right hi, dite_eq_right hi] with_unfolding_all rfl map_smul' a S := by funext i simp only [HSMul.hSMul, ACCSystemCharges.chargesModule_smul, eq_ratCast, Rat.cast_eq_id, id_eq] by_cases hi : i.val < m - · rw [dif_pos hi, dif_pos hi] - · rw [dif_neg hi, dif_neg hi] + · rw [dite_eq_left hi, dite_eq_left hi] + · rw [dite_eq_right hi, dite_eq_right hi] exact Eq.symm (Rat.mul_zero a) /-- The embedding of the `m`-family charges onto the `n`-family charges, with all diff --git a/Physlib/Particles/StandardModel/Fermions/DownSinglet.lean b/Physlib/Particles/StandardModel/Fermions/DownSinglet.lean index 246f2ed65..49603c4b4 100644 --- a/Physlib/Particles/StandardModel/Fermions/DownSinglet.lean +++ b/Physlib/Particles/StandardModel/Fermions/DownSinglet.lean @@ -83,7 +83,7 @@ def valEquiv : DownSinglet ≃ Fermion.RightHandedWeyl ⊗[ℂ] EuclideanSpace instance : AddCommGroup DownSinglet := Equiv.addCommGroup valEquiv -instance : Module ℂ DownSinglet := Equiv.module ℂ valEquiv +instance : Module ℂ DownSinglet := AddEquiv.module ℂ { valEquiv with map_add' _ _ := rfl } /-- The linear identification with the underlying tensor product. -/ def valLinEquiv : DownSinglet ≃ₗ[ℂ] diff --git a/Physlib/Particles/StandardModel/Fermions/LeptonDoublet.lean b/Physlib/Particles/StandardModel/Fermions/LeptonDoublet.lean index 1c85c5e09..050ce49dd 100644 --- a/Physlib/Particles/StandardModel/Fermions/LeptonDoublet.lean +++ b/Physlib/Particles/StandardModel/Fermions/LeptonDoublet.lean @@ -84,7 +84,7 @@ def valEquiv : LeptonDoublet ≃ Fermion.LeftHandedWeyl ⊗[ℂ] EuclideanSpace instance : AddCommGroup LeptonDoublet := Equiv.addCommGroup valEquiv -instance : Module ℂ LeptonDoublet := Equiv.module ℂ valEquiv +instance : Module ℂ LeptonDoublet := AddEquiv.module ℂ { valEquiv with map_add' _ _ := rfl } /-- The linear identification with the underlying tensor product. -/ def valLinEquiv : LeptonDoublet ≃ₗ[ℂ] diff --git a/Physlib/Particles/StandardModel/Fermions/LeptonSinglet.lean b/Physlib/Particles/StandardModel/Fermions/LeptonSinglet.lean index 85ccb50e6..6a83165ac 100644 --- a/Physlib/Particles/StandardModel/Fermions/LeptonSinglet.lean +++ b/Physlib/Particles/StandardModel/Fermions/LeptonSinglet.lean @@ -81,7 +81,7 @@ def valEquiv : LeptonSinglet ≃ Fermion.RightHandedWeyl where instance : AddCommGroup LeptonSinglet := Equiv.addCommGroup valEquiv -instance : Module ℂ LeptonSinglet := Equiv.module ℂ valEquiv +instance : Module ℂ LeptonSinglet := AddEquiv.module ℂ { valEquiv with map_add' _ _ := rfl } /-- The linear identification with the underlying Weyl-spinor space. -/ def valLinEquiv : LeptonSinglet ≃ₗ[ℂ] Fermion.RightHandedWeyl where diff --git a/Physlib/Particles/StandardModel/Fermions/QuarkDoublet.lean b/Physlib/Particles/StandardModel/Fermions/QuarkDoublet.lean index 953a4aefe..43de4ad8c 100644 --- a/Physlib/Particles/StandardModel/Fermions/QuarkDoublet.lean +++ b/Physlib/Particles/StandardModel/Fermions/QuarkDoublet.lean @@ -61,7 +61,7 @@ The AddCommGroup and module instances are inherited from the underlying tensor p instance : AddCommGroup QuarkDoublet := Equiv.addCommGroup valEquiv -instance : Module ℂ QuarkDoublet := Equiv.module ℂ valEquiv +instance : Module ℂ QuarkDoublet := AddEquiv.module ℂ { valEquiv with map_add' _ _ := rfl } /-- The linear equivalence between `QuarkDoublet` and its underlying tensor product space. -/ def valLinEquiv : QuarkDoublet ≃ₗ[ℂ] diff --git a/Physlib/Particles/StandardModel/Fermions/UpSinglet.lean b/Physlib/Particles/StandardModel/Fermions/UpSinglet.lean index 8fe9c0071..f2b1b1aa0 100644 --- a/Physlib/Particles/StandardModel/Fermions/UpSinglet.lean +++ b/Physlib/Particles/StandardModel/Fermions/UpSinglet.lean @@ -53,7 +53,7 @@ The AddCommGroup and module instances are inherited from the underlying tensor p instance : AddCommGroup UpSinglet := Equiv.addCommGroup valEquiv -instance : Module ℂ UpSinglet := Equiv.module ℂ valEquiv +instance : Module ℂ UpSinglet := AddEquiv.module ℂ { valEquiv with map_add' _ _ := rfl } /-- The linear equivalence between `UpSinglet` and its underlying tensor product space. -/ def valLinEquiv : UpSinglet ≃ₗ[ℂ] diff --git a/Physlib/Particles/StandardModel/HiggsBoson/EffectivePotential.lean b/Physlib/Particles/StandardModel/HiggsBoson/EffectivePotential.lean index 02a3bcd3f..6ad3c0fff 100644 --- a/Physlib/Particles/StandardModel/HiggsBoson/EffectivePotential.lean +++ b/Physlib/Particles/StandardModel/HiggsBoson/EffectivePotential.lean @@ -165,7 +165,7 @@ lemma termOfMassDim_isInvariant {V : EffectivePotential} {n : ℕ} (h : HasMaxMa have hcoeff := congrArg (fun p => p.coeff m) hp simpa only [Polynomial.finsetSum_coeff, Polynomial.coeff_C_mul, Polynomial.coeff_X_pow, mul_ite, mul_one, mul_zero, Finset.sum_ite_eq, Finset.mem_range, Nat.lt_succ_iff, hmn, - if_true, Polynomial.coeff_zero, sub_eq_zero] using hcoeff + ite_true, Polynomial.coeff_zero, sub_eq_zero] using hcoeff · rw [termOfMassDim_eq_zero_of_max_lt h (not_le.mp hmn), termOfMassDim_eq_zero_of_max_lt h (not_le.mp hmn)] diff --git a/Physlib/Particles/SuperSymmetry/N1/Basic.lean b/Physlib/Particles/SuperSymmetry/N1/Basic.lean index e36ed003b..5a0a147d7 100644 --- a/Physlib/Particles/SuperSymmetry/N1/Basic.lean +++ b/Physlib/Particles/SuperSymmetry/N1/Basic.lean @@ -5,7 +5,7 @@ Authors: Andrea Pari -/ module -public import Mathlib.Data.Complex.Basic +public import Mathlib.Basic.Complex.Basic public import Physlib.Relativity.Tensors.Conjugation.Basic /-! diff --git a/Physlib/QFT/PerturbationTheory/FieldSpecification/NormalOrder.lean b/Physlib/QFT/PerturbationTheory/FieldSpecification/NormalOrder.lean index 7ad2e23e2..b889ccf16 100644 --- a/Physlib/QFT/PerturbationTheory/FieldSpecification/NormalOrder.lean +++ b/Physlib/QFT/PerturbationTheory/FieldSpecification/NormalOrder.lean @@ -65,7 +65,7 @@ lemma koszulSignInsert_create (φ : 𝓕.CrAnFieldOp) | [] => rfl | φ' :: φs => by dsimp only [Wick.koszulSignInsert] - rw [if_pos] + rw [ite_eq_left] · exact koszulSignInsert_create φ hφ φs · dsimp only [normalOrderRel] rw [hφ] @@ -117,7 +117,7 @@ lemma koszulSignInsert_annihilate_cons_create (φc φa : 𝓕.CrAnFieldOp) rw [Wick.koszulSignInsert_cons] simp only [mul_eq_mul_right_iff] apply Or.inl - rw [Wick.koszulSignCons, if_neg, FieldStatistic.exchangeSign_symm, + rw [Wick.koszulSignCons, ite_eq_right, FieldStatistic.exchangeSign_symm, FieldStatistic.exchangeSign_eq_if] rw [normalOrderRel, hφa, hφc] simp [CreateAnnihilate.normalOrder] @@ -196,7 +196,7 @@ lemma normalOrderSign_swap_annihilate_annihilate_fst (φa φa' : 𝓕.CrAnFieldO rw [Wick.koszulSignInsert_cons, Wick.koszulSignInsert_cons, mul_assoc, mul_assoc] congr 1 · dsimp only [Wick.koszulSignCons] - rw [if_pos, if_pos] + rw [ite_eq_left, ite_eq_left] · simp [normalOrderRel, hφa, hφa', CreateAnnihilate.normalOrder] · simp [normalOrderRel, hφa, hφa', CreateAnnihilate.normalOrder] · rw [NonUnitalNormedCommRing.mul_comm] @@ -252,7 +252,7 @@ lemma orderedInsert_create (φ : 𝓕.CrAnFieldOp) | [] => rfl | φ' :: φs => by simp only [List.orderedInsert.eq_2] - rw [if_pos] + rw [ite_eq_left] dsimp only [normalOrderRel] rw [hφ] dsimp [CreateAnnihilate.normalOrder] @@ -375,7 +375,7 @@ lemma orderedInsert_createFilter_append_annihilate (φ : 𝓕.CrAnFieldOp) rcases CreateAnnihilate.eq_create_or_annihilate (𝓕 |>ᶜ φ') with hφ' | hφ' · rw [createFilter_cons_create hφ'] simp only [List.cons_append, List.orderedInsert.eq_2] - rw [if_neg, orderedInsert_createFilter_append_annihilate φ hφ φs φs'] + rw [ite_eq_right, orderedInsert_createFilter_append_annihilate φ hφ φs φs'] simp [normalOrderRel, hφ, hφ', CreateAnnihilate.normalOrder] · rw [createFilter_cons_annihilate hφ', orderedInsert_createFilter_append_annihilate φ hφ φs] @@ -388,7 +388,7 @@ lemma orderedInsert_annihilateFilter (φ : 𝓕.CrAnFieldOp) : (φs : List 𝓕. · rw [annihilateFilter_cons_create hφ', orderedInsert_annihilateFilter φ φs] · rw [annihilateFilter_cons_annihilate hφ'] simp only [List.orderedInsert.eq_2] - rw [if_pos] + rw [ite_eq_left] dsimp only [normalOrderRel] rw [hφ'] rcases CreateAnnihilate.eq_create_or_annihilate (𝓕 |>ᶜ φ) with hφ | hφ diff --git a/Physlib/QFT/PerturbationTheory/FieldStatistics/Basic.lean b/Physlib/QFT/PerturbationTheory/FieldStatistics/Basic.lean index dc32c1557..46fd97a58 100644 --- a/Physlib/QFT/PerturbationTheory/FieldStatistics/Basic.lean +++ b/Physlib/QFT/PerturbationTheory/FieldStatistics/Basic.lean @@ -238,7 +238,7 @@ lemma ofList_map_eq_finset_prod (s : 𝓕 → FieldStatistic) : simp only [List.length_cons, mul_ite, ite_mul, one_mul, mul_one] by_cases ha : a = i · simp only [ha, ↓reduceIte, mul_self, true_or] - rw [if_neg] + rw [ite_eq_right] rfl simp only [List.length_cons, List.nodup_cons] at hl exact hl.1 diff --git a/Physlib/QFT/PerturbationTheory/Koszul/KoszulSignInsert.lean b/Physlib/QFT/PerturbationTheory/Koszul/KoszulSignInsert.lean index d71545cdd..871de85e5 100644 --- a/Physlib/QFT/PerturbationTheory/Koszul/KoszulSignInsert.lean +++ b/Physlib/QFT/PerturbationTheory/Koszul/KoszulSignInsert.lean @@ -76,8 +76,8 @@ lemma koszulSignInsert_ge_forall_append (φs : List 𝓕) (φ' φ : 𝓕) (hi : | cons φ'' φs ih => simp only [koszulSignInsert, List.cons_append] by_cases hr : le φ' φ'' - · rw [if_pos hr, if_pos hr, ih] - · rw [if_neg hr, if_neg hr, ih] + · rw [ite_eq_left hr, ite_eq_left hr, ih] + · rw [ite_eq_right hr, ite_eq_right hr, ih] lemma koszulSignInsert_eq_filter (φ : 𝓕) : (φs : List 𝓕) → koszulSignInsert q le φ φs = @@ -119,7 +119,7 @@ lemma koszulSignInsert_eq_grade (φ : 𝓕) (φs : List 𝓕) : by_cases hr1 : ¬ le φ φ1 · rw [List.filter_cons_of_pos] · dsimp only [koszulSignInsert, Fin.isValue, decide_not] - rw [if_neg hr1] + rw [ite_eq_right hr1] dsimp only [Fin.isValue, ofList, ite_eq_right_iff, zero_ne_one, imp_false, decide_not] simp only [decide_not, ite_eq_right_iff, reduceCtorEq, imp_false] have ha (a b c : FieldStatistic) : (if a = fermionic ∧ b = fermionic then -if ¬a = bosonic ∧ @@ -246,7 +246,7 @@ lemma koszulSignInsert_of_le_mem (φ0 : 𝓕) : (φs : List 𝓕) → (h : ∀ b simp [koszulSignInsert] | φ1 :: φs, h => by simp only [koszulSignInsert] - rw [if_pos] + rw [ite_eq_left] · apply koszulSignInsert_of_le_mem · intro b hb exact h b (List.mem_cons_of_mem _ hb) diff --git a/Physlib/QFT/PerturbationTheory/WickContraction/Basic.lean b/Physlib/QFT/PerturbationTheory/WickContraction/Basic.lean index a5fffc6db..1465e14ef 100644 --- a/Physlib/QFT/PerturbationTheory/WickContraction/Basic.lean +++ b/Physlib/QFT/PerturbationTheory/WickContraction/Basic.lean @@ -342,7 +342,7 @@ def contractEquivFinTwo (c : WickContraction n) (a : c.1) : · rw [hi] simp only [↓reduceIte, Fin.isValue] exact Subtype.ext hi.symm - · rw [hi, if_neg] + · rw [hi, ite_eq_right] · exact Subtype.ext hi.symm · exact Ne.symm <| fstFieldOfContract_ne_sndFieldOfContract c a right_inv i := by diff --git a/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertNone.lean b/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertNone.lean index 4bf3e5334..c12ec3b5a 100644 --- a/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertNone.lean +++ b/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertNone.lean @@ -129,19 +129,19 @@ lemma signInsertNone_eq_mul_fst_snd (φ : 𝓕.FieldOp) (φs : List 𝓕.FieldOp · rename_i h simp only [Fin.getElem_fin, h.1, ↓reduceIte, mul_ite, exchangeSign_mul_self, mul_one] - rw [if_neg] + rw [ite_eq_right] omega · rename_i h simp only [Nat.succ_eq_add_one, not_and, not_lt] at h split <;> rename_i h1 · simp_all only [forall_const, Fin.getElem_fin, mul_ite, exchangeSign_mul_self, mul_one] - rw [if_pos] + rw [ite_eq_left] have h1 :i.succAbove (φsΛ.sndFieldOfContract a) ≠ i := Fin.succAbove_ne i (φsΛ.sndFieldOfContract a) omega · simp only [not_lt] at h1 - rw [if_neg] + rw [ite_eq_right] simp only [mul_one] have hn := fstFieldOfContract_lt_sndFieldOfContract φsΛ a have hx := (Fin.succAbove_lt_succAbove_iff (p := i)).mpr hn @@ -179,11 +179,11 @@ lemma signInsertNone_eq_prod_getDual?_Some (φ : 𝓕.FieldOp) (φs : List 𝓕. conv_rhs => rhs enter [2, a] - rw [if_neg (by simpa [e2] using a.2)] + rw [ite_eq_right (by simpa [e2] using a.2)] conv_rhs => lhs enter [2, a] - rw [if_pos (by simpa [e2] using a.2)] + rw [ite_eq_left (by simpa [e2] using a.2)] simp only [Equiv.symm_symm, Equiv.sumCompl_apply_inl, Finset.prod_const_one, mul_one, e2] rfl exact hG diff --git a/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertSome.lean b/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertSome.lean index 6f30cc673..52d6d47ad 100644 --- a/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertSome.lean +++ b/Physlib/QFT/PerturbationTheory/WickContraction/Sign/InsertSome.lean @@ -42,7 +42,7 @@ lemma stat_ofFinset_eq_one_of_gradingCompliant (φs : List 𝓕.FieldOp) simp only [Fin.getElem_fin, Fintype.prod_sum_type] conv_lhs => enter [2, 2, x] - rw [Equiv.sumCompl_apply_inr, if_neg (hnon x.1 (by simpa using x.2))] + rw [Equiv.sumCompl_apply_inr, ite_eq_right (hnon x.1 (by simpa using x.2))] simp only [Equiv.sumCompl_apply_inl, Finset.prod_const_one, mul_one] rw [← φsΛ.sigmaContractedEquiv.prod_comp, Fintype.prod_sigma] refine Fintype.prod_eq_one _ fun x => ?_ @@ -251,14 +251,19 @@ lemma sign_insert_some (φ : 𝓕.FieldOp) (φs : List 𝓕.FieldOp) (φsΛ : Wi · split · rename_i h h1 simp only [Nat.succ_eq_add_one, finCongr_apply, h1, true_and] - rw [if_pos, ofFinset_erase, stat_ofFinset_of_insertAndContractLiftFinset] + rw [ite_eq_left, ofFinset_erase, stat_ofFinset_of_insertAndContractLiftFinset] simp only [Fin.getElem_fin, Fin.val_cast, insertIdx_getElem_fin, map_mul, exchangeSign_symm] · rw [succAbove_mem_insertAndContractLiftFinset] simp only [signFinset, Finset.mem_filter, Finset.mem_univ, true_and] exact ⟨h1.1, h1.2.1, Or.inl ((φsΛ.getDual?_eq_none_iff_mem_uncontracted ↑j).mpr j.2)⟩ · simp_all - · rw [if_neg, stat_ofFinset_of_insertAndContractLiftFinset] + refine h1.2.2.trans ?_ + rcases lt_or_ge (φsΛ.fstFieldOfContract a).castSucc i with hc | hc + · rw [Fin.succAbove_of_castSucc_lt _ _ hc] + · rw [Fin.succAbove_of_le_castSucc _ _ hc] + exact Fin.castSucc_le_succ _ + · rw [ite_eq_right, stat_ofFinset_of_insertAndContractLiftFinset] simp_all lemma signInsertSomeProd_eq_one_if (φ : 𝓕.FieldOp) (φs : List 𝓕.FieldOp) @@ -277,10 +282,10 @@ lemma signInsertSomeProd_eq_one_if (φ : 𝓕.FieldOp) (φs : List 𝓕.FieldOp) congr funext a split - · rw [if_pos (by omega)] + · rw [ite_eq_left (by omega)] · split - · rw [hφj, if_pos (by omega)] - · rw [if_neg (by omega)] + · rw [hφj, ite_eq_left (by omega)] + · rw [ite_eq_right (by omega)] lemma signInsertSomeProd_eq_prod_prod (φ : 𝓕.FieldOp) (φs : List 𝓕.FieldOp) (φsΛ : WickContraction φs.length) @@ -299,7 +304,7 @@ lemma signInsertSomeProd_eq_prod_prod (φ : 𝓕.FieldOp) (φs : List 𝓕.Field congr funext a rw [prod_finset_eq_mul_fst_snd] - nth_rewrite 3 [if_neg] + nth_rewrite 3 [ite_eq_right] · simp only [Nat.succ_eq_add_one, not_lt, Fin.getElem_fin, fstFieldOfContract_getDual?, Option.get_some, mul_one, hg a] · simp only [sndFieldOfContract_getDual?, Option.get_some] @@ -473,7 +478,7 @@ lemma signInsertSome_mul_filter_contracted_of_lt (φ : 𝓕.FieldOp) (φs : List 𝓢(𝓕 |>ₛ φ, 𝓕 |>ₛ ⟨φs.get, φsΛ.uncontracted.filter (fun x => x ≤ ↑k)⟩) = 𝓢(𝓕 |>ₛ φ, 𝓕 |>ₛ ⟨φs.get, Finset.univ.filter (fun x => i.succAbove x < i)⟩) := by rw [signInsertSome, signInsertSomeProd_eq_finset (hφj := hg.2) (hg := hg.1), - signInsertSomeCoef_eq_finset (hφj := hg.2), if_neg (by omega), ← map_mul, ← map_mul] + signInsertSomeCoef_eq_finset (hφj := hg.2), ite_eq_right (by omega), ← map_mul, ← map_mul] congr 1 rw [mul_eq_iff_eq_mul, ofFinset_union_disjoint] swap @@ -603,7 +608,7 @@ lemma signInsertSome_mul_filter_contracted_of_not_lt (φ : 𝓕.FieldOp) (φs : = 𝓢(𝓕 |>ₛ φ, 𝓕 |>ₛ ⟨φs.get, Finset.univ.filter (fun x => i.succAbove x < i)⟩) := by have hik : i.succAbove ↑k ≠ i := Fin.succAbove_ne i ↑k rw [signInsertSome, signInsertSomeProd_eq_finset (hφj := hg.2) (hg := hg.1), - signInsertSomeCoef_eq_finset (hφj := hg.2), if_pos (by omega), ← map_mul, ← map_mul] + signInsertSomeCoef_eq_finset (hφj := hg.2), ite_eq_left (by omega), ← map_mul, ← map_mul] congr 1 rw [mul_eq_iff_eq_mul, ofFinset_union, ofFinset_union] apply (mul_eq_one_iff _ _).mp diff --git a/Physlib/QFT/PerturbationTheory/WickContraction/Sign/Join.lean b/Physlib/QFT/PerturbationTheory/WickContraction/Sign/Join.lean index 3b504a4f4..8116a8c75 100644 --- a/Physlib/QFT/PerturbationTheory/WickContraction/Sign/Join.lean +++ b/Physlib/QFT/PerturbationTheory/WickContraction/Sign/Join.lean @@ -314,7 +314,7 @@ lemma joinSignLeftExtra_eq_joinSignRightExtra {φs : List 𝓕.FieldOp} conv_lhs => enter [2, 2, x] simp only [Equiv.symm_symm, Equiv.sumCompl_apply_inl, Equiv.sumCompl_apply_inr, e2] - rw [if_neg (by + rw [ite_eq_right (by simp only [Finset.mem_filter, mem_signFinset, not_and, not_forall, not_lt, and_imp] intro h1 h2 have hx := x.2 @@ -331,7 +331,7 @@ lemma joinSignLeftExtra_eq_joinSignRightExtra {φs : List 𝓕.FieldOp} join_sndFieldOfContract_joinLift, singleton_sndFieldOfContract, lt_self_iff_false, and_false, ↓reduceIte, map_one, mul_one, join_fstFieldOfContract_joinLiftRight, join_sndFieldOfContract_joinLiftRight, getElem_uncontractedListEmd] - rw [if_neg (by omega)] + rw [ite_eq_right (by omega)] simp only [map_one, one_mul] /- Introducing joinSignRightExtra. -/ rw [joinSignRightExtra_eq_i_j_finset_eq_if] diff --git a/Physlib/QFT/QED/AnomalyCancellation/Even/BasisLinear.lean b/Physlib/QFT/QED/AnomalyCancellation/Even/BasisLinear.lean index 6108ab09f..8ca6c61d0 100644 --- a/Physlib/QFT/QED/AnomalyCancellation/Even/BasisLinear.lean +++ b/Physlib/QFT/QED/AnomalyCancellation/Even/BasisLinear.lean @@ -257,7 +257,7 @@ lemma basis_on_evenFst_other {k j : Fin n.succ} (h : k ≠ j) : set_option backward.isDefEq.respectTransparency false in lemma basis_on_other {k : Fin n.succ} {j : Fin (2 * n.succ)} (h1 : j ≠ evenFst k) (h2 : j ≠ evenSnd k) : basisAsCharges k j = 0 := by - simp only [basisAsCharges, if_neg h1, if_neg h2] + simp only [basisAsCharges, ite_eq_right h1, ite_eq_right h2] set_option backward.isDefEq.respectTransparency false in lemma basis_evenSnd_eq_neg_evenFst (j i : Fin n.succ) : @@ -480,7 +480,7 @@ lemma basis_on_evenShiftFst_self (j : Fin n) : basisAsCharges j (evenShiftFst j) set_option backward.isDefEq.respectTransparency false in lemma basis_on_other {k : Fin n} {j : Fin (2 * n.succ)} (h1 : j ≠ evenShiftFst k) (h2 : j ≠ evenShiftSnd k) : basisAsCharges k j = 0 := by - simp only [basisAsCharges, if_neg h1, if_neg h2] + simp only [basisAsCharges, ite_eq_right h1, ite_eq_right h2] lemma basis_on_evenShiftFst_other {k j : Fin n} (h : k ≠ j) : basisAsCharges k (evenShiftFst j) = 0 := by diff --git a/Physlib/QuantumMechanics/Blackbody/PlancksLaw.lean b/Physlib/QuantumMechanics/Blackbody/PlancksLaw.lean index aaed2b5ab..e58e32906 100644 --- a/Physlib/QuantumMechanics/Blackbody/PlancksLaw.lean +++ b/Physlib/QuantumMechanics/Blackbody/PlancksLaw.lean @@ -80,7 +80,7 @@ noncomputable def spectralRadiance (c : SpeedOfLight) (ν : ℝ) (T : Temperatur lemma spectralRadiance_pos (c : SpeedOfLight) (ν : ℝ) (T : Temperature) (ν_pos : 0 < ν) (T_pos : 0 < T.val) : 0 < spectralRadiance c ν T := by have if_cond : 0 < ν ∧ 0 < (T : ℝ) := ⟨ν_pos, by exact_mod_cast T_pos⟩ - rw [spectralRadiance, if_pos if_cond] + rw [spectralRadiance, ite_eq_left if_cond] refine div_pos ?numerator ?denominator · exact mul_pos (mul_pos (by norm_num) h_pos) (pow_pos ν_pos 3) · have expo_term : 0 < h * ν / (kB * (T : ℝ)) := @@ -91,7 +91,7 @@ lemma spectralRadiance_pos (c : SpeedOfLight) (ν : ℝ) (T : Temperature) /-- Explicit promise for Spectral Radiance vanishing at absolute zero Temperature. -/ lemma spectralRadiance_absZero (c : SpeedOfLight) (ν : ℝ) : spectralRadiance c ν ⟨0⟩ = 0 := by - rw [spectralRadiance, if_neg] + rw [spectralRadiance, ite_eq_right] rintro ⟨ν_pos, T_zero⟩ exact lt_irrefl _ T_zero diff --git a/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/Completeness.lean b/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/Completeness.lean index 0925b653b..59a8f2736 100644 --- a/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/Completeness.lean +++ b/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/Completeness.lean @@ -416,15 +416,11 @@ lemma zero_of_orthogonal_mk (f : ℝ → ℂ) (hf : MemHS f) refine (norm_eq_zero_iff (by simp)).mp ?_ simp only [Norm.norm, eLpNorm_mk] have h2 : eLpNorm f 2 volume = 0 := by - rw [MeasureTheory.eLpNorm_eq_zero_iff] at h1 ⊢ + rw [MeasureTheory.eLpNorm_eq_zero_iff (by simp)] at h1 ⊢ rw [Filter.eventuallyEq_iff_all_subsets] at h1 ⊢ simp only [ofReal_exp, ofReal_div, ofReal_neg, ofReal_mul, ofReal_pow, ofReal_ofNat, Pi.zero_apply, _root_.mul_eq_zero, Complex.exp_ne_zero, or_false] at h1 exact h1 - exact aeStronglyMeasurable_of_memHS hf - simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true] - · exact hInt.aestronglyMeasurable - · simp rw [h2] simp diff --git a/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/TISE.lean b/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/TISE.lean index ca6cb7b41..9949961c6 100644 --- a/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/TISE.lean +++ b/Physlib/QuantumMechanics/HarmonicOscillator/OneDimension/TISE.lean @@ -130,7 +130,7 @@ lemma deriv_deriv_eigenfunction_succ (n : ℕ) (x : ℝ) : simp only [ofNat_nonneg, pow_nonneg, Real.sqrt_mul, one_div, mul_inv_rev, Complex.ofReal_mul, Complex.ofReal_inv, smul_eq_mul, deriv_const_mul_field', neg_mul, mul_eq_mul_left_iff, _root_.mul_eq_zero, inv_eq_zero, Complex.ofReal_eq_zero, cast_nonneg, Real.sqrt_eq_zero, - cast_eq_zero, ne_eq, AddLeftCancelMonoid.add_eq_zero, one_ne_zero, and_false, not_false_eq_true, + cast_eq_zero, ne_eq, Nat.add_eq_zero_iff, one_ne_zero, and_false, not_false_eq_true, pow_eq_zero_iff, OfNat.ofNat_ne_zero, or_false, ξ_ne_zero] left rw [deriv_fun_mul (by fun_prop) (by fun_prop)] diff --git a/Physlib/QuantumMechanics/HilbertSpaces/FiniteTarget/Basic.lean b/Physlib/QuantumMechanics/HilbertSpaces/FiniteTarget/Basic.lean index fd1f8e356..0cbe5dbac 100644 --- a/Physlib/QuantumMechanics/HilbertSpaces/FiniteTarget/Basic.lean +++ b/Physlib/QuantumMechanics/HilbertSpaces/FiniteTarget/Basic.lean @@ -89,7 +89,8 @@ along the equivalence `equivEuclidean`. noncomputable instance : AddCommGroup (FiniteHilbertSpace d) := equivEuclidean.addCommGroup -noncomputable instance : Module ℂ (FiniteHilbertSpace d) := equivEuclidean.module ℂ +noncomputable instance : Module ℂ (FiniteHilbertSpace d) := + AddEquiv.module ℂ { equivEuclidean with map_add' := fun _ _ => rfl } @[simp] lemma val_add (ψ φ : FiniteHilbertSpace d) : (ψ + φ).val = ψ.val + φ.val := rfl diff --git a/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Basic.lean b/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Basic.lean index 1ad08fbab..c9152cfff 100644 --- a/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Basic.lean +++ b/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Basic.lean @@ -61,20 +61,17 @@ lemma toBra_injective : Function.Injective toBra := by to be true if the function `f` can be lifted to the Hilbert space. -/ def MemHS (f : ℝ → ℂ) : Prop := MemLp f 2 MeasureTheory.volume -lemma aeStronglyMeasurable_of_memHS {f : ℝ → ℂ} (h : MemHS f) : AEStronglyMeasurable f := h.1 +lemma aeStronglyMeasurable_of_memHS {f : ℝ → ℂ} (h : MemHS f) : AEStronglyMeasurable f := + h.aestronglyMeasurable /-- A function `f` satisfies `MemHS f` if and only if it is almost everywhere strongly measurable, and square integrable. -/ lemma memHS_iff {f : ℝ → ℂ} : MemHS f ↔ AEStronglyMeasurable f ∧ Integrable (fun x => ‖f x‖ ^ 2) := by - rw [MemHS, MemLp, and_congr_right_iff] - intro h1 - rw [MeasureTheory.eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top - (Ne.symm (NeZero.ne' 2)) ENNReal.ofNat_ne_top] - simp only [ENNReal.toReal_ofNat, ENNReal.rpow_ofNat, Integrable] - have h0 : MeasureTheory.AEStronglyMeasurable (fun x => norm (f x) ^ 2) MeasureTheory.volume := - MeasureTheory.AEStronglyMeasurable.pow (continuous_norm.comp_aestronglyMeasurable h1) .. - simp [h0, HasFiniteIntegral] + refine ⟨fun h => ⟨h.aestronglyMeasurable, + (memLp_two_iff_integrable_sq_norm h.aestronglyMeasurable).mp h⟩, ?_⟩ + rintro ⟨h1, h2⟩ + exact (memLp_two_iff_integrable_sq_norm h1).mpr h2 @[simp] lemma zero_memHS : MemHS 0 := by @@ -110,7 +107,8 @@ lemma aeEqFun_mk_mem_iff (f : ℝ → ℂ) (hf : AEStronglyMeasurable f volume) /-- Given a function `f : ℝ → ℂ` such that `MemHS f` is true via `hf`, then `HilbertSpace.mk hf` is the element of the `HilbertSpace` defined by `f`. -/ def mk {f : ℝ → ℂ} (hf : MemHS f) : HilbertSpace := - ⟨AEEqFun.mk f hf.1, (aeEqFun_mk_mem_iff f hf.1).mpr hf⟩ + ⟨AEEqFun.mk f hf.aestronglyMeasurable, + (aeEqFun_mk_mem_iff f hf.aestronglyMeasurable).mpr hf⟩ lemma coe_hilbertSpace_memHS (f : HilbertSpace) : MemHS (f : ℝ → ℂ) := by rw [← aeEqFun_mk_mem_iff f.1 (Lp.aestronglyMeasurable f)] @@ -122,7 +120,7 @@ lemma mk_surjective (f : HilbertSpace) : ∃ (g : ℝ → ℂ), ∃ (hg : MemHS simp [mk] lemma coe_mk_ae {f : ℝ → ℂ} (hf : MemHS f) : (mk hf : ℝ → ℂ) =ᵐ[MeasureTheory.volume] f := - AEEqFun.coeFn_mk f hf.1 + AEEqFun.coeFn_mk f hf.aestronglyMeasurable lemma inner_mk_mk {f g : ℝ → ℂ} {hf : MemHS f} {hg : MemHS g} : inner ℂ (mk hf) (mk hg) = ∫ x : ℝ, starRingEnd ℂ (f x) * g x := by @@ -136,17 +134,8 @@ lemma eLpNorm_mk {f : ℝ → ℂ} {hf : MemHS f} : eLpNorm (mk hf) 2 volume = e lemma mem_iff' {f : ℝ → ℂ} (hf : MeasureTheory.AEStronglyMeasurable f MeasureTheory.volume) : MeasureTheory.AEEqFun.mk f hf ∈ HilbertSpace - ↔ MeasureTheory.Integrable (fun x => ‖f x‖ ^ 2) := by - simp only [Lp.mem_Lp_iff_memLp, MemLp, eLpNorm_aeeqFun] - have h1 : MeasureTheory.AEStronglyMeasurable - (MeasureTheory.AEEqFun.mk f hf) MeasureTheory.volume := - MeasureTheory.AEEqFun.aestronglyMeasurable .. - simp only [h1, - MeasureTheory.eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top (Ne.symm (NeZero.ne' 2)) - ENNReal.ofNat_ne_top, ENNReal.toReal_ofNat, ENNReal.rpow_ofNat, true_and, Integrable] - have h0 : MeasureTheory.AEStronglyMeasurable (fun x => norm (f x) ^ 2) MeasureTheory.volume := - MeasureTheory.AEStronglyMeasurable.pow (continuous_norm.comp_aestronglyMeasurable hf) .. - simp [h0, HasFiniteIntegral] + ↔ MeasureTheory.Integrable (fun x => ‖f x‖ ^ 2) := + (aeEqFun_mk_mem_iff f hf).trans (memLp_two_iff_integrable_sq_norm hf) lemma mk_add {f g : ℝ → ℂ} {hf : MemHS f} {hg : MemHS g} : mk (memHS_add hf hg) = mk hf + mk hg := rfl diff --git a/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Gaussians.lean b/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Gaussians.lean index 316ee26e7..382087bd9 100644 --- a/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Gaussians.lean +++ b/Physlib/QuantumMechanics/HilbertSpaces/OneDimension/Gaussians.lean @@ -130,7 +130,7 @@ lemma mul_gaussian_mem_Lp_one (f : ℝ → ℂ) (hf : MemHS f) (b c : ℝ) (hb : lemma mul_gaussian_mem_Lp_two (f : ℝ → ℂ) (hf : MemHS f) (b c : ℝ) (hb : 0 < b) : MeasureTheory.MemLp (fun x => f x * Real.exp (- b * (x - c) ^ 2)) 2 volume := by - refine MeasureTheory.MemLp.mul ?_ hf (q := ⊤) + refine MeasureTheory.MemLp.fun_mul hf ?_ (q := ⊤) · apply MeasureTheory.memLp_top_of_bound (C := Real.exp (0)) · exact gaussian_aestronglyMeasurable c hb · apply Filter.Eventually.of_forall diff --git a/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/Basic.lean b/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/Basic.lean index 068d226e0..807c8c5f1 100644 --- a/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/Basic.lean +++ b/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/Basic.lean @@ -122,7 +122,9 @@ lemma memHS_coe : MemHS ψ μ := Lp.memLp ψ /-- A function `f : Space d → ℂ` satisfies `MemHS f μ` if and only if it is `μ`-a.e. strongly measurable and `∫ x, ‖f x‖ ^ 2 ∂μ` is finite. -/ lemma memHS_iff : MemHS f μ ↔ AEStronglyMeasurable f μ ∧ Integrable (fun x ↦ ‖f x‖ ^ 2) μ := - and_congr_right fun h ↦ (and_iff_right h).symm.trans (memLp_two_iff_integrable_sq_norm h) + ⟨fun h ↦ ⟨h.aestronglyMeasurable, + (memLp_two_iff_integrable_sq_norm h.aestronglyMeasurable).mp h⟩, + fun h ↦ (memLp_two_iff_integrable_sq_norm h.1).mpr h.2⟩ lemma mem_iff {f : Space d →ₘ[μ] ℂ} : f ∈ SpaceDHilbertSpace d μ ↔ MemHS f μ := Lp.mem_Lp_iff_memLp @@ -176,7 +178,7 @@ lemma MemHS.indicator {Ω : Set (Space d)} (hΩ : MeasurableSet Ω) (hf : MemHS lemma MemHS.indicator_of_restrict {Ω : Set (Space d)} (hΩ : MeasurableSet Ω) (hf : MemHS f (μ.restrict Ω)) : MemHS (Ω.indicator f) μ := by - refine memHS_iff.mpr ⟨(aestronglyMeasurable_indicator_iff hΩ).mpr hf.1, ?_⟩ + refine memHS_iff.mpr ⟨(aestronglyMeasurable_indicator_iff hΩ).mpr hf.aestronglyMeasurable, ?_⟩ refine (IntegrableOn.integrable_indicator (memHS_iff.mp hf).2 hΩ).congr ?_ filter_upwards with x by_cases x ∈ Ω <;> simp_all @@ -192,7 +194,8 @@ variable (hf : MemHS f μ) (hg : MemHS g μ) /-- Given a function `f : Space d → ℂ` such that `MemHS f μ` is true via `hf`, `mk hf` is the element of the Hilbert space defined by `f`. -/ def mk : SpaceDHilbertSpace d μ := - ⟨AEEqFun.mk f hf.1, mem_iff.mpr <| hf.ae_eq (AEEqFun.coeFn_mk f hf.1).symm⟩ + ⟨AEEqFun.mk f hf.aestronglyMeasurable, + mem_iff.mpr <| hf.ae_eq (AEEqFun.coeFn_mk f hf.aestronglyMeasurable).symm⟩ @[simp] lemma mk_neg : mk hf.neg = -mk hf := rfl @@ -211,7 +214,7 @@ lemma mk_eq_iff : mk hf = mk hg ↔ f =ᵐ[μ] g := by simp [mk] lemma mk_surjective : ∃ (f : Space d → ℂ) (hf : MemHS f μ), mk hf = ψ := ⟨ψ, memHS_coe ψ, by simp [mk]⟩ -lemma coeFn_mk : mk hf =ᵐ[μ] f := AEEqFun.coeFn_mk f hf.1 +lemma coeFn_mk : mk hf =ᵐ[μ] f := AEEqFun.coeFn_mk f hf.aestronglyMeasurable lemma inner_mk_mk : ⟪mk hf, mk hg⟫_ℂ = ∫ x, starRingEnd ℂ (f x) * g x ∂μ := by apply integral_congr_ae @@ -258,7 +261,8 @@ lemma tendsto_zero_iff_tendsto_zero_lintegral_enorm_sq {α : Type*} {l : Filter α} {ψ : α → SpaceDHilbertSpace d μ} : Tendsto ψ l (nhds 0) ↔ Tendsto (fun a ↦ ∫⁻ x, ‖ψ a x‖ₑ ^ 2 ∂μ) l (nhds 0) := by trans Tendsto (fun a ↦ (∫⁻ x, ‖ψ a x‖ₑ ^ 2 ∂μ) ^ (2⁻¹ : ℝ)) l (nhds 0) - · simp [tendsto_iff_edist_tendsto_0, edist_zero_right, Lp.enorm_def, eLpNorm, eLpNorm'] + · simp [tendsto_iff_edist_tendsto_0, edist_zero_right, Lp.enorm_def, eLpNorm, eLpNorm', + Lp.aestronglyMeasurable] constructor <;> intro h · apply Tendsto.ennrpow_const 2 at h simp_all [← ENNReal.rpow_mul_natCast] diff --git a/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/PolyBddSchwartzSubmodule.lean b/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/PolyBddSchwartzSubmodule.lean index d6c517cfc..5971c08c9 100644 --- a/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/PolyBddSchwartzSubmodule.lean +++ b/Physlib/QuantumMechanics/HilbertSpaces/SpaceD/PolyBddSchwartzSubmodule.lean @@ -241,11 +241,12 @@ lemma dense_top (hμ : μ ≤ volume) [μ.IsOpenPosMeasure] [IsFiniteMeasureOnCo -- Split `φₙ = σₙ + (φₙ - σₐ)` with `σₙ ≔ [bₙξ]` a sequence in `SpaceDHilbertSpace` let s (n : ℕ) : Space d → ℂ := fun x ↦ b n x * ξ x let σ (n : ℕ) : SpaceDHilbertSpace d μ := by - refine mk (f := s n) ⟨?_, ?_⟩ - · exact (continuous_ofReal.comp (b n).continuous).aestronglyMeasurable.mul - ξ.val.aestronglyMeasurable - · refine lt_of_le_of_lt ?_ (memHS_coe ξ).2 - exact eLpNorm_mono_enorm (enorm_bump_mul_le_enorm (b n) ξ) + refine mk (f := s n) ?_ + refine lt_of_le_of_lt ?_ (memHS_coe ξ) + exact eLpNorm_mono_enorm + ((continuous_ofReal.comp (b n).continuous).aestronglyMeasurable.mul + ξ.val.aestronglyMeasurable) + (enorm_bump_mul_le_enorm (b n) ξ) have hψ_ae (n : ℕ) : ψ n =ᵐ[μ] f n := (schwartzEquiv_symm_coe_ae ⟨ψ n, hψ n⟩).symm have hφ_ae (n : ℕ) : φ n =ᵐ[μ] g n := schwartzEquiv_coe_ae (g n) have hσ_ae (n : ℕ) : σ n =ᵐ[μ] s n := coeFn_mk _ @@ -261,8 +262,12 @@ lemma dense_top (hμ : μ ≤ volume) [μ.IsOpenPosMeasure] [IsFiniteMeasureOnCo have hξB : Tendsto (fun n ↦ ∫⁻ x in B n, ‖ξ x‖ₑ ^ 2 ∂μ) atTop (nhds 0) := by refine tendsto_setLIntegral_zero ?_ ?_ · refine lt_top_iff_ne_top.mp ?_ - simpa [eLpNorm_one_eq_lintegral_enorm, Real.rpow_ofNat, enorm_pow, enorm_norm] - using L2.eLpNorm_rpow_two_norm_lt_top ξ + have h := L2.eLpNorm_rpow_two_norm_lt_top ξ + have hξ2 : AEStronglyMeasurable (fun x ↦ ‖(ξ : Space d → ℂ) x‖ ^ 2) μ := + ξ.val.aestronglyMeasurable.norm.pow 2 + simp only [Real.rpow_ofNat] at h + rw [eLpNorm_one_eq_lintegral_enorm hξ2] at h + simpa [enorm_pow, enorm_norm] using h · have : NeZero d := ⟨hd.ne'⟩ refine tendsto_const_nhds.squeeze ?_ zero_le (fun n ↦ hμ (B n)) let C : ℝ := (ENNReal.ofReal (√Real.pi ^ d / Real.Gamma (d / 2 + 1))).toReal diff --git a/Physlib/QuantumMechanics/HilbertSpaces/TensorProducts/CompleteTensorProduct.lean b/Physlib/QuantumMechanics/HilbertSpaces/TensorProducts/CompleteTensorProduct.lean index aeb984803..3dae0eb35 100644 --- a/Physlib/QuantumMechanics/HilbertSpaces/TensorProducts/CompleteTensorProduct.lean +++ b/Physlib/QuantumMechanics/HilbertSpaces/TensorProducts/CompleteTensorProduct.lean @@ -178,10 +178,10 @@ variable {𝕜 E F} and `TensorProduct`. -/ @[elab_as_elim] lemma induction_on {motive : E ⊗ₕ[𝕜] F → Prop} (z : E ⊗ₕ[𝕜] F) - (zero : motive 0) (tmul : ∀ (x : E) (y : F), motive (x ⊗ₜ[𝕜] y)) + (tmul : ∀ (x : E) (y : F), motive (x ⊗ₜ[𝕜] y)) (add : ∀ x y : E ⊗[𝕜] F, motive x → motive y → motive ↑(x + y)) (closed : IsClosed {x | motive x}) : motive z := - Completion.induction_on z closed fun x ↦ x.induction_on zero tmul add + Completion.induction_on z closed fun x ↦ x.inductionOn tmul add end Induction @@ -223,7 +223,7 @@ lemma _root_.TensorProduct.denseRange_map DenseRange (TensorProduct.map f g) := by intro x change x ∈ (TensorProduct.map f g).range.topologicalClosure - refine x.induction_on (Submodule.zero_mem _) (fun a b ↦ ?_) (fun _ _ ↦ Submodule.add_mem _) + refine x.inductionOn (fun a b ↦ ?_) (fun _ _ ↦ Submodule.add_mem _) refine map_mem_closure₂' (fun u ↦ ?_) (fun v ↦ ?_) (hf a) (hg b) ?_ · refine Metric.continuous_iff.mpr fun v ε hε ↦ ⟨ε / (1 + ‖u‖), by positivity, fun s hs ↦ ?_⟩ rw [dist_eq_norm, ← TensorProduct.tmul_sub, TensorProduct.norm_tmul] at * diff --git a/Physlib/QuantumMechanics/Operators/Multiplication.lean b/Physlib/QuantumMechanics/Operators/Multiplication.lean index 5ed8a5bb4..dbc181a90 100644 --- a/Physlib/QuantumMechanics/Operators/Multiplication.lean +++ b/Physlib/QuantumMechanics/Operators/Multiplication.lean @@ -316,7 +316,8 @@ private lemma mulOperator_adjoint_domain_le · suffices h : ∀ ψ : SpaceDHilbertSpace d μ, ‖ψ‖ ^ 2 = (∫⁻ x, ‖‖ψ x‖ ^ 2‖ₑ ∂μ).toReal by simp only [← h, this] intro ψ - rw [Lp.norm_def, eLpNorm_eq_lintegral_rpow_enorm_toReal two_ne_zero ENNReal.ofNat_ne_top] + rw [Lp.norm_def, eLpNorm_eq_lintegral_rpow_enorm_toReal two_ne_zero ENNReal.ofNat_ne_top + (Lp.aestronglyMeasurable ψ)] simp [← ENNReal.toReal_pow, ← ENNReal.rpow_mul_natCast] suffices ‖φ n‖ ^ 2 ≤ ‖ξ‖ * ‖φ n‖ by nlinarith [this, sq_nonneg (‖ξ‖ - ‖φ n‖)] diff --git a/Physlib/QuantumMechanics/Operators/SpectralTheory/Basic.lean b/Physlib/QuantumMechanics/Operators/SpectralTheory/Basic.lean index 5e4cb8046..b7cd6613d 100644 --- a/Physlib/QuantumMechanics/Operators/SpectralTheory/Basic.lean +++ b/Physlib/QuantumMechanics/Operators/SpectralTheory/Basic.lean @@ -198,14 +198,16 @@ lemma mem_regularityDomain_iff {T : H →ₗ.[ℂ] H} {z : ℂ} : rw [inverse_domain] at hx obtain ⟨y, hy⟩ := hx specialize h_bound ⟨y, y.2.1⟩ - simp_all [le_inv_mul_iff₀, sub_apply, inverse_apply_eq h_ker (y := ⟨x, hx⟩) hy] + simp_all [le_inv_mul_iff₀, sub_apply, + inverse_apply_eq (toFun_ker_eq_bot_iff.mp h_ker) (y := ⟨x, hx⟩) hy] · intro ⟨h_ker, h_cont⟩ obtain ⟨c, hc, h_bound⟩ := LinearMap.continuous_iff_bounded.mp h_cont refine ⟨c⁻¹, inv_pos.mpr hc, fun x ↦ ?_⟩ apply (inv_mul_le_iff₀ hc).mpr have hx : ↑x ∈ (T - z • 1).domain := by simp [sub_domain] specialize h_bound ⟨(T - z • 1) ⟨x, hx⟩, by simp [inverse_domain]⟩ - simp only [toFun_eq_coe, inverse_apply_eq h_ker (x := ⟨x, hx⟩), coe_norm] at h_bound + simp only [toFun_eq_coe, + inverse_apply_eq (toFun_ker_eq_bot_iff.mp h_ker) (x := ⟨x, hx⟩), norm_coe] at h_bound simp_all [sub_apply] /-- The regularity domain of `T` contains open balls with radii controlled by the lower bounds. -/ @@ -592,7 +594,7 @@ theorem numericalRange_convex (T : H →ₗ.[ℂ] H) : Convex ℝ (Θ T) := by -- `g 0 = 0`, `g 1 = 1` and continuity ensure that all of `[0,1]` is also in `Θ S`. let g : ℝ → ℝ := fun t ↦ (t ^ 2 + (1 - t) * t * (⟪↑y₀, S y₂⟫_ℂ + ⟪↑y₂, S y₀⟫_ℂ).re) / ‖f t‖ ^ 2 have hg₀ : g 0 = 0 := by simp [g] - have hg₁ : g 1 = 1 := by simp [g, f, coe_norm y₂ ▸ hy₂] + have hg₁ : g 1 = 1 := by simp [g, f, (norm_coe y₂).symm ▸ hy₂] have hg_cont : Continuous g := Continuous.div₀ (by fun_prop) (by fun_prop) (by simp [hf]) intro c ⟨t, ht, htc⟩ obtain ⟨r, hr, hrt⟩ := (hg₀ ▸ hg₁ ▸ intermediate_value_Icc zero_le_one hg_cont.continuousOn) ht @@ -646,7 +648,7 @@ lemma resolventSet_eq_empty [CompleteSpace H] {T : H →ₗ.[ℂ] H} (h : ¬T.Is have hTz : T - z • 1 + z • 1 = T := eq_of_le_of_domain_eq (sub_add_le_cancel _ _) (by simp [add_domain, sub_domain]) exact h <| hTz ▸ this.add_continuous (Continuous.const_smul (by fun_prop) _) (by simp) - apply (inverse_closed_iff h_ker).mp + apply (inverse_closed_iff (toFun_ker_eq_bot_iff.mp h_ker)).mp apply (isClosed_iff_isClosed_domain_of_continuous h_cont).mpr simp [inverse_domain, h_range] @@ -661,7 +663,7 @@ lemma IsClosed.resolventSet_eq [CompleteSpace H] {T : H →ₗ.[ℂ] H} (hT : T. rw [mem_resolventSet_iff, Set.mem_ofPred_eq, and_congr_right_iff, and_iff_left_iff_imp] intro h_ker h_range refine continuous_of_isClosed_domain ?_ ?_ - · apply (inverse_closed_iff h_ker).mpr + · apply (inverse_closed_iff (toFun_ker_eq_bot_iff.mp h_ker)).mpr exact hT.sub_continuous (Continuous.const_smul (by fun_prop) _) (by simp) · simp [inverse_domain, h_range] @@ -803,7 +805,7 @@ lemma IsClosed.spectrum_eq [CompleteSpace H] {T : H →ₗ.[ℂ] H} (hT : T.IsCl rw [mem_continuousSpectrum_iff, ← inverse_domain] refine fun h ↦ h_cont ?_ refine continuous_of_isClosed_domain ?_ h - apply (inverse_closed_iff h_ker).mpr + apply (inverse_closed_iff (toFun_ker_eq_bot_iff.mp h_ker)).mpr exact hT.sub_continuous (Continuous.const_smul (by fun_prop) _) le_top · left; left; exact h_ker · refine union_subset ?_ T.continuousSpectrum_subset_spectrum @@ -842,7 +844,8 @@ lemma resolvent_sub ext x · suffices 𝑅 T₂ z ⟨x, by simp [inverse_domain, hz₂.2]⟩ ∈ T₁.domain by simp [sub_domain, mem_compRestricted_domain_iff, inverse_domain, hz₁.2, hz₂.2, this] - have hR₂ : (𝑅 T₂ z).toFun.range = T₂.domain := by simp [inverse_range hz₂.1, sub_domain] + have hR₂ : (𝑅 T₂ z).toFun.range = T₂.domain := by + simp [inverse_range (toFun_ker_eq_bot_iff.mp hz₂.1), sub_domain] exact hT (hR₂ ▸ mem_range_self _) · rfl @@ -874,7 +877,8 @@ lemma resolvent_sub' {T : H →ₗ.[ℂ] H} (z₁ z₂ : ℂ) (hz₁ : z₁ ∈ _ = (z₁ - z₂) • 𝑅 S z₁ := by congr ext - · simp [mem_compRestricted_domain_iff, ← inverse_range hz₁'.1] + · simp [mem_compRestricted_domain_iff, + ← inverse_range (toFun_ker_eq_bot_iff.mp hz₁'.1)] · rfl end diff --git a/Physlib/QuantumMechanics/PlanckConstant.lean b/Physlib/QuantumMechanics/PlanckConstant.lean index 95bb32f93..7edbe3623 100644 --- a/Physlib/QuantumMechanics/PlanckConstant.lean +++ b/Physlib/QuantumMechanics/PlanckConstant.lean @@ -5,7 +5,7 @@ Authors: Samyak Rai, Joseph Tooby-Smith -/ module -public import Mathlib.Data.NNReal.Defs +public import Mathlib.Basic.NNReal.Defs public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic /-! diff --git a/Physlib/Relativity/Fermions/Dirac/Basic.lean b/Physlib/Relativity/Fermions/Dirac/Basic.lean index 78e00bc60..e92578e2d 100644 --- a/Physlib/Relativity/Fermions/Dirac/Basic.lean +++ b/Physlib/Relativity/Fermions/Dirac/Basic.lean @@ -63,7 +63,7 @@ def decomposeEquiv : Dirac ≃ LeftHandedWeyl × DualRightHandedWeyl where instance : AddCommGroup Dirac := Equiv.addCommGroup decomposeEquiv -instance : Module ℂ Dirac := Equiv.module ℂ decomposeEquiv +instance : Module ℂ Dirac := AddEquiv.module ℂ { decomposeEquiv with map_add' _ _ := rfl } @[simp] lemma left_add (d₁ d₂ : Dirac) : (d₁ + d₂).left = d₁.left + d₂.left := rfl diff --git a/Physlib/Relativity/Fermions/Dirac/GammaMatrices.lean b/Physlib/Relativity/Fermions/Dirac/GammaMatrices.lean index b72376235..758c310d9 100644 --- a/Physlib/Relativity/Fermions/Dirac/GammaMatrices.lean +++ b/Physlib/Relativity/Fermions/Dirac/GammaMatrices.lean @@ -177,7 +177,7 @@ theorem gamma_anticomm (μ ν : Fin 1 ⊕ Fin 3) : rw [mul_comm (minkowskiMatrix ν ν), ← smul_add, gammaMatrix_anticomm] rw [smul_smul, ← Complex.coe_smul] fin_cases μ <;> fin_cases ν <;> - norm_num [minkowskiMatrix.off_diag_zero] <;> simp [minkowskiMatrix.off_diag_zero] + norm_num [minkowskiMatrix.off_diag_zero] /-- A gamma endomorphism squares to the corresponding diagonal metric sign. -/ lemma gamma_mul_self (μ : Fin 1 ⊕ Fin 3) : diff --git a/Physlib/Relativity/Fermions/Weyl/DualLeftHanded.lean b/Physlib/Relativity/Fermions/Weyl/DualLeftHanded.lean index 0e7c57656..a6bc9abe1 100644 --- a/Physlib/Relativity/Fermions/Weyl/DualLeftHanded.lean +++ b/Physlib/Relativity/Fermions/Weyl/DualLeftHanded.lean @@ -62,9 +62,13 @@ instance : AddCommMonoid DualLeftHandedWeyl := Equiv.addCommMonoid toFin2ℂFun with `Fin 2 → ℂ`. -/ instance : AddCommGroup DualLeftHandedWeyl := Equiv.addCommGroup toFin2ℂFun +/-- The additive equivalence between `DualLeftHandedWeyl` and `Fin 2 → ℂ`. -/ +def toFin2ℂAddEquiv : DualLeftHandedWeyl ≃+ (Fin 2 → ℂ) := + { toFin2ℂFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `DualLeftHandedWeyl` defined via its equivalence with `Fin 2 → ℂ`. -/ -instance : Module ℂ DualLeftHandedWeyl := Equiv.module ℂ toFin2ℂFun +instance : Module ℂ DualLeftHandedWeyl := AddEquiv.module ℂ toFin2ℂAddEquiv /-- The linear equivalence between `DualLeftHandedWeyl` and `(Fin 2 → ℂ)`. -/ @[simps!] @@ -90,13 +94,12 @@ lemma toFin2ℂ_eq_val (ψ : DualLeftHandedWeyl) : ψ.toFin2ℂ = ψ.val := rfl /-- The standard basis on dual-left-handed Weyl fermions. -/ def basis : Basis (Fin 2) ℂ DualLeftHandedWeyl := Basis.ofEquivFun - (Equiv.linearEquiv ℂ DualLeftHandedWeyl.toFin2ℂFun) + (AddEquiv.linearEquiv ℂ DualLeftHandedWeyl.toFin2ℂAddEquiv) lemma basis_apply (i j : Fin 2) : (basis i).1 j = if j = i then 1 else 0 := by - simp only [basis, Equiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, + simp only [basis, AddEquiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, EquivLike.coe_coe, Equiv.invFun_as_coe, AddEquiv.coe_toEquiv_symm, Basis.coe_ofEquivFun, - LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk, - Equiv.addEquiv_symm_apply] + LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk] change Pi.single i 1 j = _ simp [Pi.single_apply] diff --git a/Physlib/Relativity/Fermions/Weyl/DualRightHanded.lean b/Physlib/Relativity/Fermions/Weyl/DualRightHanded.lean index 277ce9bc0..1d7fbbeec 100644 --- a/Physlib/Relativity/Fermions/Weyl/DualRightHanded.lean +++ b/Physlib/Relativity/Fermions/Weyl/DualRightHanded.lean @@ -58,9 +58,13 @@ instance : AddCommMonoid DualRightHandedWeyl := Equiv.addCommMonoid toFin2ℂFun with `Fin 2 → ℂ`. -/ instance : AddCommGroup DualRightHandedWeyl := Equiv.addCommGroup toFin2ℂFun +/-- The additive equivalence between `DualRightHandedWeyl` and `Fin 2 → ℂ`. -/ +def toFin2ℂAddEquiv : DualRightHandedWeyl ≃+ (Fin 2 → ℂ) := + { toFin2ℂFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `DualRightHandedWeyl` defined via its equivalence with `Fin 2 → ℂ`. -/ -instance : Module ℂ DualRightHandedWeyl := Equiv.module ℂ toFin2ℂFun +instance : Module ℂ DualRightHandedWeyl := AddEquiv.module ℂ toFin2ℂAddEquiv /-- The linear equivalence between `DualRightHandedWeyl` and `(Fin 2 → ℂ)`. -/ @[simps!] @@ -87,14 +91,13 @@ lemma toFin2ℂ_eq_val (ψ : DualRightHandedWeyl) : ψ.toFin2ℂ = ψ.val := rfl /-- The standard basis on dual-right-handed Weyl fermions. -/ def basis : Basis (Fin 2) ℂ DualRightHandedWeyl := Basis.ofEquivFun - (Equiv.linearEquiv ℂ DualRightHandedWeyl.toFin2ℂFun) + (AddEquiv.linearEquiv ℂ DualRightHandedWeyl.toFin2ℂAddEquiv) lemma basis_apply (i j : Fin 2) : (basis i).1 j = if j = i then 1 else 0 := by - simp only [basis, Equiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, + simp only [basis, AddEquiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, EquivLike.coe_coe, Equiv.invFun_as_coe, AddEquiv.coe_toEquiv_symm, Basis.coe_ofEquivFun, - LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk, - Equiv.addEquiv_symm_apply] + LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk] change Pi.single i 1 j = _ simp [Pi.single_apply] diff --git a/Physlib/Relativity/Fermions/Weyl/LeftHanded.lean b/Physlib/Relativity/Fermions/Weyl/LeftHanded.lean index c7136388c..45187eaca 100644 --- a/Physlib/Relativity/Fermions/Weyl/LeftHanded.lean +++ b/Physlib/Relativity/Fermions/Weyl/LeftHanded.lean @@ -60,9 +60,13 @@ instance : AddCommMonoid LeftHandedWeyl := Equiv.addCommMonoid toFin2ℂFun with `Fin 2 → ℂ`. -/ instance : AddCommGroup LeftHandedWeyl := Equiv.addCommGroup toFin2ℂFun +/-- The additive equivalence between `LeftHandedWeyl` and `Fin 2 → ℂ`. -/ +def toFin2ℂAddEquiv : LeftHandedWeyl ≃+ (Fin 2 → ℂ) := + { toFin2ℂFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `LeftHandedWeyl` defined via its equivalence with `Fin 2 → ℂ`. -/ -instance : Module ℂ LeftHandedWeyl := Equiv.module ℂ toFin2ℂFun +instance : Module ℂ LeftHandedWeyl := AddEquiv.module ℂ toFin2ℂAddEquiv /-- The linear equivalence between `LeftHandedWeyl` and `(Fin 2 → ℂ)`. -/ @[simps!] @@ -88,13 +92,12 @@ lemma toFin2ℂ_eq_val (ψ : LeftHandedWeyl) : ψ.toFin2ℂ = ψ.val := rfl /-- The standard basis on left-handed Weyl fermions. -/ def basis : Basis (Fin 2) ℂ LeftHandedWeyl := Basis.ofEquivFun - (Equiv.linearEquiv ℂ LeftHandedWeyl.toFin2ℂFun) + (AddEquiv.linearEquiv ℂ LeftHandedWeyl.toFin2ℂAddEquiv) lemma basis_apply (i j : Fin 2) : (basis i).1 j = if j = i then 1 else 0 := by - simp only [basis, Equiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, + simp only [basis, AddEquiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, EquivLike.coe_coe, Equiv.invFun_as_coe, AddEquiv.coe_toEquiv_symm, Basis.coe_ofEquivFun, - LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk, - Equiv.addEquiv_symm_apply] + LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk] change Pi.single i 1 j = _ simp [Pi.single_apply] diff --git a/Physlib/Relativity/Fermions/Weyl/RightHanded.lean b/Physlib/Relativity/Fermions/Weyl/RightHanded.lean index 6a3f1eaf9..6b68b8c5f 100644 --- a/Physlib/Relativity/Fermions/Weyl/RightHanded.lean +++ b/Physlib/Relativity/Fermions/Weyl/RightHanded.lean @@ -58,9 +58,13 @@ instance : AddCommMonoid RightHandedWeyl := Equiv.addCommMonoid toFin2ℂFun with `Fin 2 → ℂ`. -/ instance : AddCommGroup RightHandedWeyl := Equiv.addCommGroup toFin2ℂFun +/-- The additive equivalence between `RightHandedWeyl` and `Fin 2 → ℂ`. -/ +def toFin2ℂAddEquiv : RightHandedWeyl ≃+ (Fin 2 → ℂ) := + { toFin2ℂFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `RightHandedWeyl` defined via its equivalence with `Fin 2 → ℂ`. -/ -instance : Module ℂ RightHandedWeyl := Equiv.module ℂ toFin2ℂFun +instance : Module ℂ RightHandedWeyl := AddEquiv.module ℂ toFin2ℂAddEquiv /-- The linear equivalence between `RightHandedWeyl` and `(Fin 2 → ℂ)`. -/ @[simps!] @@ -86,13 +90,12 @@ lemma toFin2ℂ_eq_val (ψ : RightHandedWeyl) : ψ.toFin2ℂ = ψ.val := rfl /-- The standard basis on right-handed Weyl fermions. -/ def basis : Basis (Fin 2) ℂ RightHandedWeyl := Basis.ofEquivFun - (Equiv.linearEquiv ℂ RightHandedWeyl.toFin2ℂFun) + (AddEquiv.linearEquiv ℂ RightHandedWeyl.toFin2ℂAddEquiv) lemma basis_apply (i j : Fin 2) : (basis i).1 j = if j = i then 1 else 0 := by - simp only [basis, Equiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, + simp only [basis, AddEquiv.linearEquiv, AddEquiv.toEquiv_eq_coe, Equiv.toFun_as_coe, EquivLike.coe_coe, Equiv.invFun_as_coe, AddEquiv.coe_toEquiv_symm, Basis.coe_ofEquivFun, - LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk, - Equiv.addEquiv_symm_apply] + LinearEquiv.symm_mk, LinearMap.coe_mk, AddHom.coe_mk, LinearEquiv.coe_mk] change Pi.single i 1 j = _ simp [Pi.single_apply] diff --git a/Physlib/Relativity/LorentzGroup/Basic.lean b/Physlib/Relativity/LorentzGroup/Basic.lean index 7c11825e1..ebad7295a 100644 --- a/Physlib/Relativity/LorentzGroup/Basic.lean +++ b/Physlib/Relativity/LorentzGroup/Basic.lean @@ -9,6 +9,7 @@ public import Physlib.Relativity.MinkowskiMatrix public import Physlib.Meta.TODO.Basic public import Mathlib.Analysis.Complex.Basic public import Mathlib.Topology.Instances.Matrix +public import Mathlib.Topology.Algebra.Group.Units public import Mathlib.Topology.Maps.Basic public import Mathlib.Topology.Algebra.Group.ClosedSubgroup /-! @@ -336,7 +337,7 @@ lemma toGL_embedding : IsEmbedding (@toGL d).toFun where /-- The embedding of the Lorentz group into `GL(n, ℝ)` gives `LorentzGroup d` an instance of a topological group. -/ instance : IsTopologicalGroup (LorentzGroup d) := - IsInducing.topologicalGroup toGL toGL_embedding.toIsInducing + IsInducing.isTopologicalGroup toGL toGL_embedding.toIsInducing /-! diff --git a/Physlib/Relativity/LorentzGroup/Boosts/Basic.lean b/Physlib/Relativity/LorentzGroup/Boosts/Basic.lean index 297c14342..a352a3d82 100644 --- a/Physlib/Relativity/LorentzGroup/Boosts/Basic.lean +++ b/Physlib/Relativity/LorentzGroup/Boosts/Basic.lean @@ -96,8 +96,8 @@ where ring · simp only [hk', ↓reduceIte, Fin.isValue] rw [one_apply_ne fun a => hk (id (Eq.symm a))] - rw [if_neg (by exact fun a => hk (id (Eq.symm a)))] - rw [if_neg (by exact fun a => hk' (id (Eq.symm a)))] + rw [ite_eq_right (by exact fun a => hk (id (Eq.symm a)))] + rw [ite_eq_right (by exact fun a => hk' (id (Eq.symm a)))] simp · intro b _ hb simp [hb] @@ -122,7 +122,8 @@ where · rw [one_apply] simp only [Fin.isValue, reduceCtorEq, ↓reduceIte, Sum.inr.injEq, hk, and_true, and_self, neg_mul, one_mul, neg_neg, zero_add] - rw [if_neg (fun a => hk (id (Eq.symm a))), if_neg (fun a => hk (id (Eq.symm a)))] + rw [ite_eq_right (fun a => hk (id (Eq.symm a))), + ite_eq_right (fun a => hk (id (Eq.symm a)))] · rw [one_apply] simp [hj'] · intro b _ hb diff --git a/Physlib/Relativity/LorentzGroup/Orthochronous/Basic.lean b/Physlib/Relativity/LorentzGroup/Orthochronous/Basic.lean index b3a185cf4..8921c68b2 100644 --- a/Physlib/Relativity/LorentzGroup/Orthochronous/Basic.lean +++ b/Physlib/Relativity/LorentzGroup/Orthochronous/Basic.lean @@ -132,14 +132,14 @@ lemma orthchroMapReal_on_IsOrthochronous {Λ : LorentzGroup d} (h : IsOrthochron orthchroMapReal Λ = 1 := by rw [isOrthochronous_iff_ge_one] at h change stepFunction (Λ.1 _ _) = 1 - rw [stepFunction, if_pos h, if_neg (by linarith)] + rw [stepFunction, ite_eq_left h, ite_eq_right (by linarith)] /-- A Lorentz transformation which is not-orthochronous maps under `orthchroMapReal` to `- 1`. -/ lemma orthchroMapReal_on_not_IsOrthochronous {Λ : LorentzGroup d} (h : ¬ IsOrthochronous Λ) : orthchroMapReal Λ = - 1 := by rw [not_isOrthochronous_iff_le_neg_one] at h change stepFunction (Λ.1 _ _) = - 1 - rw [stepFunction, if_pos h] + rw [stepFunction, ite_eq_left h] /-- Every Lorentz transformation maps under `orthchroMapReal` to either `1` or `-1`. -/ lemma orthchroMapReal_minus_one_or_one (Λ : LorentzGroup d) : @@ -168,7 +168,7 @@ lemma orthchroMap_not_IsOrthochronous {Λ : LorentzGroup d} (h : ¬ IsOrthochron orthchroMap Λ = Additive.toMul (1 : ZMod 2) := by simp only [orthchroMap, ContinuousMap.comp_apply, ContinuousMap.coe_mk, orthchroMapReal_on_not_IsOrthochronous h, coeForℤ₂_apply, Subtype.mk.injEq, Nat.reduceAdd] - rw [if_neg (by norm_num)] + rw [ite_eq_right (by norm_num)] rfl /-- The product of two orthochronous Lorentz transformations is orthochronous. -/ diff --git a/Physlib/Relativity/LorentzGroup/Proper.lean b/Physlib/Relativity/LorentzGroup/Proper.lean index 9abb11159..acde0acf8 100644 --- a/Physlib/Relativity/LorentzGroup/Proper.lean +++ b/Physlib/Relativity/LorentzGroup/Proper.lean @@ -87,13 +87,13 @@ lemma detContinuous_eq_zero (Λ : LorentzGroup d) : Subtype.mk.injEq, Nat.reduceAdd] refine Iff.intro (fun h => ?_) (fun h => ?_) · by_contra hn - rw [if_pos] at h + rw [ite_eq_left] at h · change (0 : Fin 2) = (1 : Fin 2) at h simp only [Fin.isValue, zero_ne_one] at h · cases' det_eq_one_or_neg_one Λ with h2 h2 · simp_all only [ite_true] · simp_all only [not_true_eq_false] - · rw [if_neg] + · rw [ite_eq_right] · rfl · cases' det_eq_one_or_neg_one Λ with h2 h2 · rw [h] diff --git a/Physlib/Relativity/PauliMatrices/CliffordAlgebra.lean b/Physlib/Relativity/PauliMatrices/CliffordAlgebra.lean index b20bc39cf..9dbaf6231 100644 --- a/Physlib/Relativity/PauliMatrices/CliffordAlgebra.lean +++ b/Physlib/Relativity/PauliMatrices/CliffordAlgebra.lean @@ -48,6 +48,6 @@ lemma ofCliffordAlgebra_ι_single (i : Fin 3) (r : ℝ) : simp only [Fin.isValue, Nat.succ_eq_add_one, Nat.reduceAdd, LinearMap.coe_sum, LinearMap.coe_smulRight, LinearMap.coe_proj, Function.eval, SetLike.mk_smul_mk, Finset.sum_apply, AddSubmonoidClass.coe_finsetSum, Pi.single_apply, ite_smul, zero_smul, - Finset.sum_ite_eq', Finset.mem_univ, if_true] + Finset.sum_ite_eq', Finset.mem_univ, ite_true] end PauliMatrix diff --git a/Physlib/Relativity/PauliMatrices/Relations.lean b/Physlib/Relativity/PauliMatrices/Relations.lean index 806a46097..4bc169a91 100644 --- a/Physlib/Relativity/PauliMatrices/Relations.lean +++ b/Physlib/Relativity/PauliMatrices/Relations.lean @@ -159,10 +159,17 @@ lemma dualWeyl_mul_pauliContr_eq_ofRat : lemma leviCivita_mul_pauliDual : ({ε4ℂ | μ ν ρ κ ⊗ σ^^^ | τ(κ) α β = ε4ℂ | μ ν ρ κ ⊗ σ_^^ | κ α β}ᵀ : Prop) := by - rw [pauliDual_eq_pauliCo, prodT_permT_right, contrT_permT] - apply permT_congr - · decide - · rfl + conv_lhs => + simp only [leviCivita_eq_ofRat, toTensor_dualLorentz_eq_ofRat] + rw [prodT_ofRat_ofRat, contrT_ofRat] + conv_rhs => + simp only [leviCivita_eq_ofRat, pauliCo_eq_ofRat] + rw [prodT_ofRat_ofRat, contrT_ofRat] + apply (Tensor.basis _).repr.injective + ext b + rw [ofRat_basis_repr_apply, permT_basis_repr_symm_apply, ofRat_basis_repr_apply] + apply (Function.Injective.eq_iff Physlib.RatComplexNum.toComplexNum_injective).mpr + decide +revert +kernel /-- Equation (2.26), the three-Pauli identity `σ^μ barσ^ν σ^ρ = g^{μν} σ^ρ - g^{μρ} σ^ν + g^{νρ} σ^μ diff --git a/Physlib/Relativity/PauliMatrices/ToTensor.lean b/Physlib/Relativity/PauliMatrices/ToTensor.lean index 4f432b9a9..d23048a4a 100644 --- a/Physlib/Relativity/PauliMatrices/ToTensor.lean +++ b/Physlib/Relativity/PauliMatrices/ToTensor.lean @@ -137,10 +137,10 @@ lemma toTensor_basis_expand : σ^^^ = all_goals simp all_goals - try rw [if_pos (by decide)] - try rw [if_neg (by decide)] - try rw [if_neg (by decide)] - try rw [if_pos (by decide)] + try rw [ite_eq_left (by decide)] + try rw [ite_eq_right (by decide)] + try rw [ite_eq_right (by decide)] + try rw [ite_eq_left (by decide)] simp [pauliMatrix] open Lorentz in diff --git a/Physlib/Relativity/SL2C/Basic.lean b/Physlib/Relativity/SL2C/Basic.lean index f6a872760..e61a1684f 100644 --- a/Physlib/Relativity/SL2C/Basic.lean +++ b/Physlib/Relativity/SL2C/Basic.lean @@ -216,7 +216,7 @@ lemma toLorentzGroup_eq_trace (M : SL(2,ℂ)) (i j : Fin 1 ⊕ Fin 3) : Module.Basis.coe_mk, AddSubmonoidClass.coe_finsetSum, selfAdjoint.val_smul, Matrix.mul_sum, Matrix.trace_sum, Matrix.mul_smul, Matrix.trace_smul, PauliMatrix.trace_pauliSelfAdjoint'_mul, smul_ite, smul_zero, Finset.sum_ite_eq, - Finset.mem_univ, if_true] at h + Finset.mem_univ, ite_true] at h rw [h, real_smul] ring diff --git a/Physlib/Relativity/SpeedOfLight.lean b/Physlib/Relativity/SpeedOfLight.lean index 1c58820b7..d5d1bc19b 100644 --- a/Physlib/Relativity/SpeedOfLight.lean +++ b/Physlib/Relativity/SpeedOfLight.lean @@ -5,7 +5,7 @@ Authors: Joseph Tooby-Smith -/ module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic /-! # The Speed of Light diff --git a/Physlib/Relativity/Tensors/Basic.lean b/Physlib/Relativity/Tensors/Basic.lean index eced9f489..8a8aefb65 100644 --- a/Physlib/Relativity/Tensors/Basic.lean +++ b/Physlib/Relativity/Tensors/Basic.lean @@ -378,7 +378,7 @@ instance {k : Type} [RCLike k] {C : Type} {G : Type} [Group G] {rep : (c : C) → Representation k G (V c)} {b : (c : C) → Basis (basisIdx c) k (V c)} (S : TensorSpecies k C G V basisIdx rep b) {c : Fin n → C} : IsTopologicalAddGroup (S.Tensor c) := - IsModuleTopology.topologicalAddGroup (R := k) (S.Tensor c) + IsModuleTopology.isTopologicalAddGroup (R := k) (S.Tensor c) /-! diff --git a/Physlib/Relativity/Tensors/ComplexTensor/OfRat.lean b/Physlib/Relativity/Tensors/ComplexTensor/OfRat.lean index 2cd33676d..ef90eb3d1 100644 --- a/Physlib/Relativity/Tensors/ComplexTensor/OfRat.lean +++ b/Physlib/Relativity/Tensors/ComplexTensor/OfRat.lean @@ -159,7 +159,7 @@ lemma contrT_ofRat {n : ℕ} {c : Fin (n + 1 + 1) → complexLorentzTensor.Color rw [Finset.sum_eq_single (Fin.cast (by simp [← h.2, repDim_tau]) x)] · simp · intro y _ hy - rw [if_neg] + rw [ite_eq_right] · simp · simp only [DropPairSection.ofFinEquiv_apply_fst, DropPairSection.ofFinEquiv_apply_snd] rw [@Fin.ne_iff_vne] at hy diff --git a/Physlib/Relativity/Tensors/ComplexTensor/Vector/Pre/Modules.lean b/Physlib/Relativity/Tensors/ComplexTensor/Vector/Pre/Modules.lean index ff5bf5b72..d2ccd0432 100644 --- a/Physlib/Relativity/Tensors/ComplexTensor/Vector/Pre/Modules.lean +++ b/Physlib/Relativity/Tensors/ComplexTensor/Vector/Pre/Modules.lean @@ -47,9 +47,13 @@ instance : AddCommMonoid ContrℂModule := Equiv.addCommMonoid toFin13ℂFun with `Fin 1 ⊕ Fin 3 → ℂ`. -/ instance : AddCommGroup ContrℂModule := Equiv.addCommGroup toFin13ℂFun +/-- The additive equivalence between `ContrℂModule` and `Fin 1 ⊕ Fin 3 → ℂ`. -/ +def toFin13ℂAddEquiv : ContrℂModule ≃+ (Fin 1 ⊕ Fin 3 → ℂ) := + { toFin13ℂFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `ContrℂModule` defined via its equivalence with `Fin 1 ⊕ Fin 3 → ℂ`. -/ -instance : Module ℂ ContrℂModule := Equiv.module ℂ toFin13ℂFun +instance : Module ℂ ContrℂModule := AddEquiv.module ℂ toFin13ℂAddEquiv @[ext] lemma ext (ψ ψ' : ContrℂModule) (h : ψ.val = ψ'.val) : ψ = ψ' := by @@ -67,7 +71,7 @@ lemma val_smul (r : ℂ) (ψ : ContrℂModule) : (r • ψ).val = r • ψ.val : /-- The linear equivalence between `ContrℂModule` and `(Fin 1 ⊕ Fin 3 → ℂ)`. -/ @[simps!] def toFin13ℂEquiv : ContrℂModule ≃ₗ[ℂ] (Fin 1 ⊕ Fin 3 → ℂ) := - Equiv.linearEquiv ℂ toFin13ℂFun + AddEquiv.linearEquiv ℂ toFin13ℂAddEquiv /-- The underlying element of `Fin 1 ⊕ Fin 3 → ℂ` of a element in `ContrℂModule` defined through the linear equivalence `toFin13ℂEquiv`. -/ @@ -119,9 +123,13 @@ instance : AddCommMonoid CoℂModule := Equiv.addCommMonoid toFin13ℂFun with `Fin 1 ⊕ Fin 3 → ℂ`. -/ instance : AddCommGroup CoℂModule := Equiv.addCommGroup toFin13ℂFun +/-- The additive equivalence between `CoℂModule` and `Fin 1 ⊕ Fin 3 → ℂ`. -/ +def toFin13ℂAddEquiv : CoℂModule ≃+ (Fin 1 ⊕ Fin 3 → ℂ) := + { toFin13ℂFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `CoℂModule` defined via its equivalence with `Fin 1 ⊕ Fin 3 → ℂ`. -/ -instance : Module ℂ CoℂModule := Equiv.module ℂ toFin13ℂFun +instance : Module ℂ CoℂModule := AddEquiv.module ℂ toFin13ℂAddEquiv @[ext] lemma ext (ψ ψ' : CoℂModule) (h : ψ.val = ψ'.val) : ψ = ψ' := by @@ -139,7 +147,7 @@ lemma val_smul (r : ℂ) (ψ : CoℂModule) : (r • ψ).val = r • ψ.val := r /-- The linear equivalence between `CoℂModule` and `(Fin 1 ⊕ Fin 3 → ℂ)`. -/ @[simps!] def toFin13ℂEquiv : CoℂModule ≃ₗ[ℂ] (Fin 1 ⊕ Fin 3 → ℂ) := - Equiv.linearEquiv ℂ toFin13ℂFun + AddEquiv.linearEquiv ℂ toFin13ℂAddEquiv /-- The underlying element of `Fin 1 ⊕ Fin 3 → ℂ` of a element in `CoℂModule` defined through the linear equivalence `toFin13ℂEquiv`. -/ diff --git a/Physlib/Relativity/Tensors/Constructors.lean b/Physlib/Relativity/Tensors/Constructors.lean index 0b526f01e..15334e01e 100644 --- a/Physlib/Relativity/Tensors/Constructors.lean +++ b/Physlib/Relativity/Tensors/Constructors.lean @@ -142,8 +142,7 @@ lemma actionT_fromPairT {c1 c2 : C} (g : G) : g • fromPairT (S := S) x = fromPairT (TensorProduct.map (rep c1 g) (rep c2 g) x) := by - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x y => simp only [Nat.succ_eq_add_one, Nat.reduceAdd, map_tmul] rw [fromPairT_tmul, ← permT_equivariant, ← prodT_equivariant, @@ -157,8 +156,7 @@ lemma fromPairT_map_right {c1 c2 c2' : C} (h :c2 = c2') fromPairT (TensorProduct.map LinearMap.id (LinearEquiv.cast (R := k) (M := V) h) x : _ ⊗[k] V c2') = permT id (by simp [h]) (fromPairT (S := S) x) := by - induction' x using TensorProduct.induction_on with x y x1 x2 h1 h2 - · simp + induction' x using TensorProduct.inductionOn with x y x1 x2 h1 h2 · simp only [Nat.succ_eq_add_one, Nat.reduceAdd, map_tmul, LinearMap.id_coe, id_eq, LinearEquiv.coe_coe] rw [fromPairT_tmul, fromPairT_tmul] @@ -175,8 +173,7 @@ lemma fromPairT_comm {c1 c2 : C} fromPairT (TensorProduct.comm k _ _ x) = permT ![1, 0] (And.intro (by decide) (fun i => by fin_cases i <;> simp)) (fromPairT (S := S) x) := by - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x y => simp only [Nat.succ_eq_add_one, Nat.reduceAdd, comm_tmul, Fin.isValue] rw [fromPairT_tmul, fromPairT_tmul, prodT_swap] @@ -263,8 +260,7 @@ lemma contrT_fromSingleT_fromPairT {c c2 : C} contrT 1 0 1 (by simp; rfl) (prodT (fromSingleT x) (fromPairT y)) = permT id (by simp; rfl) (fromSingleTContrFromPairT x y) := by - induction y using TensorProduct.induction_on with - | zero => simp only [fromSingleTContrFromPairT, map_zero, tmul_zero] + induction y using TensorProduct.inductionOn with | tmul y1 y2 => exact fromSingleT_contr_fromPairT_tmul x y1 y2 | add a b ha hb => simp only [fromSingleTContrFromPairT] at ha hb ⊢ @@ -314,11 +310,9 @@ lemma fromPairT_contr_fromPairT_eq_fromPairTContr (c c1 c2 : C) contrT 2 1 2 (by simp; rfl) (prodT (fromPairT x) (fromPairT y)) = permT id (by simp; exact ⟨rfl, rfl⟩) (fromPairTContr x y) := by - induction x using TensorProduct.induction_on with - | zero => simp only [fromPairTContr, map_zero, LinearMap.zero_apply, zero_tmul] + induction x using TensorProduct.inductionOn with | tmul x1 x2 => - induction y using TensorProduct.induction_on with - | zero => simp only [fromPairTContr, map_zero, tmul_zero] + induction y using TensorProduct.inductionOn with | tmul y1 y2 => simp only [Nat.reduceAdd, Nat.succ_eq_add_one, Fin.isValue] exact fromPairT_contr_fromPairT_eq_fromPairTContr_tmul c c1 c2 x1 x2 y1 y2 @@ -338,8 +332,7 @@ lemma fromPairT_basis_repr {c c1 : C} (φ : ComponentIdx ![c, c1]) : (basis ![c, c1]).repr (fromPairT (S := S) x) φ = (Basis.tensorProduct (b c) (b c1)).repr x (φ 0, φ 1) := by - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x y => simp only [Nat.succ_eq_add_one, Nat.reduceAdd, Fin.isValue, Basis.tensorProduct_repr_tmul_apply, smul_eq_mul] @@ -431,11 +424,9 @@ lemma actionT_fromTripleT {c1 c2 c3 : C} (x : V c1 ⊗[k] (V c2 ⊗[k] V c3)) (g : G) : g • fromTripleT (S := S) x = fromTripleT (TensorProduct.map (rep c1 g) (TensorProduct.map (rep c2 g) (rep c3 g)) x) := by - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x yz => - induction yz using TensorProduct.induction_on with - | zero => simp + induction yz using TensorProduct.inductionOn with | tmul y z => simp only [Nat.succ_eq_add_one, Nat.reduceAdd, map_tmul] rw [fromTripleT_tmul, fromTripleT_tmul] @@ -451,11 +442,9 @@ lemma fromTripleT_basis_repr {c c1 c2 : C} (basis ![c, c1, c2]).repr (fromTripleT (S := S) x) φ = (Basis.tensorProduct (b c) (Basis.tensorProduct (b c1) (b c2))).repr x (φ 0, φ 1, φ 2) := by - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x yz => - induction yz using TensorProduct.induction_on with - | zero => simp + induction yz using TensorProduct.inductionOn with | tmul y z => simp only [Nat.succ_eq_add_one, Nat.reduceAdd, Fin.isValue, Basis.tensorProduct_repr_tmul_apply, smul_eq_mul] diff --git a/Physlib/Relativity/Tensors/Contraction/SuccSuccAbove.lean b/Physlib/Relativity/Tensors/Contraction/SuccSuccAbove.lean index bd8164be6..cd86320bf 100644 --- a/Physlib/Relativity/Tensors/Contraction/SuccSuccAbove.lean +++ b/Physlib/Relativity/Tensors/Contraction/SuccSuccAbove.lean @@ -156,7 +156,8 @@ lemma succSuccAbove_eq_orderEmbOfFin {n : ℕ} (i j : Fin (n + 1 + 1)) (hij : i ≠ j) : succSuccAbove i j = Finset.orderEmbOfFin {i, j}ᶜ (by rw [Finset.card_compl]; simp [Finset.card_pair hij]) := by - apply ((succSuccAbove_strictMono i j).range_inj (OrderEmbedding.strictMono _)).mp + apply ((succSuccAbove_strictMono i j).range_inj_of_wellFoundedLT + (OrderEmbedding.strictMono _)).mp simp only [succSuccAbove_range hij, Finset.range_orderEmbOfFin, Finset.coe_compl, Finset.coe_insert, Finset.coe_singleton] diff --git a/Physlib/Relativity/Tensors/Evaluation.lean b/Physlib/Relativity/Tensors/Evaluation.lean index cab793b23..26a6879d2 100644 --- a/Physlib/Relativity/Tensors/Evaluation.lean +++ b/Physlib/Relativity/Tensors/Evaluation.lean @@ -322,8 +322,8 @@ lemma evalT_prodT_right {n n1 : ℕ} {c : Fin n → C} {c1 : Fin (n1 + 1) → C} · have hprod : ComponentIdx.prod.symm (b, b1) (Fin.natAdd (m := n1 + 1) n i) = basisIdxCongr (by simp) x := by simp [hi] - rw [prodT_basis', evalT_basis, if_pos hprod, permT_basis] - rw [evalT_basis, if_pos hi, prodT_basis'] + rw [prodT_basis', evalT_basis, ite_eq_left hprod, permT_basis] + rw [evalT_basis, ite_eq_left hi, prodT_basis'] congr ext j refine Fin.addCases (fun a => ?_) (fun a => ?_) j @@ -360,8 +360,8 @@ lemma evalT_prodT_right {n n1 : ℕ} {c : Fin n → C} {c1 : Fin (n1 + 1) → C} basisIdxCongr (by simp) x := by intro hprod exact hi (by simpa [ComponentIdx.prod] using hprod) - rw [prodT_basis', evalT_basis, if_neg hprod] - rw [evalT_basis, if_neg hi] + rw [prodT_basis', evalT_basis, ite_eq_right hprod] + rw [evalT_basis, ite_eq_right hi] simp · simp · simp [ht] @@ -431,7 +431,7 @@ lemma eq_sum_evalT {n : ℕ} {c : Fin (n + 1) → C} (t : Tensor S c) : basisIdxCongr_apply_apply] exact ComponentIdx.congr_right _ _ _ (by fin_cases j; rfl) · intro j h1 h1 - rw [if_neg (by grind)] + rw [ite_eq_right (by grind)] simp · simp · simp @@ -462,13 +462,13 @@ lemma eq_sum_evalT_zero {n : ℕ} {c : Fin (n + 1) → C} (t : Tensor S c) : ComponentIdx.single_symm_apply, basisIdxCongr_apply_apply] exact ComponentIdx.congr_right b 0 0 rfl · simp only [ComponentIdx.prod, Equiv.coe_fn_symm_mk, Fin.addCases] - rw [dif_neg (by simp)] + rw [dite_eq_right (by simp)] simp only [eqRec_eq_cast, basisIdxCongr, Equiv.cast_apply, cast_cast] symm rw [cast_eq_iff_heq] congr 1 · intro j h1 h1 - rw [if_neg (by grind)] + rw [ite_eq_right (by grind)] simp · simp · simp diff --git a/Physlib/Relativity/Tensors/LeviCivita/Contractions.lean b/Physlib/Relativity/Tensors/LeviCivita/Contractions.lean index bbf53fb6b..5ac1c2fa8 100644 --- a/Physlib/Relativity/Tensors/LeviCivita/Contractions.lean +++ b/Physlib/Relativity/Tensors/LeviCivita/Contractions.lean @@ -213,7 +213,7 @@ lemma leviCivita_basis_contract_three (a b : Fin 1 ⊕ Fin 3) : by_cases hab : a = b · subst hab simp [KroneckerDelta.eq_one_of_same] - · rw [if_neg hab, + · rw [ite_eq_right hab, KroneckerDelta.eq_zero_of_ne (fun h => hab (finSumFinEquiv.injective h))] norm_num diff --git a/Physlib/Relativity/Tensors/Product.lean b/Physlib/Relativity/Tensors/Product.lean index 908205f57..4723c72a5 100644 --- a/Physlib/Relativity/Tensors/Product.lean +++ b/Physlib/Relativity/Tensors/Product.lean @@ -488,8 +488,7 @@ noncomputable def tensorEquivProd {n n2 : ℕ} {c : Fin n → C} {c1 : Fin n2 (Tensor.basis c1) (ComponentIdx.prod b).2) let P (x : S.Tensor c ⊗[k] S.Tensor c1) := f (TensorProduct.lift prodT x) = x change P x - apply TensorProduct.induction_on - · simp [P] + apply TensorProduct.inductionOn · intro t1 t2 apply induction_on_basis (t := t1) · intro b1 diff --git a/Physlib/Relativity/Tensors/RealTensor/Metrics/Pre.lean b/Physlib/Relativity/Tensors/RealTensor/Metrics/Pre.lean index 212583142..d743082b1 100644 --- a/Physlib/Relativity/Tensors/RealTensor/Metrics/Pre.lean +++ b/Physlib/Relativity/Tensors/RealTensor/Metrics/Pre.lean @@ -144,7 +144,7 @@ lemma contrCoContract_apply_metric {d : ℕ} : rw [Finset.sum_eq_single_of_mem x (Finset.mem_univ x)] · simp [minkowskiMatrix.η_apply_mul_η_apply_diag, contrCoContract_basis] · intro b _ hb - simp [contrCoContract_basis, if_neg (Ne.symm hb)] + simp [contrCoContract_basis, ite_eq_right (Ne.symm hb)] rw [preCoContrUnit_apply_one, preCoContrUnitVal_expand_tmul] simp [map_sum] @@ -183,7 +183,7 @@ lemma coContrContract_apply_metric {d : ℕ} : rw [Finset.sum_eq_single_of_mem x (Finset.mem_univ x)] · simp [minkowskiMatrix.η_apply_mul_η_apply_diag, coContrContract_basis] · intro b _ hb - simp [coContrContract_basis, if_neg (Ne.symm hb)] + simp [coContrContract_basis, ite_eq_right (Ne.symm hb)] rw [preContrCoUnit_apply_one, preContrCoUnitVal_expand_tmul] simp [map_sum] diff --git a/Physlib/Relativity/Tensors/RealTensor/ToComplex.lean b/Physlib/Relativity/Tensors/RealTensor/ToComplex.lean index c9d2e04be..daa1b327b 100644 --- a/Physlib/Relativity/Tensors/RealTensor/ToComplex.lean +++ b/Physlib/Relativity/Tensors/RealTensor/ToComplex.lean @@ -181,7 +181,7 @@ lemma toComplex_repr {n} {c : Fin n → realLorentzTensor.Color} rw [toComplex_eq_sum_basis, map_sum] simp only [← Complex.coe_smul, map_smul, Finsupp.coe_finsetSum, Finset.sum_apply, Finsupp.smul_apply, Basis.repr_self, Finsupp.single_apply, smul_eq_mul, mul_ite, mul_one, - mul_zero, Finset.sum_ite_eq', Finset.mem_univ, if_true, Equiv.symm_apply_apply] + mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true, Equiv.symm_apply_apply] /-- `toComplex` sends basis elements to basis elements. -/ @[simp] diff --git a/Physlib/Relativity/Tensors/RealTensor/Vector/Pre/Modules.lean b/Physlib/Relativity/Tensors/RealTensor/Vector/Pre/Modules.lean index 6be54744e..787ea3f39 100644 --- a/Physlib/Relativity/Tensors/RealTensor/Vector/Pre/Modules.lean +++ b/Physlib/Relativity/Tensors/RealTensor/Vector/Pre/Modules.lean @@ -54,9 +54,13 @@ def toFin1dℝFun : ContrMod d ≃ (Fin 1 ⊕ Fin d → ℝ) where with `Fin 1 ⊕ Fin d → ℝ`. -/ instance : AddCommGroup (ContrMod d) := Equiv.addCommGroup toFin1dℝFun +/-- The additive equivalence between `ContrMod` and `Fin 1 ⊕ Fin d → ℝ`. -/ +def toFin1dℝAddEquiv : ContrMod d ≃+ (Fin 1 ⊕ Fin d → ℝ) := + { toFin1dℝFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `ContrMod` defined via its equivalence with `Fin 1 ⊕ Fin d → ℝ`. -/ -instance : Module ℝ (ContrMod d) := Equiv.module ℝ toFin1dℝFun +instance : Module ℝ (ContrMod d) := AddEquiv.module ℝ toFin1dℝAddEquiv @[simp] lemma val_add (ψ ψ' : ContrMod d) : (ψ + ψ').val = ψ.val + ψ'.val := rfl @@ -66,7 +70,7 @@ lemma val_smul (r : ℝ) (ψ : ContrMod d) : (r • ψ).val = r • ψ.val := rf /-- The linear equivalence between `ContrMod` and `(Fin 1 ⊕ Fin d → ℝ)`. -/ def toFin1dℝEquiv : ContrMod d ≃ₗ[ℝ] (Fin 1 ⊕ Fin d → ℝ) := - Equiv.linearEquiv ℝ toFin1dℝFun + AddEquiv.linearEquiv ℝ toFin1dℝAddEquiv /-- The underlying element of `Fin 1 ⊕ Fin d → ℝ` of a element in `ContrMod` defined through the linear equivalence `toFin1dℝEquiv`. -/ @@ -327,13 +331,17 @@ def toFin1dℝFun : CoMod d ≃ (Fin 1 ⊕ Fin d → ℝ) where with `Fin 1 ⊕ Fin d → ℝ`. -/ instance : AddCommGroup (CoMod d) := Equiv.addCommGroup toFin1dℝFun +/-- The additive equivalence between `CoℝModule` and `Fin 1 ⊕ Fin d → ℝ`. -/ +def toFin1dℝAddEquiv : CoMod d ≃+ (Fin 1 ⊕ Fin d → ℝ) := + { toFin1dℝFun with map_add' _ _ := rfl } + /-- The instance of `Module` on `CoℝModule` defined via its equivalence with `Fin 1 ⊕ Fin d → ℝ`. -/ -instance : Module ℝ (CoMod d) := Equiv.module ℝ toFin1dℝFun +instance : Module ℝ (CoMod d) := AddEquiv.module ℝ toFin1dℝAddEquiv /-- The linear equivalence between `CoℝModule` and `(Fin 1 ⊕ Fin d → ℝ)`. -/ def toFin1dℝEquiv : CoMod d ≃ₗ[ℝ] (Fin 1 ⊕ Fin d → ℝ) := - Equiv.linearEquiv ℝ toFin1dℝFun + AddEquiv.linearEquiv ℝ toFin1dℝAddEquiv /-- The underlying element of `Fin 1 ⊕ Fin d → ℝ` of a element in `CoℝModule` defined through the linear equivalence `toFin1dℝEquiv`. -/ diff --git a/Physlib/Relativity/Tensors/RealTensor/Vector/Tensorial.lean b/Physlib/Relativity/Tensors/RealTensor/Vector/Tensorial.lean index 452bbda0b..79ab182cd 100644 --- a/Physlib/Relativity/Tensors/RealTensor/Vector/Tensorial.lean +++ b/Physlib/Relativity/Tensors/RealTensor/Vector/Tensorial.lean @@ -144,8 +144,7 @@ lemma tensor_basis_repr_toTensor_prod_apply {d} (F : Vector d ⊗[ℝ] Vector d) (b : ComponentIdx (S := realLorentzTensor d) (Fin.append ![Color.up] ![Color.up])) : (Tensor.basis _).repr (toTensor F) b = (basis.tensorProduct basis).repr F (b 0, b 1) := by rw [Tensorial.basis_toTensor_apply, Tensorial.basis_map_prod] - simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Finsupp.mapDomain_equiv_apply, - Equiv.symm_symm, Fin.isValue] + simp only [Nat.reduceSucc, Nat.reduceAdd, Basis.repr_reindex, Fin.isValue] rw [tensor_basis_map_eq_basis_reindex] have hb : (((basis (d := d)).reindex indexEquiv.symm).tensorProduct (basis.reindex indexEquiv.symm)) = @@ -153,7 +152,7 @@ lemma tensor_basis_repr_toTensor_prod_apply {d} (F : Vector d ⊗[ℝ] Vector d) (indexEquiv.symm.prodCongr indexEquiv.symm) := by ext ⟨i, j⟩ simp - rw [hb, Module.Basis.repr_reindex_apply] + rw [hb, Finsupp.equivMapDomain_apply, Module.Basis.repr_reindex_apply] congr 1 /-! diff --git a/Physlib/Relativity/Tensors/Reindexing.lean b/Physlib/Relativity/Tensors/Reindexing.lean index e4d4195b0..a484048a7 100644 --- a/Physlib/Relativity/Tensors/Reindexing.lean +++ b/Physlib/Relativity/Tensors/Reindexing.lean @@ -62,7 +62,7 @@ lemma append_succAbove_const_eq_cycleIcc {n : ℕ} (i : Fin (n + 1)) : · rw [Fin.append_right] have : (Fin.natAdd n a : Fin (n + 1)) = Fin.last n := by apply Fin.ext; simp [Fin.val_natAdd] - rw [this, Fin.cycleIcc_of_le_of_le (Fin.le_last _) (Fin.le_last _), if_pos rfl] + rw [this, Fin.cycleIcc_of_le_of_le (Fin.le_last _) (Fin.le_last _), ite_eq_left rfl] end Fin diff --git a/Physlib/Relativity/Tensors/UnitTensor.lean b/Physlib/Relativity/Tensors/UnitTensor.lean index 1acf47e27..315f220df 100644 --- a/Physlib/Relativity/Tensors/UnitTensor.lean +++ b/Physlib/Relativity/Tensors/UnitTensor.lean @@ -51,8 +51,7 @@ lemma unitTensor_eq_permT_dual (c : C) : rw [unitTensor, fromConstPair] simp [fromPairT] generalize (S.unit (S.τ c)) 1 = u at * - induction' u using TensorProduct.induction_on with x y - · simp + induction' u using TensorProduct.inductionOn with x y · simp [fromSingleT_map] generalize (fromSingleT (S := S) y) = y at * generalize (fromSingleT (S := S) x) = x at * diff --git a/Physlib/SpaceAndTime/ReferenceFrame.lean b/Physlib/SpaceAndTime/ReferenceFrame.lean index a474f4ddd..869c31cf0 100644 --- a/Physlib/SpaceAndTime/ReferenceFrame.lean +++ b/Physlib/SpaceAndTime/ReferenceFrame.lean @@ -155,7 +155,8 @@ def componentEquiv : frame.Vector ≃ (Fin d → ℝ) := instance : AddCommGroup frame.Vector := componentEquiv.addCommGroup -instance : Module ℝ frame.Vector := componentEquiv.module ℝ +instance : Module ℝ frame.Vector := + AddEquiv.module ℝ { componentEquiv with map_add' _ _ := rfl } /-- Scalar multiplication by a positive real. -/ instance : SMul {x : ℝ // 0 < x} frame.Vector where diff --git a/Physlib/SpaceAndTime/Space/Derivatives/Basic.lean b/Physlib/SpaceAndTime/Space/Derivatives/Basic.lean index 9766708b3..0d9cf4d58 100644 --- a/Physlib/SpaceAndTime/Space/Derivatives/Basic.lean +++ b/Physlib/SpaceAndTime/Space/Derivatives/Basic.lean @@ -10,6 +10,7 @@ public import Physlib.Mathematics.Distribution.Basic public import Physlib.Relativity.Tensors.RealTensor.Vector.Basic public import Physlib.SpaceAndTime.Space.Module public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace /-! # Derivatives on Space diff --git a/Physlib/SpaceAndTime/Space/IsDistBounded.lean b/Physlib/SpaceAndTime/Space/IsDistBounded.lean index c437dfb55..77af3f643 100644 --- a/Physlib/SpaceAndTime/Space/IsDistBounded.lean +++ b/Physlib/SpaceAndTime/Space/IsDistBounded.lean @@ -237,7 +237,7 @@ lemma integrable_space_fderiv_mul {d : ℕ} {f : Space d → ℝ} (hf : IsDistBo instance {D1 : Type} [NormedAddCommGroup D1] [MeasurableSpace D1] {D2 : Type} [NormedAddCommGroup D2] [MeasurableSpace D2] (μ1 : Measure D1) (μ2 : Measure D2) - [Measure.HasTemperateGrowth μ1] [Measure.HasTemperateGrowth μ2] + [Measure.HasTemperateGrowth μ1] [Measure.HasTemperateGrowth μ2] [SFinite μ2] [OpensMeasurableSpace (D1 × D2)] : Measure.HasTemperateGrowth (μ1.prod μ2) where exists_integrable := by diff --git a/Physlib/SpaceAndTime/Space/Module.lean b/Physlib/SpaceAndTime/Space/Module.lean index c2070036a..50117b0ac 100644 --- a/Physlib/SpaceAndTime/Space/Module.lean +++ b/Physlib/SpaceAndTime/Space/Module.lean @@ -695,7 +695,7 @@ lemma basis_eq_mfderiv_modelDiffeo_single (d : ℕ) (μ : Fin d) (x : Space d) : CompTriple.comp_eq, modelWithCornersSelf_coe, Set.range_id, OpenPartialHomeomorph.coe_toPartialEquiv_symm, Homeomorph.toOpenPartialHomeomorph_symm_apply, fderivWithin_univ] - rw [if_pos (modelDiffeo.mdifferentiable (WithTop.top_ne_zero)).mdifferentiableAt] + rw [ite_eq_left (modelDiffeo.mdifferentiable (WithTop.top_ne_zero)).mdifferentiableAt] ext i have h := fderiv_space_components i ((⇑modelDiffeo ∘ ⇑(homEuclideanSpaceSpace d))) (by simpa [Function.comp_def, homEuclideanSpaceSpace] using by fun_prop) diff --git a/Physlib/SpaceAndTime/Time/Basic.lean b/Physlib/SpaceAndTime/Time/Basic.lean index aaabe0c33..d8b24f01a 100644 --- a/Physlib/SpaceAndTime/Time/Basic.lean +++ b/Physlib/SpaceAndTime/Time/Basic.lean @@ -5,7 +5,7 @@ Authors: Joseph Tooby-Smith -/ module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.LinearAlgebra.AffineSpace.Defs /-! # Time diff --git a/Physlib/SpaceAndTime/Time/Derivatives.lean b/Physlib/SpaceAndTime/Time/Derivatives.lean index 41e6234c8..5b1e98d29 100644 --- a/Physlib/SpaceAndTime/Time/Derivatives.lean +++ b/Physlib/SpaceAndTime/Time/Derivatives.lean @@ -10,6 +10,7 @@ public import Physlib.SpaceAndTime.Space.Module public import Physlib.SpaceAndTime.Time.InnerProductSpace public import Mathlib.Analysis.Calculus.Deriv.Inv public import Mathlib.Analysis.InnerProductSpace.Calculus +public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace /-! # Time Derivatives diff --git a/Physlib/SpaceAndTime/Time/TimeTransMan.lean b/Physlib/SpaceAndTime/Time/TimeTransMan.lean index 460e8315d..ec80c5dbb 100644 --- a/Physlib/SpaceAndTime/Time/TimeTransMan.lean +++ b/Physlib/SpaceAndTime/Time/TimeTransMan.lean @@ -276,11 +276,11 @@ lemma diff_fst_surjective (x : TimeUnit) (t : TimeTransMan) : rw [abs_of_nonneg (le_of_lt (PositiveRealUnitCore.pos x))] simp only [ne_eq, PositiveRealUnitCore.val_ne_zero, not_false_eq_true, inv_mul_cancel_left₀] by_cases h : 0 ≤ r - · rw [if_pos] + · rw [ite_eq_left] exact abs_of_nonneg h simp [le_def] apply mul_nonneg (le_of_lt (PositiveRealUnitCore.pos x)) h - · rw [if_neg] + · rw [ite_eq_right] rw [abs_of_neg (by simpa using h)] simp only [neg_neg] simp [le_def] diff --git a/Physlib/SpaceAndTime/TimeAndSpace/EuclideanGroup/Action.lean b/Physlib/SpaceAndTime/TimeAndSpace/EuclideanGroup/Action.lean index 256a6c804..7dd5fc23d 100644 --- a/Physlib/SpaceAndTime/TimeAndSpace/EuclideanGroup/Action.lean +++ b/Physlib/SpaceAndTime/TimeAndSpace/EuclideanGroup/Action.lean @@ -148,6 +148,6 @@ lemma isometry_smul (g : EuclideanGroup d) : /-- The Euclidean-group action on `TimeAndSpace d` is antilipschitz. -/ lemma antilipschitz_smul (g : EuclideanGroup d) : AntilipschitzWith 1 (fun tx : TimeAndSpace d => g • tx) := - (isometry_smul g).antilipschitz + (isometry_smul g).antilipschitzWith end TimeAndSpace diff --git a/Physlib/StatisticalMechanics/BoltzmannConstant.lean b/Physlib/StatisticalMechanics/BoltzmannConstant.lean index 9836dfe8b..9c033a0f1 100644 --- a/Physlib/StatisticalMechanics/BoltzmannConstant.lean +++ b/Physlib/StatisticalMechanics/BoltzmannConstant.lean @@ -5,7 +5,7 @@ Authors: Joseph Tooby-Smith -/ module -public import Mathlib.Data.NNReal.Defs +public import Mathlib.Basic.NNReal.Defs /-! # Boltzmann constant diff --git a/Physlib/StatisticalMechanics/CanonicalEnsemble/Basic.lean b/Physlib/StatisticalMechanics/CanonicalEnsemble/Basic.lean index 61ccd42cd..123a4946e 100644 --- a/Physlib/StatisticalMechanics/CanonicalEnsemble/Basic.lean +++ b/Physlib/StatisticalMechanics/CanonicalEnsemble/Basic.lean @@ -465,6 +465,7 @@ lemma μProd_add {T : Temperature} [IsFiniteMeasure (𝓒.μBolt T)] lemma μProd_congr (e : ι1 ≃ᵐ ι) (T : Temperature) : (𝓒.congr e).μProd T = (𝓒.μProd T).map e.symm := by rw [μProd, μProd, μBolt_congr, Measure.map_smul, MeasurableEquiv.map_apply, Set.preimage_univ] + exact e.symm.measurable.aemeasurable lemma μProd_nsmul (n : ℕ) (T : Temperature) [IsFiniteMeasure (𝓒.μBolt T)] : (nsmul n 𝓒).μProd T = MeasureTheory.Measure.pi fun _ => 𝓒.μProd T := by diff --git a/Physlib/StringTheory/FTheory/SU5/Quanta/TenQuanta.lean b/Physlib/StringTheory/FTheory/SU5/Quanta/TenQuanta.lean index c25506f91..ec06dd74b 100644 --- a/Physlib/StringTheory/FTheory/SU5/Quanta/TenQuanta.lean +++ b/Physlib/StringTheory/FTheory/SU5/Quanta/TenQuanta.lean @@ -206,7 +206,7 @@ lemma reduce_filter (x : TenQuanta 𝓩) (q : 𝓩) (h : q ∈ x.toCharges) : rw [Multiset.filter_map] simp only [Function.comp_apply] have hx : (Multiset.filter (fun x => x = q) x.toCharges.dedup) = {q} := by - rw [Multiset.filter_eq', Multiset.count_dedup, if_pos h, Multiset.replicate_one] + rw [Multiset.filter_eq', Multiset.count_dedup, ite_eq_left h, Multiset.replicate_one] rw [hx] simp diff --git a/Physlib/Units/Integral.lean b/Physlib/Units/Integral.lean index 9bd14789d..74e06d434 100644 --- a/Physlib/Units/Integral.lean +++ b/Physlib/Units/Integral.lean @@ -46,8 +46,9 @@ noncomputable instance (M : Type) · exact measurable_const_smul (α := M) ↑(u2.dimScale u3 (dim M)).1 scaleUnit_id u μ := by simp [scaleUnit_id] - scaleUnit_mul u1 u2 r μ := by - simp + scaleUnit_mul u1 u2 r μ := + Measure.map_smul r + (measurable_const_smul (α := M) ↑(u1.dimScale u2 (dim M)).1).aemeasurable variable {M : Type} [NormedAddCommGroup M] [NormedSpace ℝ M] [HasDim M] [MeasurableSpace M] [MeasurableConstSMul ℝ M] diff --git a/PhyslibAlpha/AlgebraicFramework/Algebra/Derivation.lean b/PhyslibAlpha/AlgebraicFramework/Algebra/Derivation.lean index 171c19085..7e8d88ebe 100644 --- a/PhyslibAlpha/AlgebraicFramework/Algebra/Derivation.lean +++ b/PhyslibAlpha/AlgebraicFramework/Algebra/Derivation.lean @@ -6,7 +6,7 @@ Authors: Tom Ole Diem module public import Mathlib.Algebra.Module.LinearMap.Defs -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Tactic.Abel /-! diff --git a/PhyslibAlpha/AlgebraicFramework/Algebra/Statistics.lean b/PhyslibAlpha/AlgebraicFramework/Algebra/Statistics.lean index 1aa8611ba..2aa6cc041 100644 --- a/PhyslibAlpha/AlgebraicFramework/Algebra/Statistics.lean +++ b/PhyslibAlpha/AlgebraicFramework/Algebra/Statistics.lean @@ -5,7 +5,7 @@ Authors: Tom Ole Diem -/ module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.LinearAlgebra.BilinearForm.Properties /-! diff --git a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Jordan.lean b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Jordan.lean index 330aa106e..32ff21ae1 100644 --- a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Jordan.lean +++ b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Jordan.lean @@ -129,7 +129,7 @@ theorem norm_mul_self_le_add' (a b : selfAdjoint A) : ‖a * a‖ ≤ ‖a * a + have h0' : (0 : A) ≤ (a : A) * (a : A) := by calc (0 : A) ≤ star (a : A) * (a : A) := star_mul_self_nonneg _ _ = (a : A) * (a : A) := by rw [a.2] - exact CStarAlgebra.norm_le_norm_of_nonneg_of_le h0' (le_add_of_nonneg_right h0) + exact CStarAlgebra.norm_le_norm_of_le_of_nonneg (le_add_of_nonneg_right h0) h0' /-- `selfAdjoint A`, for any unital C⋆-algebra `A`, is a JB-algebra under the normalized Jordan product: the canonical realization at the head of the architecture diff --git a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/SpectralMeasure.lean b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/SpectralMeasure.lean index 706c1843b..d19acf50c 100644 --- a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/SpectralMeasure.lean +++ b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/SpectralMeasure.lean @@ -142,7 +142,7 @@ noncomputable def realSpectralMeasure (ω : 𝓢[A]) (a : Observable A) : Measur instance realSpectralMeasure_isProbabilityMeasure (ω : 𝓢[A]) (a : Observable A) : IsProbabilityMeasure (realSpectralMeasure ω a) := - Measure.isProbabilityMeasure_map measurable_subtype_coe.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_subtype_coe.aemeasurable).mpr inferInstance /-- `μ_{ω,a}` is concentrated on `a`'s spectrum. -/ lemma realSpectralMeasure_compl_spectrum (ω : 𝓢[A]) (a : Observable A) : diff --git a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Dilation.lean b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Dilation.lean index 4338cdd06..f242b9050 100644 --- a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Dilation.lean +++ b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Dilation.lean @@ -9,6 +9,8 @@ public import PhyslibAlpha.AlgebraicFramework.CStarAlgebra.Stinespring.Kernel public import Mathlib.LinearAlgebra.TensorProduct.Finiteness public import Mathlib.Analysis.InnerProductSpace.Completion public import Mathlib.Topology.Algebra.LinearMapCompletion +public import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +public import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order /-! @@ -140,11 +142,9 @@ lemma tensorInner_conj_symm_tmul (J : A →CP (H →L[ℂ] H)) (a b : A) (h k : lemma tensorInner_conj_symm (J : A →CP (H →L[ℂ] H)) (x y : T A H) : starRingEnd ℂ (tensorInner J x y) = tensorInner J y x := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro a h - refine TensorProduct.induction_on y ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn y ?_ ?_ · intro b k exact tensorInner_conj_symm_tmul J a b h k · intro y z ihy ihz @@ -198,11 +198,9 @@ lemma leftMul_tmul (a b : A) (h : H) : lemma tensorInner_leftMul (J : A →CP (H →L[ℂ] H)) (a : A) (x y : T A H) : tensorInner J (leftMul a x) y = tensorInner J x (leftMul (star a) y) := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro b h - refine TensorProduct.induction_on y ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn y ?_ ?_ · intro c k simp [leftMul, star_mul, mul_assoc] · intro y z ihy ihz @@ -213,8 +211,7 @@ lemma tensorInner_leftMul (J : A →CP (H →L[ℂ] H)) (a : A) (x y : T A H) : lemma leftMul_mul (a b : A) (x : T A H) : leftMul (a * b) x = leftMul a (leftMul b x) := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro c h simp [leftMul] · intro x y ihx ihy @@ -222,8 +219,7 @@ lemma leftMul_mul (a b : A) (x : T A H) : lemma leftMul_add (a b : A) (x : T A H) : leftMul (a + b) x = leftMul a x + leftMul b x := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro c h simp [leftMul, add_mul, TensorProduct.add_tmul] · intro x y ihx ihy @@ -233,8 +229,7 @@ lemma leftMul_add (a b : A) (x : T A H) : lemma leftMul_smul (r : ℂ) (a : A) (x : T A H) : leftMul (r • a) x = r • leftMul a x := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro b h rw [leftMul_tmul, leftMul_tmul] rw [smul_mul_assoc] @@ -243,8 +238,7 @@ lemma leftMul_smul (r : ℂ) (a : A) (x : T A H) : rw [(leftMul (r • a)).map_add, (leftMul a).map_add, ihx, ihy, smul_add] lemma leftMul_one (x : T A H) : leftMul (1 : A) x = x := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro a h simp [leftMul] · intro x y ihx ihy @@ -253,8 +247,7 @@ lemma leftMul_one (x : T A H) : leftMul (1 : A) x = x := by lemma leftMul_norm_sub (a : A) (x : T A H) : leftMul ((‖a‖ ^ 2 : ℝ) • (1 : A) - star a * a) x = (‖a‖ ^ 2 : ℂ) • x - leftMul (star a * a) x := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro b h simp [leftMul, Algebra.smul_def, sub_mul, TensorProduct.sub_tmul] simp [Algebra.smul_def, TensorProduct.smul_tmul'] diff --git a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Kernel.lean b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Kernel.lean index 08d342af5..02612b77f 100644 --- a/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Kernel.lean +++ b/PhyslibAlpha/AlgebraicFramework/CStarAlgebra/Stinespring/Kernel.lean @@ -10,6 +10,7 @@ public import Mathlib.Analysis.CStarAlgebra.CStarMatrix public import Mathlib.Analysis.InnerProductSpace.PiL2 public import Mathlib.Analysis.InnerProductSpace.Positive public import Mathlib.Analysis.InnerProductSpace.StarOrder +public import Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart /-! @@ -161,7 +162,7 @@ def blockMatrixRepresentation {n : ℕ} : lemma blockMatrixMap_isPositive {n : ℕ} {M : CStarMatrix (Fin n) (Fin n) (H →L[ℂ] H)} (hM : 0 ≤ M) : (blockMatrixMap M).IsPositive := by - apply (ContinuousLinearMap.nonneg_iff_isPositive _).mp + apply ContinuousLinearMap.nonneg_iff_isPositive.mp change 0 ≤ (blockMatrixRepresentation (H := H) (n := n)) M exact map_nonneg (blockMatrixRepresentation (H := H) (n := n)) hM diff --git a/PhyslibAlpha/AlgebraicFramework/Dynamics/OneParameterGroup.lean b/PhyslibAlpha/AlgebraicFramework/Dynamics/OneParameterGroup.lean index 6cc9637a2..93585272f 100644 --- a/PhyslibAlpha/AlgebraicFramework/Dynamics/OneParameterGroup.lean +++ b/PhyslibAlpha/AlgebraicFramework/Dynamics/OneParameterGroup.lean @@ -5,7 +5,7 @@ Authors: Tom Ole Diem -/ module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Logic.Function.Basic /-! diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Dynamics/Automorphism.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Dynamics/Automorphism.lean index 1542ac100..31f0b985a 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Dynamics/Automorphism.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Dynamics/Automorphism.lean @@ -122,7 +122,7 @@ theorem hasDerivAt_toAutomorphism (U : UnitaryOneParameterGroup H) (a : H →L[ simp only [toAutomorphism_apply, LieRing.of_associative_ring_bracket] have hcomm := (U.commute_generator t).smul_left Complex.I have hd := ((U.hasDerivAt t).mul_const a).mul (U.hasDerivAt_star t) - convert hd using 1 <;> try rfl + convert hd using 1; try rfl simp only [mul_neg] rw [← hcomm.eq] noncomm_ring @@ -148,7 +148,7 @@ private lemma hasDerivAt_conj_zero (U : UnitaryOneParameterGroup H) simp only [LieRing.of_associative_ring_bracket] at hα have hcomm := (U.commute_generator s).smul_left Complex.I have hd := ((U.hasDerivAt_star s).mul (hα s)).mul (U.hasDerivAt s) - convert hd using 1 <;> try rfl + convert hd using 1; try rfl simp only [Pi.mul_apply, mul_neg] rw [← hcomm.eq] noncomm_ring diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/State/Vector.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/State/Vector.lean index 814161b78..8ffee114a 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/State/Vector.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/State/Vector.lean @@ -33,7 +33,7 @@ def PositiveLinearMap.ofVec (ψ : H) : 𝓟[𝕜, H →L[𝕜] H] where map_add' x y := by simp [inner_add_right] map_smul' x y := by simp [inner_smul_right] monotone' x y hxy := by - simpa [inner_sub_right] using ((le_def x y).mp hxy).inner_nonneg_right ψ + simpa [inner_sub_right] using (le_def.mp hxy).inner_nonneg_right ψ /-- The vector state associated with a unit vector. -/ @[simps! apply] diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Trace.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Trace.lean index 45af3bf20..5486bb2c9 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Trace.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Trace.lean @@ -56,6 +56,7 @@ noncomputable def traceₚ : (E →L[ℂ] E) →ₚ[ℂ] ℂ := .mk₀ (fun x h ↦ by simpa using (x.isPositive_toLinearMap_iff.mpr (x.nonneg_iff_isPositive.mp h)).trace_nonneg) +omit [CompleteSpace E] in /-- The trace is a tracial functional: cyclic under multiplication, connecting the concrete Hilbert-space trace here to `LinearMap.IsTracial` from `StarAlgebra/Traciality.lean`. -/ lemma traceₚ_isTracial : (traceₚ (E := E)).toLinearMap.IsTracial := diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/Basic.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/Basic.lean index a5c921d06..95fd11a7d 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/Basic.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/Basic.lean @@ -351,6 +351,7 @@ theorem traceNorm_nonneg (T : H →L[ℂ] H) (h : IsTraceClass T) : 0 ≤ traceN exact tsum_nonneg fun i => real_inner_nonneg_of_nonneg (CFC.abs_nonneg T) (h.choose_spec.choose i) +omit [CompleteSpace H] in private lemma real_inner_mono_of_le {P Q : H →L[ℂ] H} (hPQ : P ≤ Q) (x : H) : (⟪x, P x⟫_ℂ).re ≤ (⟪x, Q x⟫_ℂ).re := by have hdiff : 0 ≤ Q - P := sub_nonneg.mpr hPQ diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/RankOne.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/RankOne.lean index 3948b56ce..9d31392af 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/RankOne.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/TraceClass/RankOne.lean @@ -46,7 +46,7 @@ theorem isTraceClass_rankOne_self (x : H) : have h := (hasSum_norm_sq_inner_basis b x).summable apply h.congr intro i - simpa only [rankOne_self_diagonal, ← inner_conj_symm x (b i), RCLike.norm_conj] + simp only [rankOne_self_diagonal, ← inner_conj_symm x (b i), RCLike.norm_conj] theorem trace_rankOne_self (x : H) : trace (InnerProductSpace.rankOne ℂ x x) (isTraceClass_rankOne_self x) = @@ -77,6 +77,6 @@ theorem traceNorm_rankOne_self (x : H) : funext i rw [CFC.abs_of_nonneg _ ((InnerProductSpace.rankOne ℂ x x).nonneg_iff_isPositive.mpr (InnerProductSpace.isPositive_rankOne_self x))] - simpa only [rankOne_self_diagonal, ← inner_conj_symm x (b i), RCLike.norm_conj] + simp only [rankOne_self_diagonal, ← inner_conj_symm x (b i), RCLike.norm_conj] rw [hdiag] exact h.tsum_eq diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Basic.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Basic.lean index 7aeb0db49..3df0ba789 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Basic.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Basic.lean @@ -647,7 +647,6 @@ lemma analyticExp_inner_deficiency_hasDerivAt exact sub_eq_zero.mp horth have hinner := (hasDerivAt_const (x := s) y).inner ℂ hderiv convert hinner using 1 - · rfl · simp only [inner_zero_left, inner_smul_right] rw [hrelation] ring_nf @@ -678,8 +677,6 @@ lemma analyticExp_inner_deficiency_eq_zero simpa only [hz] using hp change HasDerivAt (fun r : ℝ => (Real.exp r : ℂ) * f r) 0 s convert hp' using 1 - funext r - rfl have hconst : ∀ s : ℝ, g s = g 0 := by intro s exact is_const_of_deriv_eq_zero (fun r => (hg r).differentiableAt) @@ -754,7 +751,6 @@ lemma analyticExp_inner_deficiency_hasDerivAt_neg let _ : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H have hinner := (hasDerivAt_const (x := s) y).inner ℂ hderiv convert hinner using 1 - · rfl · simp only [inner_zero_left, inner_smul_right] rw [hrelation] ring_nf @@ -790,8 +786,6 @@ lemma analyticExp_inner_deficiency_eq_zero_neg simpa only [hz] using hp change HasDerivAt (fun r : ℝ => (Real.exp (-r) : ℂ) * f r) 0 s convert hp' using 1 - funext r - rfl have hconst : ∀ s : ℝ, g s = g 0 := by intro s exact is_const_of_deriv_eq_zero (fun r => (hg r).differentiableAt) diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Local.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Local.lean index 9c03386be..4f128d167 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Local.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/AnalyticVector/Local.lean @@ -1048,7 +1048,6 @@ lemma inner_deficiency_eq_zero (-⟪y, U s⟫_ℂ) s := by have hinner := (hasDerivAt_const (x := s) y).inner ℂ (U.hasDerivAt s) convert hinner using 1 - · rfl · simp only [inner_zero_left, inner_smul_right] rw [hrelation] ring_nf @@ -1065,8 +1064,6 @@ lemma inner_deficiency_eq_zero simpa only [hz] using hp change HasDerivAt (fun r : ℝ => (Real.exp r : ℂ) * f r) 0 s convert hp' using 1 - funext r - rfl have hconst : ∀ s : ℝ, g s = g 0 := by intro s exact is_const_of_deriv_eq_zero (fun r => (hg r).differentiableAt) @@ -1132,7 +1129,6 @@ lemma inner_deficiency_eq_zero_neg (⟪y, U s⟫_ℂ) s := by have hinner := (hasDerivAt_const (x := s) y).inner ℂ (U.hasDerivAt s) convert hinner using 1 - · rfl · simp only [inner_zero_left, inner_smul_right] rw [hrelation] ring_nf @@ -1155,8 +1151,6 @@ lemma inner_deficiency_eq_zero_neg simpa only [hz] using hp change HasDerivAt (fun r : ℝ => (Real.exp (-r) : ℂ) * f r) 0 s convert hp' using 1 - funext r - rfl have hconst : ∀ s : ℝ, g s = g 0 := by intro s exact is_const_of_deriv_eq_zero (fun r => (hg r).differentiableAt) diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Basic.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Basic.lean index f05011f05..b47058259 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Basic.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Basic.lean @@ -7,6 +7,7 @@ module public import Physlib.QuantumMechanics.Operators.SpectralTheory.SpectralMeasure public import Mathlib.Analysis.InnerProductSpace.WeakOperatorTopology +public import Mathlib.MeasureTheory.VectorMeasure.Operations /-! diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/BoundedIntegral.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/BoundedIntegral.lean index 3fa059222..411c7a626 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/BoundedIntegral.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/BoundedIntegral.lean @@ -8,7 +8,11 @@ module public import PhyslibAlpha.AlgebraicFramework.HilbertSpace.Unbounded.ScalarMeasure public import Mathlib.MeasureTheory.Measure.Complex public import Mathlib.MeasureTheory.Integral.IntegrableOn -public import Mathlib.MeasureTheory.Integral.SetToL1 +public import Mathlib.MeasureTheory.Integral.SetToL1.ChangeMeasure +public import Mathlib.MeasureTheory.Integral.SetToL1.DominatedConvergence +public import Mathlib.MeasureTheory.Integral.SetToL1.Function +public import Mathlib.MeasureTheory.Integral.SetToL1.L1 +public import Mathlib.MeasureTheory.Integral.SetToL1.SimpleFunc /-! diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Basic.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Basic.lean index ab5f63392..ccad4eb42 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Basic.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Basic.lean @@ -76,7 +76,7 @@ lemma cayley_im (x : ℝ) : (cayley x).im = (-2 * x) / (x ^ 2 + 1) := by ring_nf lemma cayleyInverse_cayley (x : ℝ) : cayleyInverse (cayley x) = x := by - rw [cayleyInverse, if_neg (cayley_ne_one x), cayley_im, cayley_re] + rw [cayleyInverse, ite_eq_right (cayley_ne_one x), cayley_im, cayley_re] have h : x ^ 2 + 1 ≠ 0 := by nlinarith [sq_nonneg x] field_simp ring @@ -104,7 +104,7 @@ lemma cayley_cayleyInverse {z : ℂ} (hz : ‖z‖ = 1) (hz1 : z ≠ 1) : apply hz1 apply Complex.ext <;> assumption rw [Complex.ext_iff] - simp only [cayleyInverse, if_neg hz1] + simp only [cayleyInverse, ite_eq_right hz1] rw [cayley_re, cayley_im] have hx : (-(z.im) / (1 - z.re)) ^ 2 + 1 ≠ 0 := by positivity @@ -163,7 +163,7 @@ lemma cayleyPMap_domain_top {T : H →ₗ.[ℂ] H} (hT : IsSelfAdjoint T) : ⟨x, by rw [hinvdom]; exact Submodule.mem_top⟩ have hv' : (T + Complex.I • 1).inverse xi ∈ (T + Complex.I • 1).domain := by - rw [← LinearPMap.inverse_range hker] + rw [← LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hker)] exact LinearMap.mem_range_self _ xi have hv : (T + Complex.I • 1).inverse xi ∈ T.domain := hplusdom ▸ hv' have hxi' : xi ∈ @@ -220,7 +220,7 @@ lemma cayleyPMap_eq_one_sub {T : H →ₗ.[ℂ] H} (hT : IsSelfAdjoint T) : let xi : (T + Complex.I • 1).inverse.domain := ⟨x, by rw [hinvdom]; exact Submodule.mem_top⟩ have hxi : (T + Complex.I • 1).inverse xi ∈ (T + Complex.I • 1).domain := by - rw [← LinearPMap.inverse_range hker] + rw [← LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hker)] exact LinearMap.mem_range_self _ xi have hxi_range : (x : H) ∈ LinearMap.range (T + Complex.I • 1).toFun := by rw [← LinearPMap.inverse_domain] @@ -230,7 +230,7 @@ lemma cayleyPMap_eq_one_sub {T : H →ₗ.[ℂ] H} (hT : IsSelfAdjoint T) : change (T + Complex.I • 1) x₀ = x exact hx₀ have hinv₀ : (T + Complex.I • 1).inverse xi = x₀ := - LinearPMap.inverse_apply_eq hker hxy + LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hker) hxy have hinv : (T + Complex.I • 1) ⟨(T + Complex.I • 1).inverse xi, hxi⟩ = x := by have heq : (⟨(T + Complex.I • 1).inverse xi, hxi⟩ : @@ -360,7 +360,7 @@ lemma cayleyContinuousLinearMap_apply_of_mem_range {T : H →ₗ.[ℂ] H} exact Submodule.mem_top have hminus_inv : (T - (-Complex.I) • 1).inverse ⟨x, hxinv⟩ = hyminus := by - exact LinearPMap.inverse_apply_eq hres.1 hyminus_eq + exact LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hres.1) hyminus_eq have hc : Continuous (T - (-Complex.I) • 1).inverse.toFun := hres.2.2 simp only [cayleyContinuousLinearMap, sub_apply, smul_apply] rw [topDomainToContinuousLinearMap_apply _ _ hc] diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Inverse.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Inverse.lean index 498178cbb..8539faff0 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Inverse.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/Cayley/Inverse.lean @@ -232,14 +232,14 @@ omit [CompleteSpace H] in lemma linearPMap_comp_inverse_apply {Q : H →ₗ.[ℂ] H} (hker : Q.toFun.ker = ⊥) (y : Q.inverse.domain) : Q (⟨Q.inverse y, by - rw [← LinearPMap.inverse_range hker] + rw [← LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hker)] exact LinearMap.mem_range_self _ y⟩ : Q.domain) = y := by have hc := LinearPMap.compRestricted_inverse_eq hker obtain ⟨hcd, hcf⟩ := LinearPMap.dExt_iff.mp hc let ac : (Q ∘ᵣ Q.inverse).domain := ⟨(y : H), by refine LinearPMap.mem_compRestricted_domain_iff.mpr ⟨y.property, ?_⟩ - rw [← LinearPMap.inverse_range hker] + rw [← LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hker)] exact LinearMap.mem_range_self _ y⟩ let ad : (LinearPMap.domRestrict (1 : H →ₗ.[ℂ] H) Q.inverse.domain).domain := ⟨(y : H), by @@ -281,7 +281,8 @@ lemma inverseCayleyPMap_cayleyUnitary_domain {T : H →ₗ.[ℂ] H} simp only [LinearPMap.sub_apply, LinearPMap.smul_apply] module have hrange : (1 - unitaryToPMap (cayleyUnitary T hT)).toFun.range = T.domain := by - rw [hEq, linearPMap_range_smul _ (by norm_num), LinearPMap.inverse_range hplusker] + rw [hEq, linearPMap_range_smul _ (by norm_num), + LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hplusker)] simp [LinearPMap.add_domain] rw [inverseCayleyPMap_domain, hrange] @@ -297,7 +298,7 @@ lemma inverseCayleyPMap_apply_on_range {u : H ≃ₗᵢ[ℂ] H} rw [LinearPMap.inverse_domain] exact LinearMap.mem_range_self _ a⟩ have hy : (1 - unitaryToPMap u).inverse y = a := by - apply LinearPMap.inverse_apply_eq hker + apply LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hker) rfl simp only [inverseCayleyPMap, LinearPMap.mul_def, LinearPMap.compRestricted_apply, LinearPMap.smul_apply] @@ -351,7 +352,7 @@ lemma inverseCayleyPMap_cayleyUnitary {T : H →ₗ.[ℂ] H} exact Submodule.mem_top⟩ let zp : (T + Complex.I • (1 : H →ₗ.[ℂ] H)).domain := ⟨(T + Complex.I • (1 : H →ₗ.[ℂ] H)).inverse ai, by - rw [← LinearPMap.inverse_range hplusker] + rw [← LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hplusker)] exact LinearMap.mem_range_self _ ai⟩ let zpT : T.domain := ⟨(zp : H), by simpa [LinearPMap.add_domain] using zp.property⟩ diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/Construction.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/Construction.lean index 36e6e9863..fd8e29078 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/Construction.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/Construction.lean @@ -433,7 +433,7 @@ lemma cayleyBoundedOperator_one_eigenspace_eq_bot let xi : (T + Complex.I • 1).inverse.domain := ⟨x, by rw [hinvdom]; exact Submodule.mem_top⟩ have hxi : (T + Complex.I • 1).inverse xi ∈ (T + Complex.I • 1).domain := by - rw [← LinearPMap.inverse_range hker] + rw [← LinearPMap.inverse_range (LinearPMap.toFun_ker_eq_bot_iff.mp hker)] exact LinearMap.mem_range_self _ xi let y : (T + Complex.I • 1).domain := ⟨(T + Complex.I • 1).inverse xi, hxi⟩ @@ -445,7 +445,7 @@ lemma cayleyBoundedOperator_one_eigenspace_eq_bot change (T + Complex.I • 1) x₀ = x exact hx₀ have hinv₀ : (T + Complex.I • 1).inverse xi = x₀ := - LinearPMap.inverse_apply_eq hker hxy + LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hker) hxy have hy : (T + Complex.I • 1) y = x := by have heq : y = x₀ := Subtype.ext hinv₀ rw [heq] diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/SpecTheorem.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/SpecTheorem.lean index 607f97c45..99f42e0a3 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/SpecTheorem.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/CayleySpectralData/SpecTheorem.lean @@ -451,7 +451,8 @@ lemma VectorMeasure.integral_real_withDensity_mul exact (Lp.aestronglyMeasurable f).sub (Lp.aestronglyMeasurable k) |>.enorm rw [hlin, ← hvar] - rw [← eLpNorm_one_eq_lintegral_enorm] + rw [← eLpNorm_one_eq_lintegral_enorm (f := fun x => f x - k x) + ((Lp.aestronglyMeasurable f).sub (Lp.aestronglyMeasurable k))] have he : eLpNorm (fun x => f x - k x) 1 (μ.withDensity q B).variation = eLpNorm (⇑(f - k)) 1 (μ.withDensity q B).variation := eLpNorm_congr_ae (Lp.coeFn_sub f k).symm diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/Construction.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/Construction.lean index c273366b8..b7a999204 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/Construction.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/Construction.lean @@ -49,7 +49,7 @@ lemma spectralCutoffSet_mono : Monotone spectralCutoffSet := by lemma spectralCutoffSet_iUnion : ⋃ n, spectralCutoffSet n = Set.univ := by ext r - simp only [mem_iUnion, mem_Icc, mem_univ, iff_true] + simp only [mem_iUnion, mem_univ, iff_true] obtain ⟨n, hn⟩ := exists_nat_ge |r| exact ⟨n, neg_le_of_abs_le hn, le_trans (le_abs_self r) hn⟩ @@ -125,7 +125,7 @@ lemma truncationIntegral_inner_tendsto_complexWeakIntegral · filter_upwards [] with r exact truncationFunction_tendsto r convert hdom using 1 - simpa [WOTSpectralMeasure.complexWeakIntegral, ν] using hdom + simp [WOTSpectralMeasure.complexWeakIntegral, ν] @[nolint synTaut] lemma integral_indicator_real_eq_complex @@ -137,9 +137,7 @@ lemma integral_indicator_real_eq_complex ∂[ContinuousLinearMap.lsmul ℝ ℂ; μ] := by have hfun : (fun x => s.indicator (fun _ => (c : ℂ)) x) = (fun x => (s.indicator (fun _ => c) x : ℂ)) := by - simpa [Function.comp_def] using - (Set.indicator_comp_of_zero (s := s) (f := fun _ : α => c) - (g := Complex.ofRealCLM) Complex.ofRealCLM.map_zero) + simp exact congrArg (fun f : α → ℂ => ∫ᵛ x, f x ∂[ContinuousLinearMap.lsmul ℝ ℂ; μ]) hfun @@ -156,7 +154,7 @@ lemma integral_real_eq_complex change μ.variation s < ⊤ at hfinite have hfinite' : IsFiniteMeasure (μ.variation.restrict s) := by exact MeasureTheory.isFiniteMeasure_restrict.mpr hfinite.ne - letI := hfinite' + let := hfinite' calc ∫ᵛ x, s.indicator (fun _ => c) x ∂[ContinuousLinearMap.lsmul ℝ ℝ (E := ℂ); μ] = @@ -260,8 +258,7 @@ lemma spectralSquareMomentDomain_zero (μS : WOTSpectralMeasure ℝ H) : rw [mem_spectralSquareMomentDomain_iff] have hzero : (0 : H) = (0 : ℂ) • (0 : H) := by simp rw [hzero, μS.diagonalMeasure_smul] - simpa [norm_zero, pow_two] using (integrable_zero_measure : - Integrable (fun r : ℝ => r ^ 2) (0 : Measure ℝ)) + simp [norm_zero, pow_two] lemma spectralSquareMomentDomain_add (μS : WOTSpectralMeasure ℝ H) {x y : H} (hx : x ∈ spectralSquareMomentDomain μS) @@ -325,7 +322,7 @@ lemma truncationIntegral_sub_norm_sq_le (μS : WOTSpectralMeasure ℝ H) (n m : ‖truncationFunction n r - truncationFunction m r‖ = ‖(truncationFunction n r - (r : ℂ)) - (truncationFunction m r - (r : ℂ))‖ := by - congr 1 <;> ring + congr 1; ring _ ≤ _ := norm_sub_le _ _ dsimp [a, b] have hc : 0 ≤ ‖truncationFunction n r - truncationFunction m r‖ := norm_nonneg _ @@ -432,8 +429,8 @@ lemma truncationIntegral_cauchy (μS : WOTSpectralMeasure ℝ H) {x : H} simpa [A] using truncation_error_lintegral_tendsto_zero μS x hx have hq : 0 < ε ^ 2 / 8 := by positivity have hsmall : ∀ᶠ n : ℕ in Filter.atTop, A n < ENNReal.ofReal (ε ^ 2 / 8) := by - apply hA.eventually - exact Iio_mem_nhds ((ENNReal.ofReal_pos).2 hq) + exact hA.eventually (p := fun y => y < ENNReal.ofReal (ε ^ 2 / 8)) + (Iio_mem_nhds ((ENNReal.ofReal_pos).2 hq)) rcases (Filter.eventually_atTop.1 hsmall) with ⟨N, hN⟩ refine ⟨N, ?_⟩ intro n hn m hm @@ -463,7 +460,7 @@ lemma truncationIntegral_cauchy (μS : WOTSpectralMeasure ℝ H) {x : H} · exact htwo _ _ = ENNReal.ofReal (2 * (ε ^ 2 / 8) + 2 * (ε ^ 2 / 8)) := (ENNReal.ofReal_add (by positivity) (by positivity)).symm - _ = ENNReal.ofReal (ε ^ 2 / 2) := by congr 1 <;> ring + _ = ENNReal.ofReal (ε ^ 2 / 2) := by congr 1; ring _ < ENNReal.ofReal (ε ^ 2) := by exact (ENNReal.ofReal_lt_ofReal_iff (by positivity)).2 (by nlinarith) have hnormsq : ENNReal.ofReal @@ -510,7 +507,7 @@ lemma truncation_norm_lintegral_tendsto exact tendsto_nhds_of_eventually_eq (by filter_upwards [truncationFunction_eventually_eq r] with n hn have hnormsq : ‖(r : ℂ)‖ₑ ^ 2 = ENNReal.ofReal (r ^ 2) := by - rw [← ofReal_norm_eq_enorm (r : ℂ), pow_two, + rw [← ofReal_norm (r : ℂ), pow_two, ← ENNReal.ofReal_mul (norm_nonneg (r : ℂ))] simp [Complex.norm_real, Real.norm_eq_abs] congr 1 @@ -547,8 +544,7 @@ lemma truncationLimit_add (μS : WOTSpectralMeasure ℝ H) (by convert hxy using 1 funext n - simpa using (ContinuousLinearMapWOT.toCLM (truncationIntegral μS n)).map_add - (x : H) (y : H)) + simp) lemma truncationLimit_smul (μS : WOTSpectralMeasure ℝ H) (c : ℂ) (x : spectralSquareMomentSubmodule μS) : @@ -558,8 +554,7 @@ lemma truncationLimit_smul (μS : WOTSpectralMeasure ℝ H) (by convert hcx using 1 funext n - simpa using (ContinuousLinearMapWOT.toCLM (truncationIntegral μS n)).map_smul c - (x : H)) + simp) lemma truncationIntegral_norm_sq (μS : WOTSpectralMeasure ℝ H) (n : ℕ) (x : H) : ENNReal.ofReal (‖truncationIntegral μS n x‖ ^ 2) = @@ -628,7 +623,7 @@ lemma maximalSpectralIntegral_isSymmetric (μS : WOTSpectralMeasure ℝ H) : @[nolint unusedArguments] lemma spectralCutoff_mem_spectralSquareMomentDomain - (μS : WOTSpectralMeasure ℝ H) (x : H) {C : ℝ} (hC : 0 ≤ C) : + (μS : WOTSpectralMeasure ℝ H) (x : H) {C : ℝ} (_hC : 0 ≤ C) : μS (Set.Icc (-C) C) x ∈ spectralSquareMomentDomain μS := by let K : Set ℝ := Set.Icc (-C) C have hK : MeasurableSet K := measurableSet_Icc @@ -817,7 +812,7 @@ lemma maximalSpectralIntegral_apply (μS : WOTSpectralMeasure ℝ H) @[nolint unusedArguments] lemma scalarMeasure_inner_projection (μS : WOTSpectralMeasure ℝ H) - (x y : H) (S : Set ℝ) (hS : MeasurableSet S) : + (x y : H) (S : Set ℝ) (_hS : MeasurableSet S) : ⟪y, μS S x⟫_ℂ = ⟪μS S y, μS S x⟫_ℂ := by let p : H →L[ℂ] H := ContinuousLinearMapWOT.toCLM (μS S) have hmul : p * p = p := by @@ -868,7 +863,7 @@ lemma truncationIntegral_inner_tendsto_weakIntegral ContinuousLinearMap.lsmul ℝ ℝ (E := ℂ); μS.scalarMeasure x y]) Filter.atTop (𝓝 (μS.weakIntegral id x y)) := by let ν := μS.scalarMeasure x y - letI := scalarMeasure_isFiniteVariation μS x y + let := scalarMeasure_isFiniteVariation μS x y have hlimit : μS.complexWeakIntegral (fun r : ℝ => (r : ℂ)) x y = μS.weakIntegral id x y := by unfold WOTSpectralMeasure.complexWeakIntegral WOTSpectralMeasure.weakIntegral @@ -1048,7 +1043,7 @@ theorem boundedIntegral_ofReal_eq_measurableSpectralIntegral boundedIntegral μS (fun r : ℝ => (f r : ℂ)) (Complex.measurable_ofReal.comp hf) (by - rcases hfb with ⟨C, hC, hCbound⟩ + rcases hfb with ⟨C, _hC, hCbound⟩ exact ⟨C, fun r => by simpa [Complex.norm_real, Real.norm_eq_abs] using hCbound r⟩) x = (measurableSpectralIntegral μS f hf) @@ -1057,7 +1052,7 @@ theorem boundedIntegral_ofReal_eq_measurableSpectralIntegral exact Submodule.mem_top⟩ := by apply ext_inner_left ℂ intro y - letI : IsFiniteMeasure (μS.scalarMeasure x y).variation := + let : IsFiniteMeasure (μS.scalarMeasure x y).variation := scalarMeasure_isFiniteVariation μS x y have hfi : (μS.scalarMeasure x y).Integrable f := by rcases hfb with ⟨C, hC, hCbound⟩ diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/SpecTheorem.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/SpecTheorem.lean index 41f7476db..1b2c65515 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/SpecTheorem.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralIntegral/SpecTheorem.lean @@ -693,7 +693,7 @@ lemma maximalSpectralIntegral_resolvent_inverse_apply {z : ℂ} (hz : z.im ≠ 0 exact Submodule.mem_top⟩ have hxy : (M - z • (1 : H →ₗ.[ℂ] H)) y = x' := by simpa [x'] using hsum - exact LinearPMap.inverse_apply_eq hker hxy + exact LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hker) hxy lemma maximalSpectralIntegral_plus_resolvent_range : (maximalSpectralIntegral μS + Complex.I • (1 : H →ₗ.[ℂ] H)).toFun.range = ⊤ := by @@ -856,8 +856,8 @@ lemma maximalSpectralIntegral_plus_resolvent_inverse_apply (x : H) : funext a simp [Pi.add_apply] have hunitx := congrArg (fun A : H →WOT[ℂ] H => A x) hunit - convert hunitx using 1 <;> - simp only [hsumfun, boundedIntegral_const] + convert hunitx using 1 + simp only [boundedIntegral_const] simp [ContinuousLinearMapWOT.one_apply] let x' : (M + Complex.I • (1 : H →ₗ.[ℂ] H)).inverse.domain := ⟨x, by @@ -865,7 +865,7 @@ lemma maximalSpectralIntegral_plus_resolvent_inverse_apply (x : H) : exact Submodule.mem_top⟩ have hxy : (M + Complex.I • (1 : H →ₗ.[ℂ] H)) y = x' := by simpa [x'] using hsum - exact LinearPMap.inverse_apply_eq hker hxy + exact LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hker) hxy lemma maximalSpectralIntegral_minus_resolvent_inverse_apply (x : H) : (maximalSpectralIntegral μS - Complex.I • (1 : H →ₗ.[ℂ] H)).inverse @@ -960,8 +960,8 @@ lemma maximalSpectralIntegral_minus_resolvent_inverse_apply (x : H) : funext a simp [Pi.sub_apply] have hunitx := congrArg (fun A : H →WOT[ℂ] H => A x) hunit - convert hunitx using 1 <;> - simp only [hsubfun, boundedIntegral_const] + convert hunitx using 1 + simp only [boundedIntegral_const] simp [ContinuousLinearMapWOT.one_apply] let x' : (M - Complex.I • (1 : H →ₗ.[ℂ] H)).inverse.domain := ⟨x, by @@ -969,7 +969,7 @@ lemma maximalSpectralIntegral_minus_resolvent_inverse_apply (x : H) : exact Submodule.mem_top⟩ have hxy : (M - Complex.I • (1 : H →ₗ.[ℂ] H)) y = x' := by simpa [x'] using hsum - exact LinearPMap.inverse_apply_eq hker hxy + exact LinearPMap.inverse_apply_eq (LinearPMap.toFun_ker_eq_bot_iff.mp hker) hxy /-! ### The canonical self-adjoint realization diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralPointMass.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralPointMass.lean index b28af11af..79a5b5474 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralPointMass.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/SpectralPointMass.lean @@ -111,8 +111,8 @@ private theorem bisectStep_measure_one (h01 : ∀ E : Set ℝ, MeasurableSet E have hm1 : p.1 ≤ m := by rw [hm_def]; linarith have hm2 : m ≤ p.2 := by rw [hm_def]; linarith by_cases hc : μ (Icc p.1 m) = 1 - · simpa [hc] - · simp only [hc, if_false] + · simp [hc] + · simp only [hc, ite_false] have hc0 : μ (Icc p.1 m) = 0 := (h01 _ measurableSet_Icc).resolve_right hc have hunion : Icc p.1 m ∪ Ioc m p.2 = Icc p.1 p.2 := Icc_union_Ioc_eq_Icc hm1 hm2 have hdisj : Disjoint (Icc p.1 m) (Ioc m p.2) := by @@ -315,7 +315,7 @@ theorem eq_smul_one_of_forall_spectralMeasure_eq_zero_or_one have h2 := congrArg (fun m : MeasureTheory.Measure ℝ => m Set.univ) hveq.symm simpa [MeasureTheory.Measure.restrict_apply' (measurableSet_singleton r).compl] using h2 have hae : ({r} : Set ℝ) =ᵐ[ν.variation] (Set.univ : Set ℝ) := by - rw [Filter.eventuallyEq_set, MeasureTheory.ae_iff] + rw [Filter.eventuallyEqSet_iff, MeasureTheory.ae_iff] have hset : {z : ℝ | ¬(z ∈ ({r} : Set ℝ) ↔ z ∈ (Set.univ : Set ℝ))} = {r}ᶜ := by ext z; simp rw [hset] diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SesquilinearForm.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SesquilinearForm.lean index 0087dc44a..344750f6f 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SesquilinearForm.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SesquilinearForm.lean @@ -508,13 +508,13 @@ of `A` to identify `⟪x, A ^ 2 x⟫` with `⟪A x, A x⟫ = ‖A x‖ ^ 2`. -/ lemma norm_sq_le_inner_of_isPositive_of_le_one {A : H →L[ℂ] H} (hA0 : 0 ≤ A) (hA1 : A ≤ 1) (x : H) : ‖A x‖ ^ 2 ≤ RCLike.re ⟪x, A x⟫_ℂ := by - have hApos : A.IsPositive := (ContinuousLinearMap.nonneg_iff_isPositive A).mp hA0 + have hApos : A.IsPositive := ContinuousLinearMap.nonneg_iff_isPositive.mp hA0 have hAsa : IsSelfAdjoint A := hApos.isSelfAdjoint - have hanti : Antitone (A ^ · : ℕ → H →L[ℂ] H) := CStarAlgebra.pow_antitone hA0 hA1 + have hanti : Antitone (A ^ · : ℕ → H →L[ℂ] H) := CStarAlgebra.pow_antitone hA1 hA0 have hsq_le : A ^ 2 ≤ A ^ 1 := hanti (by norm_num) rw [pow_one] at hsq_le have hpos_diff : ContinuousLinearMap.IsPositive (A - A ^ 2) := - (ContinuousLinearMap.le_def _ _).mp hsq_le + ContinuousLinearMap.le_def.mp hsq_le have hre : 0 ≤ RCLike.re ⟪x, (A - A ^ 2) x⟫_ℂ := hpos_diff.re_inner_nonneg_right x have hexpand : ⟪x, (A - A ^ 2) x⟫_ℂ = ⟪x, A x⟫_ℂ - ⟪x, (A ^ 2) x⟫_ℂ := by rw [sub_apply, inner_sub_right] diff --git a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SpectralMeasure.lean b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SpectralMeasure.lean index 2f3f18752..32a6a788b 100644 --- a/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SpectralMeasure.lean +++ b/PhyslibAlpha/AlgebraicFramework/HilbertSpace/Unbounded/UnitaryInfra/SpectralMeasure.lean @@ -61,7 +61,7 @@ lemma cfcSpectralOperator_inner (S : Set (spectrum ℂ U)) (x y : H) : lemma cfcSpectralOperator_apply_eq_zero_of_not_measurableSet {S : Set (spectrum ℂ U)} (hS : ¬MeasurableSet S) : cfcSpectralOperator U hU S = 0 := by unfold cfcSpectralOperator - rw [dif_neg hS] + rw [dite_eq_right hS] set_option maxHeartbeats 1000000 in /-- The `Complex.I`-inversion companion of `cfcScalarMeasure_real_I_smul`: rewrites a Riesz @@ -199,7 +199,7 @@ lemma cfcSpectralOperator_isPositive {S : Set (spectrum ℂ U)} (hS : Measurable lemma cfcSpectralOperator_nonneg {S : Set (spectrum ℂ U)} (hS : MeasurableSet S) : 0 ≤ cfcSpectralOperator U hU S := - (ContinuousLinearMap.nonneg_iff_isPositive _).mpr (cfcSpectralOperator_isPositive U hU hS) + ContinuousLinearMap.nonneg_iff_isPositive.mpr (cfcSpectralOperator_isPositive U hU hS) /-- `cfcSpectralOperator U hU S` is monotone in `S`, for measurable sets, in the Loewner order on `H →L[ℂ] H`. -/ @@ -484,7 +484,7 @@ lemma cfcSpectralOperator_isIdempotent_of_isCompact exact cfcSpectralOperator_le_cfcRealOperator_of_compact_subset_open U hU hK hV hKV f hfK hfV hf have hF0 : 0 ≤ cfcRealOperator U hU f := - (ContinuousLinearMap.nonneg_iff_isPositive _).mpr + ContinuousLinearMap.nonneg_iff_isPositive.mpr (cfcRealOperator_nonneg U hU f (fun z => (hf z).1)) have hFone := hF1 f hf constructor @@ -591,7 +591,7 @@ lemma cfcSpectralOperator_isIdempotent_of_isCompact let Q := cfcRealOperator U hU q have hQ0 : 0 ≤ Q := by dsimp [Q] - exact (ContinuousLinearMap.nonneg_iff_isPositive _).mpr + exact ContinuousLinearMap.nonneg_iff_isPositive.mpr (cfcRealOperator_nonneg U hU q (fun z => (hq z).1)) have hQ1 : Q ≤ 1 := by dsimp [Q] @@ -618,7 +618,7 @@ lemma cfcSpectralOperator_isIdempotent_of_isCompact nlinarith [norm_nonneg (Q x)] have hFop : ‖F‖ ≤ 1 := by exact (CStarAlgebra.norm_le_one_iff_of_nonneg F - ((ContinuousLinearMap.nonneg_iff_isPositive _).mpr + (ContinuousLinearMap.nonneg_iff_isPositive.mpr (cfcRealOperator_nonneg U hU f0 (fun z => (hf0 z).1)))).2 (hF1 f0 hf0) have hexpand : A * A - A = @@ -765,7 +765,7 @@ lemma cfcSpectralOperatorAux_isIdempotentElem (S : Set (spectrum ℂ U)) (hS : M nlinarith [norm_nonneg (D z)] have hPop : ‖P‖ ≤ 1 := by exact (CStarAlgebra.norm_le_one_iff_of_nonneg P - ((ContinuousLinearMap.nonneg_iff_isPositive _).mpr + (ContinuousLinearMap.nonneg_iff_isPositive.mpr (cfcSpectralOperator_isPositive U hU hK.measurableSet))).2 hP1 have hexpand : A * A - A = (A - P) * A + P * (A - P) - (A - P) := by calc diff --git a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Hom.lean b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Hom.lean index dbd828a81..ba2869453 100644 --- a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Hom.lean +++ b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Hom.lean @@ -6,7 +6,7 @@ Authors: Tom Ole Diem module public import Mathlib.Algebra.Jordan.Basic -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Algebra.Module.LinearMap.Basic /-! diff --git a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/CFC.lean b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/CFC.lean index ed4d40100..33d528eb9 100644 --- a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/CFC.lean +++ b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/CFC.lean @@ -317,7 +317,7 @@ an isometry. -/ theorem isClosed_range_jordanCfcHom [Nontrivial E] [PartialOrder E] [IsOrderedAddMonoid E] [IsArchimedeanOrderUnit E] [PosSMulMono ℝ E] [IsJBOrderUnit E] (a : E) : IsClosed (Set.range (jordanCfcHom a)) := - (jordanCfcHom_isometry a).antilipschitz.isClosed_range + (jordanCfcHom_isometry a).antilipschitzWith.isClosed_range (jordanCfcHom_isometry a).uniformContinuous /-- The algebraic one-generator submodule included into its norm closure. -/ diff --git a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Spectrum.lean b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Spectrum.lean index bbb4bb808..5c3942794 100644 --- a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Spectrum.lean +++ b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Spectrum.lean @@ -282,10 +282,16 @@ theorem jordanSpectralRadius_eq_norm [Nontrivial E] [PartialOrder E] [IsOrderedA · rcases norm_or_neg_norm_mem_spectrum a x with hx | hx · calc (‖x‖₊ : ENNReal) = ‖(‖x‖ : ℝ)‖₊ := by rw [nnnorm_norm] - _ ≤ spectralRadius ℝ x := le_iSup₂ (α := ENNReal) (‖x‖ : ℝ) hx + _ ≤ spectralRadius ℝ x := by + rw [spectralRadius_eq_of_unital] + exact le_iSup₂ (f := fun (k : ℝ) (_ : k ∈ spectrum ℝ x) => (‖k‖₊ : ENNReal)) + (‖x‖ : ℝ) hx · calc (‖x‖₊ : ENNReal) = ‖(-‖x‖ : ℝ)‖₊ := by simp only [nnnorm_neg, nnnorm_norm] - _ ≤ spectralRadius ℝ x := le_iSup₂ (α := ENNReal) (-‖x‖ : ℝ) hx + _ ≤ spectralRadius ℝ x := by + rw [spectralRadius_eq_of_unital] + exact le_iSup₂ (f := fun (k : ℝ) (_ : k ∈ spectrum ℝ x) => (‖k‖₊ : ENNReal)) + (-‖x‖ : ℝ) hx end ClosedGeneratedByOne @@ -388,8 +394,7 @@ theorem nnnorm_aeval_closedGenerator [Nontrivial E] [PartialOrder E] [IsOrderedA ⨆ l ∈ jordanSpectrum a, (‖p.eval l‖₊ : ENNReal) := by rw [← JBAlgebra.ClosedGeneratedByOne.jordanSpectralRadius_eq_norm a (Polynomial.aeval (closedGenerator a) p)] - unfold spectralRadius - rw [← jordanSpectrum_aeval a p, iSup_image] + rw [spectralRadius_eq_of_unital, ← jordanSpectrum_aeval a p, iSup_image] /-- Norm form of the polynomial-evaluation isometry, expressed in `ℝ≥0∞` so that the spectral supremum is total. -/ diff --git a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Uniform.lean b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Uniform.lean index 4b0c14f32..066694e22 100644 --- a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Uniform.lean +++ b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/JB/GeneratedByOne/Uniform.lean @@ -44,9 +44,9 @@ lemma norm_mul_self (x : ClosedGeneratedByOne a) : ‖x * x‖ = ‖x‖ ^ 2 := /-- The generic Banach-algebra spectral-radius bound, specialized to the closed JB generator. The reverse inequality is the genuinely JB-specific spectral theorem and is intentionally not folded into this generic estimate. -/ -lemma spectralRadius_le_norm [Nontrivial E] (x : ClosedGeneratedByOne a) : +lemma spectralRadius_le_norm (x : ClosedGeneratedByOne a) : spectralRadius ℝ x ≤ (‖x‖₊ : ℝ≥0∞) := by - exact spectrum.spectralRadius_le_nnnorm x + exact spectralRadius_le_nnnorm x /-- Along powers of two, the closed one-generator algebra has a uniform norm. -/ lemma norm_pow_two_pow (x : ClosedGeneratedByOne a) (n : ℕ) : diff --git a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Quadratic/Fundamental.lean b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Quadratic/Fundamental.lean index c77861f14..46793e0f7 100644 --- a/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Quadratic/Fundamental.lean +++ b/PhyslibAlpha/AlgebraicFramework/JordanOrderUnit/Quadratic/Fundamental.lean @@ -179,6 +179,7 @@ theorem quadRep_add_mul_self_eq_comp (a b : E) : (U a + (2 : ℝ) • quadRepBilin a b + U b) := by rw [quadRep_mul_self_eq_comp, quadRep_add_eq] +set_option maxHeartbeats 500000 in /-- The positive polarization of the square identity, fully expanded in the canonical bilinear quadratic operator. Pairing this equation with its signed counterpart isolates the standard mixed quadratic coefficient. -/ diff --git a/PhyslibAlpha/AlgebraicFramework/Measurement/FiniteOutcome.lean b/PhyslibAlpha/AlgebraicFramework/Measurement/FiniteOutcome.lean index 7c7c6fa6b..776d1ecd5 100644 --- a/PhyslibAlpha/AlgebraicFramework/Measurement/FiniteOutcome.lean +++ b/PhyslibAlpha/AlgebraicFramework/Measurement/FiniteOutcome.lean @@ -63,7 +63,7 @@ lemma toChannel_single (e : ι → Effect E) (he : ∑ i, (e i : E) = 1) (i : ι toChannel e he (Pi.single i (1 : ℝ)) = (e i : E) := by rw [toChannel_apply, Finset.sum_eq_single i - (fun j _ hji => by rw [Pi.single_apply, if_neg hji, zero_smul]) + (fun j _ hji => by rw [Pi.single_apply, ite_eq_right hji, zero_smul]) (fun h => absurd (Finset.mem_univ i) h)] simp @@ -111,7 +111,7 @@ noncomputable def channelEquiv : split_ifs <;> ring rw [hx, map_smul, toChannel_apply] rw [Finset.sum_eq_single i - (fun j _ hji => by rw [Pi.single_apply, if_neg hji, zero_smul]) + (fun j _ hji => by rw [Pi.single_apply, ite_eq_right hji, zero_smul]) (fun h => absurd (Finset.mem_univ i) h)] simp [coe_outcomeEffect] right_inv p := by diff --git a/PhyslibAlpha/AlgebraicFramework/OrderUnit/Basic.lean b/PhyslibAlpha/AlgebraicFramework/OrderUnit/Basic.lean index 10d04080b..c2254675c 100644 --- a/PhyslibAlpha/AlgebraicFramework/OrderUnit/Basic.lean +++ b/PhyslibAlpha/AlgebraicFramework/OrderUnit/Basic.lean @@ -7,7 +7,7 @@ module public import Mathlib.Algebra.Order.Module.Defs public import Mathlib.Algebra.Order.Nonneg.Basic -public import Mathlib.Data.NNReal.Defs +public import Mathlib.Basic.NNReal.Defs public import Mathlib.Geometry.Convex.Cone.Pointed /-! diff --git a/PhyslibAlpha/AlgebraicFramework/OrderUnit/Composite.lean b/PhyslibAlpha/AlgebraicFramework/OrderUnit/Composite.lean index c0dc10db1..a6b155293 100644 --- a/PhyslibAlpha/AlgebraicFramework/OrderUnit/Composite.lean +++ b/PhyslibAlpha/AlgebraicFramework/OrderUnit/Composite.lean @@ -266,8 +266,7 @@ cone when both factors have order units. -/ lemma exists_eq_sub_minTensorCone (t : E₁ ⊗[ℝ] E₂) : ∃ tp tn : minTensorCone E₁ E₂, t = (tp : E₁ ⊗[ℝ] E₂) - (tn : E₁ ⊗[ℝ] E₂) := by - induction t using TensorProduct.induction_on with - | zero => exact ⟨0, 0, by simp⟩ + induction t using TensorProduct.inductionOn with | tmul x y => obtain ⟨xp, xn, hxp, hxn, hx⟩ := IsOrderUnit.exists_eq_sub_nonneg x obtain ⟨yp, yn, hyp, hyn, hy⟩ := IsOrderUnit.exists_eq_sub_nonneg y diff --git a/PhyslibAlpha/AlgebraicFramework/OrderUnit/Weight/Basic.lean b/PhyslibAlpha/AlgebraicFramework/OrderUnit/Weight/Basic.lean index b5309a45e..07c86bf12 100644 --- a/PhyslibAlpha/AlgebraicFramework/OrderUnit/Weight/Basic.lean +++ b/PhyslibAlpha/AlgebraicFramework/OrderUnit/Weight/Basic.lean @@ -5,9 +5,9 @@ Authors: Tom Ole Diem -/ module -public import Mathlib.Data.ENNReal.Basic -public import Mathlib.Data.ENNReal.Action -public import Mathlib.Data.ENNReal.Inv +public import Mathlib.Basic.ENNReal.Basic +public import Mathlib.Basic.ENNReal.Action +public import Mathlib.Basic.ENNReal.Inv public import PhyslibAlpha.AlgebraicFramework.OrderUnit.Basic /-! diff --git a/PhyslibAlpha/AlgebraicFramework/StarAlgebra/Restrict.lean b/PhyslibAlpha/AlgebraicFramework/StarAlgebra/Restrict.lean index 16e8e177b..e8bd9cc52 100644 --- a/PhyslibAlpha/AlgebraicFramework/StarAlgebra/Restrict.lean +++ b/PhyslibAlpha/AlgebraicFramework/StarAlgebra/Restrict.lean @@ -90,7 +90,7 @@ lemma coe_restrictSAC_apply (f : A₁ →ₚ[ℂ] ℂ) (x : selfAdjoint A₁) : (f.restrictSAC x : ℂ) = f (x : A₁) := by have : conj (f x) = f x := by rw [← star_def, ← isSelfAdjoint_iff] - exact IsSelfAdjoint.map isSelfAdjoint f + exact IsSelfAdjoint.map f isSelfAdjoint simpa [restrictSAC] using (conj_eq_iff_re.mp this) end Complex @@ -136,7 +136,7 @@ lemma coe_restrictSAC_apply (f : A₁ →ₚ₁[ℂ] ℂ) (x : selfAdjoint A₁) (f.restrictSAC x : ℂ) = f (x : A₁) := by have : conj (f x) = f x := by rw [← star_def, ← isSelfAdjoint_iff] - exact IsSelfAdjoint.map isSelfAdjoint f + exact IsSelfAdjoint.map f isSelfAdjoint simpa [restrictSAC] using (conj_eq_iff_re.mp this) end UnitalPositiveLinearMap diff --git a/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingNorm.lean b/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingNorm.lean index 04126a41e..356df0713 100644 --- a/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingNorm.lean +++ b/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingNorm.lean @@ -37,7 +37,7 @@ private theorem isTraceClass_rankOne (x y : H) : · subst hy have hz : InnerProductSpace.rankOne ℂ x (0 : H) = 0 := by ext z - simp [InnerProductSpace.rankOne_apply] + simp rw [hz] exact isTraceClass_zero · have hyy : IsTraceClass (InnerProductSpace.rankOne ℂ y y) := @@ -111,7 +111,7 @@ theorem norm_le_tracePairing (A : H →L[ℂ] H) : intro hx0 apply hx simp [hx0] - letI : Nontrivial H := ⟨⟨x, 0, hx0⟩⟩ + let : Nontrivial H := ⟨⟨x, 0, hx0⟩⟩ have hy : ‖y‖ = 1 := by dsimp [y] rw [norm_smul, norm_inv, Complex.norm_real] @@ -122,8 +122,7 @@ theorem norm_le_tracePairing (A : H →L[ℂ] H) : rw [tracePairing_rankOne] dsimp [y] rw [inner_smul_left, inner_self_eq_norm_sq_to_K] - simp [map_inv₀, Complex.norm_real, norm_inv, norm_norm, - norm_ne_zero_iff.mpr hx] + simp [map_inv₀, Complex.norm_real, norm_inv] field_simp [norm_ne_zero_iff.mpr hx] have hR : ‖(ofOperator (InnerProductSpace.rankOne ℂ x y) (isTraceClass_rankOne x y) : TraceClass H)‖ ≤ ‖x‖ := by diff --git a/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingSurjectivity.lean b/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingSurjectivity.lean index d595b43d7..1b2de9d80 100644 --- a/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingSurjectivity.lean +++ b/PhyslibAlpha/AlgebraicFramework/WStarAlgebra/TracePairingSurjectivity.lean @@ -42,7 +42,7 @@ theorem isTraceClass_rankOne (x y : H) : · subst hy have hz : InnerProductSpace.rankOne ℂ x (0 : H) = 0 := by ext z - simp [InnerProductSpace.rankOne_apply] + simp rw [hz] exact isTraceClass_zero · have hyy : IsTraceClass (InnerProductSpace.rankOne ℂ y y) := @@ -78,10 +78,10 @@ private theorem rankOneTraceClass_norm_le (x y : H) : apply Subtype.ext change InnerProductSpace.rankOne ℂ x 0 = 0 ext v - simp [InnerProductSpace.rankOne_apply] + simp rw [hzero] simp - · letI : Nontrivial H := ⟨⟨y, 0, hy⟩⟩ + · let : Nontrivial H := ⟨⟨y, 0, hy⟩⟩ let P : H →L[ℂ] H := InnerProductSpace.rankOne ℂ y y have hP : IsTraceClass P := isTraceClass_rankOne_self y have hT : IsTraceClass (InnerProductSpace.rankOne ℂ x y) := @@ -131,8 +131,7 @@ private theorem rankOneTraceClass_norm_le (x y : H) : _ = ‖x‖ * ‖y‖ := by rw [hnormP] dsimp [c] - simp [norm_inv, norm_pow, Complex.norm_real, - abs_of_nonneg (norm_nonneg y), InnerProductSpace.norm_rankOne] + simp [norm_inv, norm_pow, Complex.norm_real, InnerProductSpace.norm_rankOne] field_simp private theorem trace_rankOne (x y : H) : @@ -188,7 +187,7 @@ private def sesquilinearFormOfFunctional change InnerProductSpace.rankOne ℂ x (y + z) = InnerProductSpace.rankOne ℂ x y + InnerProductSpace.rankOne ℂ x z ext v - simp [InnerProductSpace.rankOne_apply, inner_add_left, add_smul] + simp [InnerProductSpace.rankOne_apply] rw [h, map_add] simp map_smul' := by @@ -199,7 +198,7 @@ private def sesquilinearFormOfFunctional change InnerProductSpace.rankOne ℂ x (c • y) = (starRingEnd ℂ c) • InnerProductSpace.rankOne ℂ x y ext v - simp [InnerProductSpace.rankOne_apply, inner_smul_left] + simp [InnerProductSpace.rankOne_apply] rw [h, map_smul] simp } map_add' := by @@ -213,7 +212,7 @@ private def sesquilinearFormOfFunctional change InnerProductSpace.rankOne ℂ (x + z) y = InnerProductSpace.rankOne ℂ x y + InnerProductSpace.rankOne ℂ z y ext v - simp [InnerProductSpace.rankOne_apply, add_smul] + simp [InnerProductSpace.rankOne_apply] rw [h, map_add] simp map_smul' := by @@ -227,7 +226,7 @@ private def sesquilinearFormOfFunctional change InnerProductSpace.rankOne ℂ (c • x) y = c • InnerProductSpace.rankOne ℂ x y ext v - simp [InnerProductSpace.rankOne_apply] + simp rw [h, map_smul] simp } bound := by @@ -309,7 +308,7 @@ theorem hilbertSchmidtPartial_apply_basis {w : Set H} (S : H →L[ℂ] H) rw [hilbertSchmidtPartial_apply] classical by_cases hj : j ∈ F - · rw [if_pos hj] + · rw [ite_eq_left hj] calc (∑ i ∈ F, ⟪b i, b j⟫_ℂ • S (b i)) = ∑ i ∈ F, (if i = j then 1 else 0) • S (b i) := by @@ -321,7 +320,7 @@ theorem hilbertSchmidtPartial_apply_basis {w : Set H} (S : H →L[ℂ] H) · rw [b.orthonormal.2 hij] simp [hij] _ = S (b j) := by simp [hj] - · rw [if_neg hj] + · rw [ite_eq_right hj] calc (∑ i ∈ F, ⟪b i, b j⟫_ℂ • S (b i)) = ∑ i ∈ F, (if i = j then 1 else 0) • S (b i) := by diff --git a/PhyslibAlpha/ClassicalMechanics/NortonDome/Basic.lean b/PhyslibAlpha/ClassicalMechanics/NortonDome/Basic.lean index 90a0e5bfd..248acc04d 100644 --- a/PhyslibAlpha/ClassicalMechanics/NortonDome/Basic.lean +++ b/PhyslibAlpha/ClassicalMechanics/NortonDome/Basic.lean @@ -495,7 +495,7 @@ lemma not_lipschitzOnWith_force (K : NNReal) {ε : ℝ} (hε : 0 < ε) : exact hw.2 have := h.dist_le_mul _ (hmem y hy) _ (hmem z hz) rw [force_eq, force_eq, dist_smul_single, dist_smul_single] at this - simp only [PiLp.smul_apply, PiLp.single_apply, if_true, smul_eq_mul, mul_one, + simp only [PiLp.smul_apply, PiLp.single_apply, ite_true, smul_eq_mul, mul_one, ← mul_sub, abs_mul, abs_of_pos S.m_pos] at this show dist √y √z ≤ (K : ℝ) / S.m * dist y z rw [Real.dist_eq, Real.dist_eq, div_mul_eq_mul_div, le_div_iff₀ S.m_pos, mul_comm] diff --git a/PhyslibAlpha/Mathematics/LadderSystem/Irreducibility.lean b/PhyslibAlpha/Mathematics/LadderSystem/Irreducibility.lean index 9908d89c9..d2a9329c3 100644 --- a/PhyslibAlpha/Mathematics/LadderSystem/Irreducibility.lean +++ b/PhyslibAlpha/Mathematics/LadderSystem/Irreducibility.lean @@ -204,7 +204,7 @@ omit [CharZero K] in /-- `moveOneTo` at the color it moves quanta *into* just increments that color's count. -/ lemma moveOneTo_self (α : Fin d → ℕ) (i j : Fin d) : moveOneTo α i j i = α i + 1 := by show (if i = i then α i + 1 else if i = j then α j - 1 else α i) = α i + 1 - rw [if_pos rfl] + rw [ite_eq_left rfl] omit [CharZero K] in /-- Moving a quantum from `j` to `i` and then immediately back from `i` to `j` is the identity. -/ @@ -212,21 +212,21 @@ lemma moveOneTo_moveOneTo {i j : Fin d} (hij : i ≠ j) {α : Fin d → ℕ} (hj moveOneTo (moveOneTo α i j) j i = α := by have hβj : moveOneTo α i j j = α j - 1 := by show (if j = i then α i + 1 else if j = j then α j - 1 else α j) = α j - 1 - rw [if_neg (Ne.symm hij), if_pos rfl] + rw [ite_eq_right (Ne.symm hij), ite_eq_left rfl] have hβi : moveOneTo α i j i = α i + 1 := moveOneTo_self α i j funext c show (if c = j then moveOneTo α i j j + 1 else if c = i then moveOneTo α i j i - 1 else moveOneTo α i j c) = α c rcases eq_or_ne c j with rfl | hcj - · rw [if_pos rfl, hβj] + · rw [ite_eq_left rfl, hβj] omega - · rw [if_neg hcj] + · rw [ite_eq_right hcj] rcases eq_or_ne c i with rfl | hci - · rw [if_pos rfl, hβi] + · rw [ite_eq_left rfl, hβi] omega - · rw [if_neg hci] + · rw [ite_eq_right hci] show (if c = i then α i + 1 else if c = j then α j - 1 else α c) = α c - rw [if_neg hci, if_neg hcj] + rw [ite_eq_right hci, ite_eq_right hcj] /-- The atomic move: if `W` is `E i j`-invariant and contains the word for `β`, and mode `k` is occupied, `W` also contains the word obtained by moving one quantum from `k` to any other @@ -263,8 +263,8 @@ lemma word_countWord_hub_mem_of_mem {hd : 0 < d} {Ω : V} (P : L.HasVacuum Ω) Finset.add_sum_erase _ α (Finset.mem_univ hub0) funext c by_cases hc : c = hub0 - · subst hc; rw [if_pos rfl]; exact hα0 - · rw [if_neg hc] + · subst hc; rw [ite_eq_left rfl]; exact hα0 + · rw [ite_eq_right hc] have hle : α c ≤ ∑ c' ∈ Finset.univ.erase hub0, α c' := Finset.single_le_sum (fun _ _ => Nat.zero_le _) (Finset.mem_erase.mpr ⟨hc, Finset.mem_univ c⟩) @@ -308,8 +308,8 @@ lemma word_countWord_mem_of_hub_mem {hd : 0 < d} {Ω : V} (P : L.HasVacuum Ω) Finset.add_sum_erase _ α (Finset.mem_univ hub0) funext c by_cases hc : c = hub0 - · subst hc; rw [if_pos rfl]; exact hα0 - · rw [if_neg hc] + · subst hc; rw [ite_eq_left rfl]; exact hα0 + · rw [ite_eq_right hc] have hle : α c ≤ ∑ c' ∈ Finset.univ.erase hub0, α c' := Finset.single_le_sum (fun _ _ => Nat.zero_le _) (Finset.mem_erase.mpr ⟨hc, Finset.mem_univ c⟩) diff --git a/PhyslibAlpha/Mathematics/LadderSystem/OccupationBasis.lean b/PhyslibAlpha/Mathematics/LadderSystem/OccupationBasis.lean index e7eb9d36b..abb9e10da 100644 --- a/PhyslibAlpha/Mathematics/LadderSystem/OccupationBasis.lean +++ b/PhyslibAlpha/Mathematics/LadderSystem/OccupationBasis.lean @@ -94,7 +94,7 @@ omit [CharZero K] in lemma pow_a_comm_ac {i c : Fin d} (hic : i ≠ c) (k : ℕ) (y : V) : ((L.a i) ^ k) (L.ac c y) = L.ac c (((L.a i) ^ k) y) := by have h := L.comm_a_ac i c - rw [if_neg hic, LieRing.of_associative_ring_bracket, sub_eq_zero] at h + rw [ite_eq_right hic, LieRing.of_associative_ring_bracket, sub_eq_zero] at h have hpow : (L.a i) ^ k * L.ac c = L.ac c * (L.a i) ^ k := Commute.pow_left h k have happly := congrArg (fun f : Module.End K V => f y) hpow simpa [Module.End.mul_apply] using happly diff --git a/PhyslibAlpha/Mathematics/LadderSystem/Vacuum.lean b/PhyslibAlpha/Mathematics/LadderSystem/Vacuum.lean index 73321c6fc..3725ffdbe 100644 --- a/PhyslibAlpha/Mathematics/LadderSystem/Vacuum.lean +++ b/PhyslibAlpha/Mathematics/LadderSystem/Vacuum.lean @@ -118,14 +118,14 @@ lemma word_peel (L : LadderSystem K V d) (i : Fin d) {x : V} (hx : L.a i x = 0) rw [step, word_peel L i hx v'] by_cases hic : i = c · subst hic - rw [if_pos rfl, List.count_cons_self, List.erase_cons_head] + rw [ite_eq_left rfl, List.count_cons_self, List.erase_cons_head] by_cases hmem : i ∈ v' · have hperm : L.word v' x = L.word (i :: v'.erase i) x := word_perm L (List.perm_cons_erase hmem) x rw [succ_nsmul, map_nsmul, ← word_cons, ← hperm] · have hcount : v'.count i = 0 := List.count_eq_zero_of_not_mem hmem simp [hcount] - · rw [if_neg hic, List.count_cons_of_ne (Ne.symm hic), + · rw [ite_eq_right hic, List.count_cons_of_ne (Ne.symm hic), List.erase_cons_tail (by simpa using Ne.symm hic), map_nsmul, ← word_cons, add_zero] /-- How `E i j` acts on a word: removes one occurrence of `j`, adds one of `i`, scaled by `j`'s @@ -177,7 +177,7 @@ lemma count_countWord {d : ℕ} (α : Fin d → ℕ) (i : Fin d) : rw [List.count_replicate, hzero] simp · have hine : i ≠ c := fun h => hcl' (h ▸ hil') - rw [List.count_replicate, if_neg (by simpa using hine.symm), zero_add] + rw [List.count_replicate, ite_eq_right (by simpa using hine.symm), zero_add] exact ih hnodup' hil' exact key (List.finRange d) (List.nodup_finRange d) (List.mem_finRange i) @@ -190,7 +190,7 @@ lemma sum_count_eq_length {d : ℕ} : ∀ v : List (Fin d), (∑ c : Fin d, v.co rw [List.count_cons] simp only [beq_iff_eq] have hone : (∑ c : Fin d, if a = c then (1 : ℕ) else 0) = 1 := by - rw [Finset.sum_eq_single a (fun b _ hb => if_neg (Ne.symm hb)) + rw [Finset.sum_eq_single a (fun b _ hb => ite_eq_right (Ne.symm hb)) (fun h => absurd (Finset.mem_univ a) h)] simp simp only [hcount, List.length_cons] diff --git a/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/ChargeBalance.lean b/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/ChargeBalance.lean index 2fc721157..42aaf7125 100644 --- a/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/ChargeBalance.lean +++ b/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/ChargeBalance.lean @@ -27,15 +27,15 @@ open scoped Classical in by `∏ᵢ (d i) ^ (m i)`. -/ lemma coeff_aeval_diag {σ R : Type*} [CommRing R] (d : σ → R) (f : MvPolynomial σ R) (m : σ →₀ ℕ) : - coeff m (aeval (fun i => C (d i) * X i) f) = (m.prod fun i k => d i ^ k) * coeff m f := by + (aeval (fun i => C (d i) * X i) f).coeff m = (m.prod fun i k => d i ^ k) * f.coeff m := by induction f using MvPolynomial.induction_on generalizing m with | C a => rw [aeval_C, MvPolynomial.algebraMap_eq, coeff_C] by_cases hm : (0 : σ →₀ ℕ) = m · subst hm; simp - · rw [if_neg hm, mul_zero] + · rw [ite_eq_right hm, mul_zero] | add p q hp hq => - rw [map_add, coeff_add, coeff_add, hp m, hq m, mul_add] + simp only [map_add, AddMonoidAlgebra.coeff_add, Finsupp.add_apply, hp m, hq m, mul_add] | mul_X p i hp => rw [map_mul, aeval_X] have hrw : (aeval (fun i => C (d i) * X i) p) * (C (d i) * X i) @@ -43,7 +43,7 @@ lemma coeff_aeval_diag {σ R : Type*} [CommRing R] (d : σ → R) (f : MvPolynom rw [mul_left_comm] rw [hrw, coeff_C_mul, coeff_mul_X', coeff_mul_X'] by_cases hi : i ∈ m.support - · rw [if_pos hi, if_pos hi, hp (m - Finsupp.single i 1)] + · rw [ite_eq_left hi, ite_eq_left hi, hp (m - Finsupp.single i 1)] have hmi : 1 ≤ m i := Nat.one_le_iff_ne_zero.mpr (Finsupp.mem_support_iff.mp hi) have hle : Finsupp.single i 1 ≤ m := Finsupp.single_le_iff.mpr hmi have hsplit : m = (m - Finsupp.single i 1) + Finsupp.single i 1 := @@ -56,7 +56,7 @@ lemma coeff_aeval_diag {σ R : Type*} [CommRing R] (d : σ → R) (f : MvPolynom simp rw [hprod] ring - · rw [if_neg hi, if_neg hi, mul_zero, mul_zero] + · rw [ite_eq_right hi, ite_eq_right hi, mul_zero, mul_zero] /-- **Charge balancing.** If each variable `Xᵢ` carries an integer charge `w i`, `c` is a phase of infinite order, and the polynomial `f` is invariant under the charge rotation @@ -65,7 +65,7 @@ lemma coeff_eq_zero_of_charge_ne_zero {σ K : Type*} [Field K] (w : σ → ℤ) (hroot : ∀ n : ℤ, c ^ n = 1 → n = 0) {f : MvPolynomial σ K} (hf : aeval (fun i => C (c ^ (w i)) * X i) f = f) {m : σ →₀ ℕ} (hm : ∑ i ∈ m.support, (m i : ℤ) * w i ≠ 0) : - coeff m f = 0 := by + f.coeff m = 0 := by classical have key := coeff_aeval_diag (fun i => c ^ (w i)) f m rw [hf] at key @@ -80,7 +80,7 @@ lemma coeff_eq_zero_of_charge_ne_zero {σ K : Type*} [Field K] (w : σ → ℤ) rw [← zpow_natCast (c ^ w x) (m x), ← zpow_mul, mul_comm] rw [Finsupp.prod, hgen] at key have hne : c ^ (∑ i ∈ m.support, (m i : ℤ) * w i) ≠ 1 := fun h => hm (hroot _ h) - have h2 : (1 - c ^ (∑ i ∈ m.support, (m i : ℤ) * w i)) * coeff m f = 0 := by + have h2 : (1 - c ^ (∑ i ∈ m.support, (m i : ℤ) * w i)) * f.coeff m = 0 := by rw [sub_mul, one_mul, ← key, sub_self] rcases mul_eq_zero.mp h2 with h | h · exact absurd (sub_eq_zero.mp h).symm hne diff --git a/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/Invariants.lean b/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/Invariants.lean index 4ff8121f0..c604d6fc8 100644 --- a/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/Invariants.lean +++ b/PhyslibAlpha/Particles/BeyondTheStandardModel/TwoHDM/Invariants.lean @@ -297,7 +297,7 @@ lemma coeff_Qslice_eq_zero {V : EffectivePotential} (hI : IsInvariant V) {P : MvPolynomial (Fin 6) ℝ} (hP : ∀ a, V (sliceR a) = P.eval a) (m : Fin 6 →₀ ℕ) (hm : (∑ i ∈ m.support, (m i : ℤ) * cartanCharge i ≠ 0) ∨ (∑ i ∈ m.support, (m i : ℤ) * hyperCharge i ≠ 0)) : - coeff m (Qslice P) = 0 := by + (Qslice P).coeff m = 0 := by obtain ⟨ω, hω⟩ := exists_infiniteOrder_unitary have hω0 : (ω : ℂ) ≠ 0 := by intro h; have := ω.2.1; rw [h] at this; simp at this rcases hm with hmA | hmB @@ -376,10 +376,12 @@ lemma monomial_mem_adjoin_neutralBilinear (m : Fin 6 →₀ ℕ) by_cases h1 : i = k · by_cases h2 : j = k · exact absurd (h1.trans h2.symm) hij - · rw [if_pos h1, if_neg h2]; subst h1; simpa using Nat.one_le_iff_ne_zero.mpr hmi + · rw [ite_eq_left h1, ite_eq_right h2]; subst h1 + simpa using Nat.one_le_iff_ne_zero.mpr hmi · by_cases h2 : j = k - · rw [if_neg h1, if_pos h2]; subst h2; simpa using Nat.one_le_iff_ne_zero.mpr hmj - · rw [if_neg h1, if_neg h2]; simp + · rw [ite_eq_right h1, ite_eq_left h2]; subst h2 + simpa using Nat.one_le_iff_ne_zero.mpr hmj + · rw [ite_eq_right h1, ite_eq_right h2]; simp set m' := m - (Finsupp.single i 1 + Finsupp.single j 1) with hm'def have hdecomp : m = (Finsupp.single i 1 + Finsupp.single j 1) + m' := by rw [hm'def, add_tsub_cancel_of_le hle] @@ -413,7 +415,7 @@ lemma monomial_mem_adjoin_neutralBilinear (m : Fin 6 →₀ ℕ) by rw [← X_pow_eq_monomial, pow_one], show (X j : MvPolynomial (Fin 6) ℂ) = monomial (Finsupp.single j 1) 1 from by rw [← X_pow_eq_monomial, pow_one], - monomial_mul, monomial_mul, one_mul, one_mul, add_assoc] + monomial_mul_monomial, monomial_mul_monomial, one_mul, one_mul, add_assoc] rw [hfact] exact Subalgebra.mul_mem _ hgen (ih (∑ k, m' k) hsum' m' rfl hA' hB') -- main case split @@ -489,7 +491,7 @@ lemma Qslice_mem_adjoin_neutralBilinear {V : EffectivePotential} (hI : IsInvaria rw [(Qslice P).as_sum] apply Subalgebra.sum_mem intro m hm - have hcoeff : coeff m (Qslice P) ≠ 0 := MvPolynomial.mem_support_iff.mp hm + have hcoeff : (Qslice P).coeff m ≠ 0 := MvPolynomial.mem_support_iff.mp hm have hsuppA : ∑ i ∈ m.support, (m i : ℤ) * cartanCharge i = 0 := by by_contra h0 exact hcoeff (coeff_Qslice_eq_zero hI hP m (Or.inl h0)) @@ -500,7 +502,7 @@ lemma Qslice_mem_adjoin_neutralBilinear {V : EffectivePotential} (hI : IsInvaria monomial_mem_adjoin_neutralBilinear m ((charge_univ_eq_support cartanCharge m).trans hsuppA) ((charge_univ_eq_support hyperCharge m).trans hsuppB) - have hrw : monomial m (coeff m (Qslice P)) = C (coeff m (Qslice P)) * monomial m 1 := by + have hrw : monomial m ((Qslice P).coeff m) = C ((Qslice P).coeff m) * monomial m 1 := by rw [C_mul_monomial, mul_one] rw [hrw] exact Subalgebra.mul_mem _ @@ -570,8 +572,8 @@ noncomputable def realPart (H : MvPolynomial (Fin 5) ℂ) : MvPolynomial (Fin 5) open MvPolynomial in @[simp] lemma realPart_coeff (H : MvPolynomial (Fin 5) ℂ) (m : Fin 5 →₀ ℕ) : - coeff m (realPart H) = (coeff m H).re := by - simp only [realPart, coeff, AddMonoidAlgebra.coeff_ofCoeff, Finsupp.mapRange_apply] + (realPart H).coeff m = (H.coeff m).re := by + simp only [realPart, AddMonoidAlgebra.coeff_ofCoeff, Finsupp.mapRange_apply] open MvPolynomial in lemma realPart_C (a : ℂ) : realPart (C a) = C a.re := by diff --git a/PhyslibAlpha/QuantumMechanics/QuantumHarmonicOscillator.lean b/PhyslibAlpha/QuantumMechanics/QuantumHarmonicOscillator.lean index c79cb8fb2..723cd6ae4 100644 --- a/PhyslibAlpha/QuantumMechanics/QuantumHarmonicOscillator.lean +++ b/PhyslibAlpha/QuantumMechanics/QuantumHarmonicOscillator.lean @@ -388,7 +388,6 @@ def coherentState_ℓ2 (α : ℂ) : lp (fun _ : ℕ => ℂ) 2 := { simp_rw [div_pow] at this have h := this.mul_left (Real.exp (-‖α‖ ^ 2 / 2) ^ 2) convert h using 2 with i - · rfl · unfold coherentState rw [norm_div, norm_mul, norm_pow, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, Real.abs_exp, div_pow, mul_pow] diff --git a/PhyslibAlpha/QuantumMechanics/StinespringDilation.lean b/PhyslibAlpha/QuantumMechanics/StinespringDilation.lean index bb467a4c3..c0d2b2f94 100644 --- a/PhyslibAlpha/QuantumMechanics/StinespringDilation.lean +++ b/PhyslibAlpha/QuantumMechanics/StinespringDilation.lean @@ -157,7 +157,7 @@ lemma stinespringOrtho {R : Type*} [RCLike R] simp_rw [RCLike.conj_mul] norm_cast exact EuclideanSpace.norm_sq_eq (WithLp.toLp 2 fun i ↦ α i j) - · rw [if_neg g₀] + · rw [ite_eq_right g₀] have : (1 : Matrix m m R) i j = 0 := by exact one_apply_ne' fun a ↦ g₀ (id (Eq.symm a)) rw [this] at h₁ @@ -716,7 +716,7 @@ lemma krausCompletion_isometry_of_TNI {R : Type*} [RCLike R] {m r : ℕ} intro x i c rw [hS] unfold krausCompletion - rw [dif_pos (by exact i.isLt)] + rw [dite_eq_left (by exact i.isLt)] congr 1 -- The last block of the completion is `W`. have hlast : ∀ (x : Fin m) (c : Fin m), @@ -724,7 +724,7 @@ lemma krausCompletion_isometry_of_TNI {R : Type*} [RCLike R] {m r : ℕ} intro x c rw [hW, hS] unfold krausCompletion - rw [dif_neg (by simp)] + rw [dite_eq_right (by simp)] -- `Cᴴ * C = Sᴴ * S + Wᴴ * W` by splitting the row sum into the first `r` blocks and the last. have key : (krausCompletion K)ᴴ * krausCompletion K = Sᴴ * S + Wᴴ * W := by ext a b diff --git a/PhyslibAlpha/SpaceAndTime/Space/Surfaces/Ring.lean b/PhyslibAlpha/SpaceAndTime/Space/Surfaces/Ring.lean index 92308a57f..146b21d0f 100644 --- a/PhyslibAlpha/SpaceAndTime/Space/Surfaces/Ring.lean +++ b/PhyslibAlpha/SpaceAndTime/Space/Surfaces/Ring.lean @@ -69,7 +69,7 @@ instance ringMeasure_hasTemperateGrowth : instance ringMeasure_prod_volume_hasTemperateGrowth : (ringMeasure.prod (volume (α := Space))).HasTemperateGrowth := by - exact IsDistBounded.instHasTemperateGrowthProdProdOfOpensMeasurableSpace ringMeasure volume + infer_instance instance ringMeasure_sFinite: SFinite ringMeasure := by rw [ringMeasure] diff --git a/QuantumInfo/Channels/Dual.lean b/QuantumInfo/Channels/Dual.lean index 456d81567..08b2e7494 100644 --- a/QuantumInfo/Channels/Dual.lean +++ b/QuantumInfo/Channels/Dual.lean @@ -392,10 +392,10 @@ omit [Fintype dOut] in --PULLOUT @[simp] theorem HPMap.linearMap_ofHermitianMat (f : HermitianMat dIn ℂ →ₗ[ℝ] HermitianMat dOut ℂ) : - LinearMapClass.linearMap (HPMap.ofHermitianMat f) = f := by + LinearMap.ofClass (HPMap.ofHermitianMat f) = f := by ext1 ⟨x, hx⟩ ext1 - simp only [ofHermitianMat, LinearMap.coe_coe] + simp only [ofHermitianMat, LinearMap.coe_ofClass] simp only [HPMap.apply_hermitianMat_eq, HPMap.map, HermitianMat.mat_mk, LinearMap.coe_mk, AddHom.coe_mk] conv => enter [2, 1, 2, 1]; rw [← realPart_add_I_smul_imaginaryPart x] @@ -406,9 +406,9 @@ theorem HPMap.linearMap_ofHermitianMat (f : HermitianMat dIn ℂ →ₗ[ℝ] Her omit [Fintype dOut] in @[simp] theorem HPMap.ofHermitianMat_linearMap (f : HPMap dIn dOut ℂ) : - ofHermitianMat (LinearMapClass.linearMap f) = f := by + ofHermitianMat (LinearMap.ofClass f) = f := by ext : 3 - simp only [map, ofHermitianMat, instFunLike, LinearMap.coe_coe, LinearMap.coe_mk, AddHom.coe_mk] + simp only [map, ofHermitianMat, instFunLike, LinearMap.coe_ofClass, LinearMap.coe_mk, AddHom.coe_mk] simp only [realPart, imaginaryPart, LinearMap.coe_comp, Function.comp_apply] simp only [selfAdjointPart, LinearMap.coe_mk, AddHom.coe_mk, HermitianMat.mat_mk,LinearMap.map_smul_of_tower, skewAdjoint.negISMul] @@ -424,7 +424,7 @@ variable (f : HPMap dIn dOut) (A : HermitianMat dIn ℂ) --structure, doesn't go through Module.Basis the same way. Requires the equivalence between ℝ-linear --maps of HermitianMats and ℂ-linear maps of matrices. def HPMap.hermDual : HPMap dOut dIn := - HPMap.ofHermitianMat (LinearMapClass.linearMap f).adjoint + HPMap.ofHermitianMat (LinearMap.ofClass f).adjoint @[simp] theorem HPMap.hermDual_hermDual : f.hermDual.hermDual = f := by @@ -435,7 +435,7 @@ open RealInnerProductSpace /-- The defining property of a dual map: inner products are preserved on the opposite argument. -/ theorem HPMap.inner_hermDual (B : HermitianMat dOut ℂ) : ⟪f A, B⟫ = ⟪A, f.hermDual B⟫ := by - change ⟪(LinearMapClass.linearMap f) A, B⟫ = ⟪A, (LinearMapClass.linearMap f.hermDual) B⟫ + change ⟪(LinearMap.ofClass f) A, B⟫ = ⟪A, (LinearMap.ofClass f.hermDual) B⟫ rw [hermDual, ← LinearMap.adjoint_inner_right, HPMap.linearMap_ofHermitianMat] /-- Version of `HPMap.inner_hermDual` that uses HermitiaMat.inner directly. TODO cleanup -/ diff --git a/QuantumInfo/Channels/MatrixMap.lean b/QuantumInfo/Channels/MatrixMap.lean index 3b25b8564..1c58f9e2f 100644 --- a/QuantumInfo/Channels/MatrixMap.lean +++ b/QuantumInfo/Channels/MatrixMap.lean @@ -254,7 +254,8 @@ theorem kron_def [CommSemiring R] (M₁ : MatrixMap A B R) (M₂ : MatrixMap C D Module.Basis.tensorProduct_apply, Module.Basis.map_apply, Module.Basis.coe_reindex, Function.comp_apply, Equiv.sigmaEquivProd_symm_apply, Pi.basis_apply, Pi.basisFun_apply, Matrix.coe_ofLinearEquiv, TensorProduct.map_tmul, Module.Basis.tensorProduct_repr_tmul_apply, Module.Basis.map_repr, LinearEquiv.trans_apply, Matrix.coe_ofLinearEquiv_symm, - Module.Basis.repr_reindex, Finsupp.mapDomain_equiv_apply, Pi.basis_repr, Pi.basisFun_repr, Matrix.of_symm_apply, smul_eq_mul, + Module.Basis.repr_reindex, Finsupp.equivMapDomain_apply, + Pi.basis_repr, Pi.basisFun_repr, Matrix.of_symm_apply, smul_eq_mul, Matrix.of_symm_single, Pi.single_apply, Matrix.smul_of, Matrix.sum_apply, Matrix.of_apply, Pi.smul_apply] rw [ Finset.sum_eq_single ( ( b₁, d₁ ), ( b₂, d₂ ) ) ] · rw [ Finset.sum_eq_single ( ( a₁, c₁ ), ( a₂, c₂ ) ) ] diff --git a/QuantumInfo/Channels/Pinching.lean b/QuantumInfo/Channels/Pinching.lean index 094d5f123..b6657656f 100644 --- a/QuantumInfo/Channels/Pinching.lean +++ b/QuantumInfo/Channels/Pinching.lean @@ -416,10 +416,10 @@ theorem pinching_pythagoras (ρ σ : MState d) : rw [h_eq₂, h_eq₁] simp only [EReal.coe_sub] rw [← add_sub_assoc, EReal.sub_add_cancel] - · simp only [qRelativeEnt, SandwichedRelRentropy, dif_pos zero_lt_one] + · simp only [qRelativeEnt, SandwichedRelRentropy, dite_eq_left zero_lt_one] trans ⊤ - · exact dif_neg h_ker + · exact dite_eq_right h_ker · convert (add_top _).symm - apply dif_neg ?_ + apply dite_eq_right ?_ contrapose! h_ker exact h_ker.trans (pinching_map_ker_le ρ σ) diff --git a/QuantumInfo/Channels/Unbundled.lean b/QuantumInfo/Channels/Unbundled.lean index b12dce9eb..3719fecaa 100644 --- a/QuantumInfo/Channels/Unbundled.lean +++ b/QuantumInfo/Channels/Unbundled.lean @@ -661,7 +661,7 @@ theorem conj_isCompletelyPositive (M : Matrix B A R) : (conj M).IsCompletelyPosi ext simp +contextual only [Matrix.kroneckerMap_apply, Matrix.conjTranspose_apply, RCLike.star_def, Matrix.one_apply, apply_ite, mul_one, mul_zero, star_zero, ↓reduceIte, ite_eq_right_iff, - map_eq_zero, if_true_left] + map_eq_zero, ite_true_left] tauto /-- `MatrixMap.submatrix` is completely positive -/ @@ -816,7 +816,8 @@ theorem positive_subunital_norm_apply_le {M : MatrixMap A B ℂ} [DecidableEq B] let eB := Matrix.toEuclideanCLM (n := B) (𝕜 := ℂ) have hXle : X ≤ ‖X‖ • (1 : Matrix A A ℂ) := by refine (map_le_map_iff eA).mp ?_ - have h := IsSelfAdjoint.le_algebraMap_norm_self (IsSelfAdjoint.of_nonneg (map_nonneg eA hX)) + have h := IsSelfAdjoint.le_algebraMap_norm_self (eA X) + (IsSelfAdjoint.of_nonneg (map_nonneg eA hX)) have hs : algebraMap ℝ (EuclideanSpace ℂ A →L[ℂ] EuclideanSpace ℂ A) ‖eA X‖ = eA (‖X‖ • (1 : Matrix A A ℂ)) := by rw [Algebra.algebraMap_eq_smul_one] @@ -836,8 +837,8 @@ theorem positive_subunital_norm_apply_le {M : MatrixMap A B ℂ} [DecidableEq B] rcases subsingleton_or_nontrivial (Matrix B B ℂ) with h | h · simp [Subsingleton.elim (1 : Matrix B B ℂ) 0] · exact CStarRing.norm_one.le - refine (CStarAlgebra.norm_le_norm_of_nonneg_of_le (map_nonneg eB hMX_nn) - ((map_le_map_iff eB).mpr hMX_le)).trans ?_ + refine (CStarAlgebra.norm_le_norm_of_le_of_nonneg ((map_le_map_iff eB).mpr hMX_le) + (map_nonneg eB hMX_nn)).trans ?_ change ‖‖X‖ • (1 : Matrix B B ℂ)‖ ≤ ‖X‖ rw [show (‖X‖ • (1 : Matrix B B ℂ)) = ((‖X‖ : ℂ) • (1 : Matrix B B ℂ)) by ext; simp, norm_smul] simpa using mul_le_mul_of_nonneg_left hone (norm_nonneg X) @@ -851,9 +852,9 @@ theorem cp_subunital_opNorm_le_one {M : MatrixMap A B ℂ} [DecidableEq B] refine (sq_le_sq₀ (norm_nonneg (M X)) (norm_nonneg X)).mp ?_ simp only [sq, ← CStarRing.norm_star_mul_self, Matrix.star_eq_conjTranspose] let e := Matrix.toEuclideanCLM (n := B) (𝕜 := ℂ) - exact (CStarAlgebra.norm_le_norm_of_nonneg_of_le - (map_nonneg e (star_mul_self_nonneg (M X))) - ((map_le_map_iff e).mpr (cp_subunital_kadison_schwarz hM hM1 X))).trans + exact (CStarAlgebra.norm_le_norm_of_le_of_nonneg + ((map_le_map_iff e).mpr (cp_subunital_kadison_schwarz hM hM1 X)) + (map_nonneg e (star_mul_self_nonneg (M X)))).trans (positive_subunital_norm_apply_le hM.IsPositive hM1 (star_mul_self_nonneg X)) /-- diff --git a/QuantumInfo/ClassicalInfo/Distribution.lean b/QuantumInfo/ClassicalInfo/Distribution.lean index 8d395c1ed..990d7ba73 100644 --- a/QuantumInfo/ClassicalInfo/Distribution.lean +++ b/QuantumInfo/ClassicalInfo/Distribution.lean @@ -47,7 +47,7 @@ def mk' (f : α → ℝ) (h₁ : ∀i, 0 ≤ f i) (hN : ∑ i, f i = 1) : ProbDi have h₃ : ∀x, f x ≤ 1 := by intro x simp [← hN, Fintype.sum_eq_sum_compl_add x] - exact Finset.sum_nonneg' h₁ + exact Finset.sum_nonneg fun i _ ↦ h₁ i ⟨ fun i ↦ ⟨f i, ⟨h₁ i, h₃ i⟩⟩, hN⟩ instance instFunLikeProb : FunLike (ProbDistribution α) α Prob where @@ -116,7 +116,7 @@ theorem constant_of_exists_one {D : ProbDistribution α} {x : α} (h : D x = 1) rw [← Finset.add_sum_erase _ _ (Finset.mem_univ x), h, Prob.coe_one] at this rw [← Finset.add_sum_erase _ _ (a := y) (by simpa using (Ne.symm h₂))] at this have : 0 ≤ ∑ x ∈ Finset.erase (Finset.erase Finset.univ x) y, (D x : ℝ) := - Finset.sum_nonneg' (fun _ ↦ Prob.zero_le_coe) + Finset.sum_nonneg (fun _ _ ↦ Prob.zero_le_coe) linarith /-- Make an uniform distribution. -/ diff --git a/QuantumInfo/ClassicalInfo/Entropy.lean b/QuantumInfo/ClassicalInfo/Entropy.lean index 94da94351..eeacd2a7c 100644 --- a/QuantumInfo/ClassicalInfo/Entropy.lean +++ b/QuantumInfo/ClassicalInfo/Entropy.lean @@ -89,7 +89,7 @@ def Hₛ (d : ProbDistribution α) : ℝ := /-- Shannon entropy of a distribution is nonnegative. -/ theorem Hₛ_nonneg (d : ProbDistribution α) : 0 ≤ Hₛ d := - Finset.sum_nonneg' fun _ ↦ H₁_nonneg _ + Finset.sum_nonneg fun _ _ ↦ H₁_nonneg _ /-- Shannon entropy of a distribution is at most ln d. -/ theorem Hₛ_le_log_d (d : ProbDistribution α) : Hₛ d ≤ Real.log (Fintype.card α) := by diff --git a/QuantumInfo/ClassicalInfo/Prob.lean b/QuantumInfo/ClassicalInfo/Prob.lean index b07249c0e..796c3d1b4 100644 --- a/QuantumInfo/ClassicalInfo/Prob.lean +++ b/QuantumInfo/ClassicalInfo/Prob.lean @@ -8,7 +8,7 @@ module public import Mathlib.Analysis.Convex.Mul public import Mathlib.Analysis.SpecialFunctions.Log.Basic public import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog -public import Mathlib.Data.NNReal.Basic +public import Mathlib.Basic.NNReal.Basic public import Mathlib.Data.EReal.Basic public import Mathlib.Tactic.Finiteness public import Mathlib.Topology.UnitInterval @@ -50,7 +50,8 @@ instance instOne : One Prob := instance instMul : Mul Prob := ⟨fun x y ↦ ⟨x.1 * y.1, - ⟨mul_nonneg x.2.1 y.2.1, mul_le_one₀ x.2.2 y.2.1 y.2.2⟩⟩⟩ + ⟨mul_nonneg x.2.1 y.2.1, + (mul_le_of_le_one_left y.2.1 x.2.2).trans y.2.2⟩⟩⟩ @[simp, norm_cast] theorem coe_zero : (0 : Prob).val = 0 := @@ -493,7 +494,7 @@ theorem negLog_eq_neg_ENNReal_log (p : Prob) : —log p = -ENNReal.log p := by rw [negLog] split_ifs with hp · simp [hp] - · rw [log, if_neg, if_neg] + · rw [log, ite_eq_right, ite_eq_right] · norm_cast · finiteness · rw [Subtype.ext_iff] at hp @@ -532,7 +533,7 @@ theorem Continuous_negLog : Continuous negLog := by --Thanks Aristotle have h_cont_at_zero : ContinuousAt —log 0 := by unfold Prob.negLog - rw [ContinuousAt, if_pos rfl, ENNReal.tendsto_nhds_top_iff_nnreal] + rw [ContinuousAt, ite_eq_left rfl, ENNReal.tendsto_nhds_top_iff_nnreal] intro x rw [Metric.eventually_nhds_iff] use Real.exp (-x), by positivity diff --git a/QuantumInfo/Entropy/DPI.lean b/QuantumInfo/Entropy/DPI.lean index 252e9eede..aa4cee1f5 100644 --- a/QuantumInfo/Entropy/DPI.lean +++ b/QuantumInfo/Entropy/DPI.lean @@ -1195,7 +1195,7 @@ theorem ker_le_traceRight {ρ σ : MState (dA × dB)} intro b exact Finset.sum_eq_zero_iff_of_nonneg (fun b _ => h_nonneg b) |>.mp hin b (Finset.mem_univ _) have h_σ_zero : ∀ b : dB, σ.M.mat *ᵥ (vecTensorBasis v.ofLp b) = 0 := - fun b => (hσ_psd.dotProduct_mulVec_zero_iff _).mp (h_each_zero b) + fun b => hσ_psd.dotProduct_mulVec_zero_iff.mp (h_each_zero b) have h_ρ_zero : ∀ b : dB, ρ.M.mat *ᵥ (vecTensorBasis v.ofLp b) = 0 := by intro b have hmem_σ : (WithLp.toLp 2 (vecTensorBasis v.ofLp b) : EuclideanSpace ℂ _) ∈ σ.M.ker := by @@ -1440,7 +1440,7 @@ private lemma sandwichedTraceFunctional_sub_one_div_eventually_le have h_r_nonneg : ∀ α : ℝ, 1 < α → 0 ≤ r α := by intro α hα have h := sandwichedRelRentropy_nonneg (ρ := ρ) (σ := σ) (α := α) (by linarith) hker - rw [if_neg hα.ne'] at h + rw [ite_eq_right hα.ne'] at h simpa [hr_def, sandwichedTraceFunctional] using h have h_eq : ∀ α : ℝ, 1 < α → D̃_ α(ρ‖σ) = ENNReal.ofReal (r α) := fun α hα => sandwichedRelRentropy_eq_log_traceFunctional (by linarith) hα.ne' hker diff --git a/QuantumInfo/Entropy/Relative.lean b/QuantumInfo/Entropy/Relative.lean index 681f7b493..cd6b81a2a 100644 --- a/QuantumInfo/Entropy/Relative.lean +++ b/QuantumInfo/Entropy/Relative.lean @@ -190,17 +190,8 @@ lemma HermitianMat.trace_rpow_le_trace_of_le_one private lemma trace_conj_rpow_eq_inner (hα₀ : 0 < α) (hα : α < 1) : ((ρ.M ^ α).conj (σ.M ^ ((1 - α) / (2 * α) * α)).mat).trace = ⟪ρ.M ^ α, σ.M ^ (1 - α)⟫_ℝ := by - convert congr_arg _ ( HermitianMat.inner_eq_trace_rc _ _ ) using 2; - rotate_left; - rotate_left; - rotate_left; - exact d; - exact ℂ; - all_goals try infer_instance; - exact ρ ^ α; - exact σ ^ ( 1 - α ); - rotate_right; - exact fun x => x.re; + convert congr_arg (fun x : ℂ => x.re) + (HermitianMat.inner_eq_trace_rc (ρ.M ^ α) (σ.M ^ (1 - α))) using 2; · unfold HermitianMat.conj; simp [ Matrix.trace, Matrix.mul_apply, inner] rw [ show ( 1 - α ) / ( 2 * α ) * α = ( 1 - α ) / 2 by rw [ div_mul_eq_mul_div, div_eq_iff ] <;> linarith ]; @@ -216,7 +207,6 @@ private lemma trace_conj_rpow_eq_inner (hα₀ : 0 < α) (hα : α < 1) : simp [ Matrix.mul_assoc ] convert! congr_arg Complex.re h_trace using 1; simp [ Matrix.trace, Matrix.mul_apply ]; - · exact HermitianMat.inner_eq_re_trace _ _ private lemma inner_rpow_le_one (hα₀ : 0 < α) (hα : α < 1) : ⟪ρ.M ^ α, σ.M ^ (1 - α)⟫_ℝ ≤ 1 := by @@ -1047,7 +1037,7 @@ private lemma cross_term_slope_tendsto_zero positivity); refine' ⟨ δ, hδ_pos, fun x hx hx' => _ ⟩; simp +zetaDelta at *; - rw [ if_neg hx ]; + rw [ ite_eq_right hx ]; rw [ ← Finset.sum_sub_distrib ]; exact lt_of_le_of_lt ( Finset.abs_sum_le_sum_abs _ _ ) ( lt_of_le_of_lt ( Finset.sum_le_sum fun i _ => le_of_lt ( by simpa [ hx ] using hδ x hx hx' i ) ) ( by norm_num; nlinarith [ mul_div_cancel₀ ε ( by positivity : ( Fintype.card d + 1 : ℝ ) ≠ 0 ) ] ) ); · rw [ Metric.tendsto_nhdsWithin_nhds ]; @@ -1688,7 +1678,7 @@ private theorem sandwichedRelRentropy.continuousOn_Ioi_1 (ρ σ : MState d) : dsimp only have hα₀ : 0 < α := by linarith have hα₁ : α ≠ 1 := by linarith - simp only [dif_pos hα₀, if_neg hα₁, ENNReal.ofReal] + simp only [dite_eq_left hα₀, ite_eq_right hα₁, ENNReal.ofReal] rw [Real.toNNReal_of_nonneg] rfl · rw [continuousOn_congr (f := fun α ↦ ⊤)] @@ -1748,7 +1738,7 @@ set_option backward.isDefEq.respectTransparency false in private theorem sandwichedRelRentropy.continuousAt_1 (ρ σ : MState d) : ContinuousWithinAt (fun α => D̃_ α(ρ‖σ)) (Set.Ioi 0) 1 := by by_cases h : σ.M.ker ≤ ρ.M.ker - · simp only [ContinuousWithinAt, SandwichedRelRentropy, dif_pos h, zero_lt_one, if_true] + · simp only [ContinuousWithinAt, SandwichedRelRentropy, dite_eq_left h, zero_lt_one, ite_true] -- Use the fact that the limit of the real-valued function is the inner product. have h_real_limit : Filter.Tendsto (fun α : ℝ => if α = 1 then ⟪ρ.M, ρ.M.log - σ.M.log⟫ else Real.log ((HermitianMat.conj (σ.M ^ ((1 - α) / (2 * α))).mat) ρ.M ^ α).trace / (α - 1)) (nhdsWithin 1 (Set.Ioi 0)) (nhds ⟪ρ.M, ρ.M.log - σ.M.log⟫) := by have h_real_limit : Filter.Tendsto (fun α : ℝ => Real.log ((HermitianMat.conj (σ.M ^ ((1 - α) / (2 * α))).mat) ρ.M ^ α).trace / (α - 1)) (nhdsWithin 1 (Set.Ioi 0 \ {1})) (nhds ⟪ρ.M, ρ.M.log - σ.M.log⟫) := by @@ -1770,7 +1760,7 @@ private theorem sandwichedRelRentropy.continuousAt_1 (ρ σ : MState d) : exact Real.toNNReal_of_nonneg _ · apply tendsto_const_nhds.congr' filter_upwards [self_mem_nhdsWithin] with α hα - simp only [SandwichedRelRentropy, Set.mem_Ioi.mp hα, zero_lt_one, dif_neg h] + simp only [SandwichedRelRentropy, Set.mem_Ioi.mp hα, zero_lt_one, dite_eq_right h] @[fun_prop] theorem sandwichedRelRentropy.continuousOn (ρ σ : MState d) : @@ -2097,7 +2087,7 @@ carefully handling what happens with the kernel subspace, which will make this a set_option backward.isDefEq.respectTransparency false in @[fun_prop] theorem qRelativeEnt.lowerSemicontinuous (ρ : MState d) : LowerSemicontinuous fun σ => 𝐃(ρ‖σ) := by - simp_rw [qRelativeEnt, SandwichedRelRentropy, if_true, lowerSemicontinuous_iff] + simp_rw [qRelativeEnt, SandwichedRelRentropy, ite_true, lowerSemicontinuous_iff] simp only [zero_lt_one, ↓reduceDIte] intro x by_cases hx : x.M.ker ≤ ρ.M.ker diff --git a/QuantumInfo/Entropy/VonNeumann.lean b/QuantumInfo/Entropy/VonNeumann.lean index 59e5e7717..aeee3d3e2 100644 --- a/QuantumInfo/Entropy/VonNeumann.lean +++ b/QuantumInfo/Entropy/VonNeumann.lean @@ -119,7 +119,10 @@ theorem Sᵥₙ_eq_neg_trace_log (ρ : MState d) : Sᵥₙ ρ = -⟪ρ.M.log, ρ rw [← trace_eq_re_trace, ← sum_eigenvalues_eq_trace] obtain ⟨e, he⟩ := ρ.M.cfc_eigenvalues (Real.log * id) apply Finset.sum_equiv e.symm (by simp) - simp [MState.spectrum, ProbDistribution.mk', he, mul_comm] + simp only [MState.spectrum, ProbDistribution.mk'] + intro i + rw [he] + simp [mul_comm] /-- Von Neumann entropy is the trace of the matrix function `x ↦ -x log x`. -/ theorem Sᵥₙ_eq_trace_cfc_negMulLog (ρ : MState d) : diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/BlockDiagonal.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/BlockDiagonal.lean index 6f0af1e74..f07beb72a 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/BlockDiagonal.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/BlockDiagonal.lean @@ -187,9 +187,9 @@ omit [CompleteSpace ℋ] [Nontrivial ℋ] in omit [CompleteSpace ℋ] [Nontrivial ℋ] in theorem blockDiagonal_nonneg {A B : L ℋ} (hA : 0 ≤ A) (hB : 0 ≤ B) : 0 ≤ blockDiagonal (ℋ := ℋ) A B := by - have hApos : A.IsPositive := (ContinuousLinearMap.nonneg_iff_isPositive A).mp hA - have hBpos : B.IsPositive := (ContinuousLinearMap.nonneg_iff_isPositive B).mp hB - refine (ContinuousLinearMap.nonneg_iff_isPositive _).mpr ?_ + have hApos : A.IsPositive := ContinuousLinearMap.nonneg_iff_isPositive.mp hA + have hBpos : B.IsPositive := ContinuousLinearMap.nonneg_iff_isPositive.mp hB + refine ContinuousLinearMap.nonneg_iff_isPositive.mpr ?_ rw [ContinuousLinearMap.isPositive_iff_complex] intro z have hAz := (ContinuousLinearMap.isPositive_iff_complex A).mp hApos (hsumProj ℋ 0 z) diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/GeneralizedPerspectiveFunction.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/GeneralizedPerspectiveFunction.lean index e5bd68b95..eb062b533 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/GeneralizedPerspectiveFunction.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/GeneralizedPerspectiveFunction.lean @@ -480,7 +480,7 @@ private lemma generalizedPerspective_neg ((fun x : ℝ ↦ -f x) Δ h) A B = -((f Δ h) A B) := by simp [GeneralizedPerspective, cfcR, cfc_neg, mul_assoc] -omit [Nontrivial ℋ] in +omit [CompleteSpace ℋ] [Nontrivial ℋ] in private lemma jointlyConvexOn_neg {s : Set (L ℋ)} {t : Set (L ℋ)} {Φ : L ℋ → L ℋ → L ℋ} (hΦ : JointlyConvexOn s t (fun A B ↦ -Φ A B)) : diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/HilbertSchmidtOperatorSpace.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/HilbertSchmidtOperatorSpace.lean index be2222b91..f309c20bd 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/HilbertSchmidtOperatorSpace.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/HilbertSchmidtOperatorSpace.lean @@ -390,12 +390,12 @@ omit [CompleteSpace ℋ] in lemma leftMulHS_nonneg {A : L ℋ} (hA0 : 0 ≤ A) : 0 ≤ leftMulHS (ℋ := ℋ) A := by - have hApos : A.IsPositive := (ContinuousLinearMap.nonneg_iff_isPositive A).1 hA0 + have hApos : A.IsPositive := ContinuousLinearMap.nonneg_iff_isPositive.1 hA0 have hA_sa : IsSelfAdjoint A := hApos.isSelfAdjoint have hleft_sa : IsSelfAdjoint (leftMulHS (ℋ := ℋ) A) := by change star (leftMulHS (ℋ := ℋ) A) = leftMulHS (ℋ := ℋ) A simp [hA_sa.star_eq, leftMulHS_star (ℋ := ℋ) A] - refine (ContinuousLinearMap.nonneg_iff_isPositive _).2 ?_ + refine ContinuousLinearMap.nonneg_iff_isPositive.2 ?_ rw [ContinuousLinearMap.isPositive_iff_complex] intro X constructor diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequality.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequality.lean index 09d181d54..4ff64ed31 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequality.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequality.lean @@ -165,7 +165,7 @@ private lemma spectrum_zero_subset_Ici_wrap : simpa using hx simp [Set.Ici, hx0] -omit [Nontrivial ℋ] in +omit [CompleteSpace ℋ] [Nontrivial ℋ] in private lemma blockDiagonal_le_left_wrap {A0 A1 B0 B1 : L ℋ} (h : blockDiagonal (ℋ := ℋ) A0 A1 ≤ blockDiagonal (ℋ := ℋ) B0 B1) : A0 ≤ B0 := by @@ -181,7 +181,7 @@ private lemma blockDiagonal_le_left_wrap {A0 A1 B0 B1 : L ℋ} exact hsub ▸ sub_nonneg.mpr h have hpos : (blockDiagonal (ℋ := ℋ) (B0 - A0) (B1 - A1)).IsPositive := - (ContinuousLinearMap.nonneg_iff_isPositive _).1 hnonneg + ContinuousLinearMap.nonneg_iff_isPositive.1 hnonneg have hleftPos : (B0 - A0).IsPositive := by rw [ContinuousLinearMap.isPositive_iff_complex] intro x @@ -189,7 +189,7 @@ private lemma blockDiagonal_le_left_wrap {A0 A1 B0 B1 : L ℋ} (ContinuousLinearMap.isPositive_iff_complex (blockDiagonal (ℋ := ℋ) (B0 - A0) (B1 - A1))).1 hpos (hsumIncl ℋ 0 x) simpa [blockDiagonal, hsumProj, hsumIncl, hsumEquiv, PiLp.inner_apply] using hx - exact sub_nonneg.mp ((ContinuousLinearMap.nonneg_iff_isPositive _).2 hleftPos) + exact sub_nonneg.mp (ContinuousLinearMap.nonneg_iff_isPositive.2 hleftPos) -- Theorem 2.5.2 `(iv) → (v)`. set_option maxHeartbeats 3000000 in diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIImpIV.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIImpIV.lean index 894f03e6b..c0976cf0a 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIImpIV.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIImpIV.lean @@ -196,6 +196,7 @@ private lemma cfcR_blockDiagonal (f : ℝ → ℝ) simp [φ, blockDiagonalHom] -- Converting positivity on a block-diagonal operator to each diagonal block is expensive. +omit [CompleteSpace ℋ] in private lemma blockDiagonal_le_left {A0 A1 B0 B1 : L ℋ} (h : blockDiagonal (ℋ := ℋ) A0 A1 ≤ blockDiagonal (ℋ := ℋ) B0 B1) : A0 ≤ B0 := by @@ -211,7 +212,7 @@ private lemma blockDiagonal_le_left {A0 A1 B0 B1 : L ℋ} exact hsub ▸ sub_nonneg.mpr h have hpos : (blockDiagonal (ℋ := ℋ) (B0 - A0) (B1 - A1)).IsPositive := - (ContinuousLinearMap.nonneg_iff_isPositive _).1 hnonneg + ContinuousLinearMap.nonneg_iff_isPositive.1 hnonneg have hleftPos : (B0 - A0).IsPositive := by rw [ContinuousLinearMap.isPositive_iff_complex] intro x @@ -219,7 +220,7 @@ private lemma blockDiagonal_le_left {A0 A1 B0 B1 : L ℋ} (ContinuousLinearMap.isPositive_iff_complex (blockDiagonal (ℋ := ℋ) (B0 - A0) (B1 - A1))).1 hpos (hsumIncl ℋ 0 x) simpa [blockDiagonal, hsumProj, hsumIncl, hsumEquiv, PiLp.inner_apply] using hx - exact (sub_nonneg.mp ((ContinuousLinearMap.nonneg_iff_isPositive _).2 hleftPos)) + exact (sub_nonneg.mp (ContinuousLinearMap.nonneg_iff_isPositive.2 hleftPos)) private lemma blockDiagonal_selfAdjoint {A B : L ℋ} (hA : IsSelfAdjoint A) (hB : IsSelfAdjoint B) : @@ -236,7 +237,7 @@ private lemma cfcR_zero (f : ℝ → ℝ) : private lemma cfcR_conj_unitary (f : ℝ → ℝ) (hcont : ContinuousOn f Set.univ) (u : unitary (L ℋ)) (A : L ℋ) (hA : IsSelfAdjoint A) : cfcR (ℋ := ℋ) f (star u * A * u) = star u * cfcR (ℋ := ℋ) f A * u := by - let φ : L ℋ →⋆ₐ[ℝ] L ℋ := Unitary.conjStarAlgAut ℝ (L ℋ) (star u) + let φ : L ℋ →⋆ₐ[ℝ] L ℋ := (Unitary.conjStarAlgAut ℝ (L ℋ) (star u)).toStarAlgHom have hφ : Continuous φ := by have h1 : Continuous (fun x : L ℋ => (star u : L ℋ) * x * (u : L ℋ)) := by fun_prop @@ -254,7 +255,7 @@ private lemma cfcR_conj_unitary_on (s : Set ℝ) (f : ℝ → ℝ) (hcont : Cont {A : L ℋ} (hAs : spectrum ℝ A ⊆ s) (u : unitary (L ℋ)) (hA : IsSelfAdjoint A) : cfcR (ℋ := ℋ) f (star u * A * u) = star u * cfcR (ℋ := ℋ) f A * u := by - let φ : L ℋ →⋆ₐ[ℝ] L ℋ := Unitary.conjStarAlgAut ℝ (L ℋ) (star u) + let φ : L ℋ →⋆ₐ[ℝ] L ℋ := (Unitary.conjStarAlgAut ℝ (L ℋ) (star u)).toStarAlgHom have hφ : Continuous φ := by have h1 : Continuous (fun x : L ℋ => (star u : L ℋ) * x * (u : L ℋ)) := by fun_prop diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIVtoV.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIVtoV.lean index 02e3168cf..13c2628a0 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIVtoV.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/JensenOperatorInequalityIVtoV.lean @@ -63,12 +63,12 @@ omit [CompleteSpace ℋ] in private theorem nontrivial_hsumL : Nontrivial (L (HSum ℋ)) := by have h_not_sub : ¬ Subsingleton ℋ := by intro hsub - letI : Subsingleton ℋ := hsub - letI : Subsingleton (L ℋ) := by infer_instance + let _ : Subsingleton ℋ := hsub + let _ : Subsingleton (L ℋ) := by infer_instance exact (not_nontrivial_iff_subsingleton.mpr (by infer_instance)) (inferInstance : Nontrivial (L ℋ)) have hH_nontriv : Nontrivial ℋ := (not_subsingleton_iff_nontrivial.mp h_not_sub) - letI : Nontrivial ℋ := hH_nontriv + let _ : Nontrivial ℋ := hH_nontriv rcases exists_pair_ne ℋ with ⟨x, y, hxy⟩ let w : ℋ := x - y have hw : w ≠ 0 := sub_ne_zero.mpr hxy @@ -155,7 +155,7 @@ private lemma cfcR_blockDiagonal (f : ℝ → ℝ) _ = blockDiagonal (ℋ := ℋ) (cfcR (ℋ := ℋ) f A) (cfcR (ℋ := ℋ) f B) := by simp [φ, blockDiagonalHom] -omit [Nontrivial ℋ] in +omit [CompleteSpace ℋ] [Nontrivial ℋ] in private lemma blockDiagonal_le_left {A0 A1 B0 B1 : L ℋ} (h : blockDiagonal (ℋ := ℋ) A0 A1 ≤ blockDiagonal (ℋ := ℋ) B0 B1) : A0 ≤ B0 := by @@ -171,7 +171,7 @@ private lemma blockDiagonal_le_left {A0 A1 B0 B1 : L ℋ} exact hsub ▸ sub_nonneg.mpr h have hpos : (blockDiagonal (ℋ := ℋ) (B0 - A0) (B1 - A1)).IsPositive := - (ContinuousLinearMap.nonneg_iff_isPositive _).1 hnonneg + ContinuousLinearMap.nonneg_iff_isPositive.1 hnonneg have hleftPos : (B0 - A0).IsPositive := by rw [ContinuousLinearMap.isPositive_iff_complex] intro x @@ -179,7 +179,7 @@ private lemma blockDiagonal_le_left {A0 A1 B0 B1 : L ℋ} (ContinuousLinearMap.isPositive_iff_complex (blockDiagonal (ℋ := ℋ) (B0 - A0) (B1 - A1))).1 hpos (hsumIncl ℋ 0 x) simpa [blockDiagonal, hsumProj, hsumIncl, hsumEquiv, PiLp.inner_apply] using hx - exact sub_nonneg.mp ((ContinuousLinearMap.nonneg_iff_isPositive _).2 hleftPos) + exact sub_nonneg.mp (ContinuousLinearMap.nonneg_iff_isPositive.2 hleftPos) -- Scratch theorem for fast feedback while formalizing Theorem 2.5.2 `(iv) → (v)`. -- This file intentionally avoids importing the heavy `(i) → (iv)` proof. @@ -200,7 +200,7 @@ theorem theorem_2_5_2_iv_imp_v {f : ℝ → ℝ} (hiv : CondIVAll.{u} f) simpa [Set.Ici] using hBs hx let Atilde : L (HSum ℋ) := blockDiagonal (ℋ := ℋ) A B let Xtilde : L (HSum ℋ) := blockOp (ℋ := ℋ) X 0 Y 0 - letI : Nontrivial (L (HSum ℋ)) := nontrivial_hsumL (ℋ := ℋ) + let _ : Nontrivial (L (HSum ℋ)) := nontrivial_hsumL (ℋ := ℋ) have hAtilde_sa : IsSelfAdjoint Atilde := by simpa [Atilde] using blockDiagonal_selfAdjoint (ℋ := ℋ) hA hB have hAtilde0 : (0 : L (HSum ℋ)) ≤ Atilde := by diff --git a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/LiebAndoTrace.lean b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/LiebAndoTrace.lean index f87313c3e..5d134f526 100644 --- a/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/LiebAndoTrace.lean +++ b/QuantumInfo/ForMathlib/HayataGroup/TraceInequality/LiebAndoTrace.lean @@ -146,7 +146,7 @@ omit [Nontrivial ℋ] in private lemma phiK_nonneg (K : L ℋ) {T : L (HSOp ℋ)} (hT : 0 ≤ T) : 0 ≤ phiK (ℋ := ℋ) K T := by dsimp [phiK] - have hpos : T.IsPositive := (ContinuousLinearMap.nonneg_iff_isPositive T).1 hT + have hpos : T.IsPositive := ContinuousLinearMap.nonneg_iff_isPositive.1 hT have hnonneg : 0 ≤ Complex.re (inner ℂ (T (ofOp (star K))) (ofOp (star K))) := by exact ((ContinuousLinearMap.isPositive_iff_complex T).1 hpos (ofOp (star K))).2 have hre : @@ -208,7 +208,7 @@ private lemma re_inner_nonneg_of_nonneg {T : 𝓚 →L[ℂ] 𝓚} (hT : 0 ≤ T) : ∀ x : 𝓚, 0 ≤ Complex.re (inner ℂ x (T x)) := by intro x - have hpos : T.IsPositive := (ContinuousLinearMap.nonneg_iff_isPositive T).1 hT + have hpos : T.IsPositive := ContinuousLinearMap.nonneg_iff_isPositive.1 hT have hnonneg : 0 ≤ Complex.re (inner ℂ (T x) x) := ((ContinuousLinearMap.isPositive_iff_complex T).1 hpos x).2 have hre : diff --git a/QuantumInfo/ForMathlib/HermitianMat/Inner.lean b/QuantumInfo/ForMathlib/HermitianMat/Inner.lean index 913c71be2..60d60c60a 100644 --- a/QuantumInfo/ForMathlib/HermitianMat/Inner.lean +++ b/QuantumInfo/ForMathlib/HermitianMat/Inner.lean @@ -509,7 +509,7 @@ lemma inner_eq_doubly_stochastic_sum {d : Type*} [Fintype d] [DecidableEq d] push_cast simp only [Matrix.trace, Matrix.diag_apply, Matrix.mul_apply, hC_norm] simp only [Matrix.diagonal_apply, ite_mul, zero_mul, mul_ite, mul_zero, - Finset.sum_ite_eq, Finset.sum_ite_eq', Finset.mem_univ, if_true, Function.comp_apply, + Finset.sum_ite_eq, Finset.sum_ite_eq', Finset.mem_univ, ite_true, Function.comp_apply, Matrix.conjTranspose_apply] exact Finset.sum_congr rfl fun _ _ => Finset.sum_congr rfl fun _ _ => by simp only [RCLike.ofReal_eq_complex_ofReal]; ring diff --git a/QuantumInfo/ForMathlib/HermitianMat/Order.lean b/QuantumInfo/ForMathlib/HermitianMat/Order.lean index 543d126d0..458680469 100644 --- a/QuantumInfo/ForMathlib/HermitianMat/Order.lean +++ b/QuantumInfo/ForMathlib/HermitianMat/Order.lean @@ -446,7 +446,7 @@ theorem inner_mulVec_nonneg (hA : 0 ≤ A) (v : n → 𝕜) : theorem mem_ker_of_inner_mulVec_zero [DecidableEq n] (hA : 0 ≤ A) (v : EuclideanSpace 𝕜 n) (h : star v ⬝ᵥ A.mat *ᵥ v = 0) : v ∈ A.ker := by - have := ((zero_le_iff.mp hA).dotProduct_mulVec_zero_iff v).mp h + have := ((zero_le_iff.mp hA).dotProduct_mulVec_zero_iff (x := v)).mp h exact congr(WithLp.toLp 2 $this) theorem ker_add [DecidableEq n] (hA : 0 ≤ A) (hB : 0 ≤ B) : @@ -461,8 +461,8 @@ theorem ker_add [DecidableEq n] (hA : 0 ≤ A) (hB : 0 ≤ B) : rw [Matrix.posSemidef_iff_dotProduct_mulVec] at hA' hB' obtain ⟨hzA, hzB⟩ := (add_eq_zero_iff_of_nonneg (hA'.2 v) (hB'.2 v)).mp h3 rw [← Matrix.posSemidef_iff_dotProduct_mulVec] at hA' hB' - exact ⟨(hA'.dotProduct_mulVec_zero_iff v).mp hzA, - (hB'.dotProduct_mulVec_zero_iff v).mp hzB⟩ + exact ⟨(hA'.dotProduct_mulVec_zero_iff (x := v)).mp hzA, + (hB'.dotProduct_mulVec_zero_iff (x := v)).mp hzB⟩ · simp +contextual [Matrix.add_mulVec] theorem ker_sum [DecidableEq n] (f : ι → HermitianMat n 𝕜) (hf : ∀ i, 0 ≤ f i) : @@ -492,8 +492,8 @@ theorem ker_conj [DecidableEq n] (hA : 0 ≤ A) (B : Matrix n n 𝕜) : ext v; simp [HermitianMat.conj]; constructor <;> intro h; - · have := Matrix.PosSemidef.dotProduct_mulVec_zero_iff ( show Matrix.PosSemidef A.mat from zero_le_iff.mp hA ); - convert this ( Bᴴ.mulVec v ) |>.1 _ using 1; + · have hA' : Matrix.PosSemidef A.mat := zero_le_iff.mp hA; + convert hA'.dotProduct_mulVec_zero_iff (x := Bᴴ.mulVec v) |>.1 _ using 1; · rw [ mem_ker_iff_mulVec_zero ]; congr! 2; · convert congr_arg ( fun x : EuclideanSpace _ _ => star v.ofLp ⬝ᵥ x ) h using 1 diff --git a/QuantumInfo/ForMathlib/HermitianMat/Peierls.lean b/QuantumInfo/ForMathlib/HermitianMat/Peierls.lean index 08d48b5c1..c27cbecfc 100644 --- a/QuantumInfo/ForMathlib/HermitianMat/Peierls.lean +++ b/QuantumInfo/ForMathlib/HermitianMat/Peierls.lean @@ -142,7 +142,7 @@ theorem trace_function_convex_univ (g : ℝ → ℝ) (hg : ConvexOn ℝ Set.univ simp_all [conj] convert congr_arg Complex.re ‹ (diagonal ℂ _) i i = _ › using 1 · exact Eq.symm (by erw [show (diagonal ℂ _ : HermitianMat d ℂ) i i = - (C.H.eigenvalues i : ℂ) by exact if_pos rfl]; norm_cast) + (C.H.eigenvalues i : ℂ) by exact ite_eq_left rfl]; norm_cast) · norm_num [Complex.ext_iff] rw [h_eigenvalue] exact hg.2 trivial trivial ha hb hab @@ -202,7 +202,7 @@ theorem trace_function_convex_ici {g : ℝ → ℝ} (hg : ConvexOn ℝ (Set.Ici simp_all [conj] convert congr_arg Complex.re h_eigenvalue using 1 · exact Eq.symm (by erw [show (diagonal ℂ _ : HermitianMat d ℂ) i i = - (C.H.eigenvalues i : ℂ) by exact if_pos rfl]; norm_cast) + (C.H.eigenvalues i : ℂ) by exact ite_eq_left rfl]; norm_cast) · norm_num [Complex.ext_iff] rw [h_eigenvalue] refine hg.2 ?_ ?_ ha hb hab diff --git a/QuantumInfo/ForMathlib/Isometry.lean b/QuantumInfo/ForMathlib/Isometry.lean index b45bb8581..3272d8ec6 100644 --- a/QuantumInfo/ForMathlib/Isometry.lean +++ b/QuantumInfo/ForMathlib/Isometry.lean @@ -540,7 +540,7 @@ theorem star_shared_mul_A_mul_IsDiag : IsDiag · have := ( sharedEigenbasis hA hB hAB ).orthonormal; rw [ orthonormal_iff_ite ] at this; simp only [inner, ← starRingEnd_apply] at this - rw [ ← Finset.smul_sum, this i j, if_neg hij, smul_zero ] + rw [ ← Finset.smul_sum, this i j, ite_eq_right hij, smul_zero ] /-- Analogous to `Matrix.IsHermitian.star_mul_self_mul_eq_diagonal` for the shared basis. -/ theorem star_shared_mul_B_mul_IsDiag : IsDiag diff --git a/QuantumInfo/ForMathlib/Majorization.lean b/QuantumInfo/ForMathlib/Majorization.lean index 9bb257922..f0535e5f4 100644 --- a/QuantumInfo/ForMathlib/Majorization.lean +++ b/QuantumInfo/ForMathlib/Majorization.lean @@ -365,7 +365,7 @@ lemma prod_le_prod_sorted {n : ℕ} {f : Fin n → ℝ} ← Finset.prod_image (f := f) (fun a _ b _ h => hg'_inj (by simpa using h))] exact Finset.prod_congr hg'_eq (fun _ _ => rfl) rw [h_prod_eq] - apply Finset.prod_le_prod (fun i _ => hf_nn _) (fun i _ => ?_) + apply Finset.prod_le_prod₀ (fun i _ => hf_nn _) (fun i _ => ?_) apply hf -- Need: i.val ≤ (g' i).val for strictly monotone g' -- By induction: g'(0) ≥ 0, and g'(j+1) > g'(j) ≥ j implies g'(j+1) ≥ j+1 @@ -673,8 +673,8 @@ lemma IsHermitian.inner_le_sup_eigenvalue_mul_inner simp [dotProduct, Matrix.mulVec, Finset.mul_sum _ _ _, mul_assoc, mul_comm,] simp [Complex.normSq, Complex.sq_norm, diagonal] rw [← Finset.sum_sub_distrib]; refine' Finset.sum_congr rfl fun i hi => _; rw [Finset.sum_eq_single i, Finset.sum_eq_single i] <;> simp +contextual; ring_nf - · exact fun j hj => Or.inl (by rw [if_neg (Ne.symm hj)]; norm_num) - · exact fun j hj => Or.inl (by rw [if_neg (Ne.symm hj)]; norm_num) + · exact fun j hj => Or.inl (by rw [ite_eq_right (Ne.symm hj)]; norm_num) + · exact fun j hj => Or.inl (by rw [ite_eq_right (Ne.symm hj)]; norm_num) -- Since $U$ is unitary, we have $\|w\|^2 = \|v\|^2$. have h_unitary : ∑ i, ‖w i‖ ^ 2 = (star v ⬝ᵥ v).re := by have h_unitary : ∀ (U : Matrix e e ℂ), U.conjTranspose * U = 1 → ∀ (v : e → ℂ), ∑ i, ‖(U.mulVec v) i‖ ^ 2 = ∑ i, ‖v i‖ ^ 2 := by diff --git a/QuantumInfo/ForMathlib/Matrix.lean b/QuantumInfo/ForMathlib/Matrix.lean index 9e3d16ede..7fdb90282 100644 --- a/QuantumInfo/ForMathlib/Matrix.lean +++ b/QuantumInfo/ForMathlib/Matrix.lean @@ -211,7 +211,7 @@ theorem stdBasisMatrix_iff_eq (i j : m) {c : 𝕜} (hc : 0 < c) : (single i j c) · intro ⟨hherm, _⟩ rw [IsHermitian, ← ext_iff] at hherm replace hherm := hherm i j - simp only [single, conjTranspose_apply, of_apply, true_and, RCLike.star_def, if_true] at hherm + simp only [single, conjTranspose_apply, of_apply, true_and, RCLike.star_def, ite_true] at hherm apply_fun (starRingEnd 𝕜) at hherm have hcstar := RCLike.conj_eq_iff_im.mpr (RCLike.pos_iff.mp hc).right rw [starRingEnd_self_apply, hcstar, ite_eq_left_iff] at hherm @@ -243,7 +243,7 @@ theorem stdBasisMatrix_iff_eq (i j : m) {c : 𝕜} (hc : 0 < c) : (single i j c) by_contra hz' apply hz exact ⟨hz'.left.symm, hz'.right.symm⟩ - rw [ite_cond_eq_false _ _ (eq_false h₁)] + rw [ite_eq_right_of_eq_false _ _ (eq_false h₁)] ring rw [Fintype.sum_eq_single ⟨i, i⟩] · simp [mul_assoc] @@ -286,7 +286,7 @@ theorem zero_dotProduct_zero_iff : (∀ x : m → 𝕜, 0 = star x ⬝ᵥ A.mulV constructor · intro h ext i j - have h₂ := fun x ↦ (PosSemidef.dotProduct_mulVec_zero_iff hA x).mp (h x).symm + have h₂ := fun x ↦ (PosSemidef.dotProduct_mulVec_zero_iff hA (x := x)).mp (h x).symm classical have : DecidableEq m := inferInstance convert! congrFun (h₂ (Pi.single j 1)) i using 1 simp @@ -663,7 +663,8 @@ theorem PosSemidef.traceLeft [DecidableEq d₁] (hA : A.PosSemidef) : A.traceLef constructor · exact hA.1.traceLeft · intro x - convert Finset.sum_nonneg' (s := .univ) (fun (i : d₁) ↦ hA.2 (fun (j,k) ↦ if i = j then x k else 0)) + convert Finset.sum_nonneg (s := .univ) + (fun (i : d₁) _ ↦ hA.2 (fun (j,k) ↦ if i = j then x k else 0)) simp_rw [Matrix.traceLeft, dotProduct_mulVec] simpa [dotProduct, vecMul_eq_sum, ite_apply, Fintype.sum_prod_type, Finset.mul_sum, Finset.sum_mul, apply_ite] using Finset.sum_comm_cycle @@ -673,7 +674,8 @@ theorem PosSemidef.traceRight [DecidableEq d₂] (hA : A.PosSemidef) : A.traceRi constructor · exact hA.1.traceRight · intro x - convert Finset.sum_nonneg' (s := .univ) (fun (i : d₂) ↦ hA.2 (fun (j,k) ↦ if i = k then x j else 0)) + convert Finset.sum_nonneg (s := .univ) + (fun (i : d₂) _ ↦ hA.2 (fun (j,k) ↦ if i = k then x j else 0)) simp_rw [Matrix.traceRight, dotProduct_mulVec] simpa [dotProduct, vecMul_eq_sum, ite_apply, Fintype.sum_prod_type, Finset.mul_sum, Finset.sum_mul, apply_ite] using Finset.sum_comm_cycle @@ -864,7 +866,7 @@ theorem cfc_diagonal (g : d → ℝ) (f : ℝ → ℝ) : change Matrix.conjTranspose _ = _ simp [Matrix.conjTranspose] --TODO cfc_cont_tac - rw [cfc, dif_pos ⟨h_self_adjoint, continuousOn_iff_continuous_domRestrict.mpr <| by fun_prop⟩] + rw [cfc, dite_eq_left ⟨h_self_adjoint, continuousOn_iff_continuous_domRestrict.mpr <| by fun_prop⟩] rw [cfcHom_eq_of_continuous_of_map_id] rotate_left · refine' { .. } diff --git a/QuantumInfo/ForMathlib/MatrixNorm/TraceNorm.lean b/QuantumInfo/ForMathlib/MatrixNorm/TraceNorm.lean index ec2ec3f49..0baed1a38 100644 --- a/QuantumInfo/ForMathlib/MatrixNorm/TraceNorm.lean +++ b/QuantumInfo/ForMathlib/MatrixNorm/TraceNorm.lean @@ -201,7 +201,7 @@ theorem exists_svd_sqrt_eigenvalues (A : Matrix n n ℂ) : dsimp [u, s, Set.domRestrict] have hi' : hH.eigenvalues i.1 ≠ 0 := i.2 have hj' : hH.eigenvalues j.1 ≠ 0 := j.2 - simp only [hi', hj', not_false_eq_true, if_true] + simp only [hi', hj', not_false_eq_true, ite_true] rw [inner_smul_left, inner_smul_right, inner_A_mulVec_eq, hH.mulVec_eigenvectorBasis j.1] by_cases hij : i.1 = j.1 · cases Subtype.ext hij diff --git a/QuantumInfo/ForMathlib/SionMinimax.lean b/QuantumInfo/ForMathlib/SionMinimax.lean index dc87b21d7..313712718 100644 --- a/QuantumInfo/ForMathlib/SionMinimax.lean +++ b/QuantumInfo/ForMathlib/SionMinimax.lean @@ -229,7 +229,7 @@ theorem LowerSemicontinuousOn.dite_top {α β : Type*} [TopologicalSpace α] [Pr filter_upwards [self_mem_nhdsWithin, mem_nhdsWithin_of_mem_nhds (hu.isOpen_compl.mem_nhds hxu)] intro z hzs hzu - rw [dif_neg (show ¬p z from fun hpz ↦ hzu ((hsu z hzs).mpr hpz))] + rw [dite_eq_right (show ¬p z from fun hpz ↦ hzu ((hsu z hzs).mpr hpz))] exact hy theorem LowerSemicontinuousOn.comp_continuousOn {α β γ : Type*} @@ -711,6 +711,7 @@ theorem sion_minimax rw [imp_false, not_lt] have := hS₁.elim_finite_subfamily_closed (fun (y : T) ↦ { x | x ∈ S ∧ f x y ≤ b}) ?_ ?_ · rcases this with ⟨u, hu⟩ + rw [Set.disjoint_iff_inter_eq_empty] at hu have hu' : u.Nonempty := by grind [Finset.not_nonempty_iff_eq_empty, Set.iInter_univ, Set.inter_univ, Set.not_nonempty_empty] @@ -737,7 +738,8 @@ theorem sion_minimax specialize hfc₂ i i.2 rw [lowerSemicontinuousOn_iff_isClosed_preimage] at hfc₂ exact hfc₂ b - · convert Set.inter_empty _ + · rw [Set.disjoint_iff_inter_eq_empty] + convert Set.inter_empty _ by_contra hu simp only [Set.iInter_coe_set, Set.iInter_eq_empty_iff, Set.mem_iInter, Set.mem_ofPred_eq, Classical.not_imp, not_and, not_le, not_forall, not_exists, not_lt] at hu diff --git a/QuantumInfo/ForMathlib/Superadditive.lean b/QuantumInfo/ForMathlib/Superadditive.lean index b077353d2..742eb2ff7 100644 --- a/QuantumInfo/ForMathlib/Superadditive.lean +++ b/QuantumInfo/ForMathlib/Superadditive.lean @@ -33,7 +33,7 @@ theorem tendsto_lim (hbdd : BddAbove (Set.range fun n => u n / n)) : ) convert this.neg using 1 · ext; rw [neg_div', neg_neg] - · simp only [lim, Subadditive.lim, Real.sInf_def, neg_neg, nhds_eq_nhds_iff, + · simp only [lim, Subadditive.lim, Real.sInf_def, neg_neg, ← Set.image_neg_eq_neg, Set.image_image, neg_div', neg_neg] end Superadditive diff --git a/QuantumInfo/Measurements/POVM.lean b/QuantumInfo/Measurements/POVM.lean index 19ef5695c..a9f3cc376 100644 --- a/QuantumInfo/Measurements/POVM.lean +++ b/QuantumInfo/Measurements/POVM.lean @@ -152,7 +152,7 @@ theorem traceLeft_measurementMap_eq_measure (Λ : POVM X d) (ρ : MState d) : change _ = Matrix.trace _ rw [Matrix.trace_mul_cycle, HermitianMat.pow_half_mul (Λ.nonneg i)] exact HermitianMat.inner_eq_trace_rc _ _ - · conv => enter [2, 2, x]; rw [if_neg (by grind)] + · conv => enter [2, 2, x]; rw [ite_eq_right (by grind)] simp /-- The action of measuring a state with the POVM `Λ`, discarding the resulting state, and keeping diff --git a/QuantumInfo/ResourceTheory/HypothesisTesting.lean b/QuantumInfo/ResourceTheory/HypothesisTesting.lean index 1be06a322..88d1d9f43 100644 --- a/QuantumInfo/ResourceTheory/HypothesisTesting.lean +++ b/QuantumInfo/ResourceTheory/HypothesisTesting.lean @@ -456,18 +456,18 @@ theorem Ref81Lem5 (ρ σ : MState d) (ε : Prob) (hε : ε < 1) (α : ℝ) (hα --The Renyi entropy is finite - rw [SandwichedRelRentropy, dif_pos (zero_lt_one.trans hα), dif_pos ?_]; swap + rw [SandwichedRelRentropy, dite_eq_left (zero_lt_one.trans hα), dite_eq_left ?_]; swap · suffices q2.M.ker = ⊥ by simp only [this, bot_le] --q2 has eigenvalues β_ ε(ρ‖{σ}) and 1-β_ ε(ρ‖{σ}), so as long as β_ ε(ρ‖{σ}) isn't 0 or 1, --this is true. exact ker_diagonal_prob_eq_bot hq hq₂ - conv => enter [2, 1, 1, 1]; rw [if_neg hα.ne'] + conv => enter [2, 1, 1, 1]; rw [ite_eq_right hα.ne'] --The logs are finite - rw [Prob.negLog, Prob.negLog, if_neg hq.ne'] - rw [if_neg (show 1 - ε ≠ 0 by simpa [Subtype.ext_iff, Prob.coe_sub] using h₂.ne')] + rw [Prob.negLog, Prob.negLog, ite_eq_right hq.ne'] + rw [ite_eq_right (show 1 - ε ≠ 0 by simpa [Subtype.ext_iff, Prob.coe_sub] using h₂.ne')] --Turn the ENNReal problem into a Real problem have hα₂ : Subtype.mk _ pf2 ≠ 0 := by diff --git a/QuantumInfo/ResourceTheory/SteinsLemma.lean b/QuantumInfo/ResourceTheory/SteinsLemma.lean index fea696ede..0707fc119 100644 --- a/QuantumInfo/ResourceTheory/SteinsLemma.lean +++ b/QuantumInfo/ResourceTheory/SteinsLemma.lean @@ -393,7 +393,6 @@ private theorem LemmaS3_sup {ε : Prob} --the (f n) / n term will go to zero. trans Filter.atTop.limsup fun n ↦ (—log β_ ε(ρ n‖{σ₂ n}) + f n) / n · refine Filter.limsup_le_limsup (.of_forall ?_) - dsimp intro x grw [LemmaS3_helper _ _ _ _ hσ] · apply le_of_eq @@ -1367,7 +1366,7 @@ private theorem EquationS62 congrArg HermitianMat.mat (congrFun (congrFun Esum ε2) n) conv => enter [1] - rw [dif_pos zero_lt_one] + rw [dite_eq_left zero_lt_one] enter [1, 1, 1] rw [HermitianMat.inner_def] rw [← hMulOne] @@ -1769,7 +1768,7 @@ theorem Lemma7 (ρ : MState (H i)) {ε : Prob} (hε : 0 < ε ∧ ε < 1) (σ : ( --Before proceeding, let's reduce to the case that they're finite. have hR1 : R1 ρ ε ≠ ⊤ := hR1R2.ne_top rcases eq_or_ne (R2 ρ σ) ⊤ with hR2|hR2 - · rw [hR2, ENNReal.top_sub hR1, ENNReal.mul_top', if_neg] + · rw [hR2, ENNReal.top_sub hR1, ENNReal.mul_top', ite_eq_right] · simp · have : ε'.val < 1 := hε'₂.trans hε.2 rcases ε' with ⟨ε', hε'₁, hε'₂⟩ diff --git a/QuantumInfo/States/Mixed/MState.lean b/QuantumInfo/States/Mixed/MState.lean index 2b32fe4b8..004a28211 100644 --- a/QuantumInfo/States/Mixed/MState.lean +++ b/QuantumInfo/States/Mixed/MState.lean @@ -420,7 +420,7 @@ theorem pure_of_constant_spectrum (h : ∃ i, ρ.spectrum = ProbDistribution.con have hsum : ∀ x ∈ Finset.univ, x ∉ ({i} : Finset d) → (ρ.M.H.eigenvectorBasis x j) * (↑(if x = i then 1 else 0) : ℝ) * (starRingEnd ℂ) (ρ.Hermitian.eigenvectorBasis x k) = 0 := by intros x hx hxnoti rw [Finset.mem_singleton] at hxnoti - rw [if_neg hxnoti, Complex.ofReal_zero] + rw [ite_eq_right hxnoti, Complex.ofReal_zero] ring simp_rw [←Finset.sum_subset (Finset.subset_univ {i}) hsum, Finset.sum_singleton, reduceIte, Complex.ofReal_one, mul_one] rfl @@ -907,7 +907,7 @@ theorem pure_iff_rank_eq_one {d : Type*} [Fintype d] [DecidableEq d] (ρ : MStat exact not_forall.mp fun h => by simp [ h ] at h_diag; rw [ Finset.sum_eq_add_sum_sdiff_singleton i _ (by simp) ] at h_diag; exact ⟨i, hi, fun j hj => Classical.not_not.1 fun hj' => - absurd h_diag ( by rw [ if_neg hi ] ; exact ne_of_gt ( lt_add_of_pos_right _ ( lt_of_lt_of_le ( by simp [ hj' ] ) ( Finset.single_le_sum ( fun x _ => by positivity ) ( Finset.mem_sdiff.2 ⟨ Finset.mem_univ j, by simp [ hj ] ⟩ ) ) ) ) ) ⟩; + absurd h_diag ( by rw [ ite_eq_right hi ] ; exact ne_of_gt ( lt_add_of_pos_right _ ( lt_of_lt_of_le ( by simp [ hj' ] ) ( Finset.single_le_sum ( fun x _ => by positivity ) ( Finset.mem_sdiff.2 ⟨ Finset.mem_univ j, by simp [ hj ] ⟩ ) ) ) ) ) ⟩; -- Since the diagonal matrix in the spectral theorem has exactly one non-zero entry, we can write ρ.m as |ψ⟩⟨ψ| for some ket ψ. use fun j => (h_herm.eigenvectorUnitary : Matrix d d ℂ) j i * Real.sqrt (h_herm.eigenvalues i); convert this using 1 diff --git a/QuantumInfo/States/Pure/BlochSphere.lean b/QuantumInfo/States/Pure/BlochSphere.lean index c4ca228ea..f39f55a24 100644 --- a/QuantumInfo/States/Pure/BlochSphere.lean +++ b/QuantumInfo/States/Pure/BlochSphere.lean @@ -54,7 +54,7 @@ private lemma blochVecRaw_norm (α θ : ℝ) : (blochVecRaw α θ 2) ^ 2) = 1 := by have : (blochVecRaw α θ 0) ^ 2 + (blochVecRaw α θ 1) ^ 2 + (blochVecRaw α θ 2) ^ 2 = 1 := by - simp [blochVecRaw, Fin.sum_univ_three] + simp [blochVecRaw] have h1 := Real.sin_sq_add_cos_sq α have h2 := Real.sin_sq_add_cos_sq θ nlinarith [sq_nonneg (Real.sin α * Real.cos θ), @@ -67,8 +67,7 @@ private lemma blochVecRaw_norm (α θ : ℝ) : def blochPoint (α θ : ℝ) : BlochSphere := ⟨(WithLp.equiv 2 _).symm (blochVecRaw α θ), by rw [Metric.mem_sphere, dist_comm, EuclideanSpace.dist_eq] - simp [EuclideanSpace.norm_eq, Fin.sum_univ_three, sub_zero, blochVecRaw_norm α θ, - Real.sqrt_one]⟩ + simp [Fin.sum_univ_three, blochVecRaw_norm α θ]⟩ /-- The underlying vector of a `blochPoint`. -/ lemma blochPoint_val (α θ : ℝ) : diff --git a/README.md b/README.md index ae60ceaba..286b07583 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ [![](https://img.shields.io/badge/View_The-Stats-blue)](https://physlib.io/Stats) -[![](https://img.shields.io/badge/Lean-v4.33.0-blue)](https://github.com/leanprover/lean4/releases/tag/v4.33.0) +[![](https://img.shields.io/badge/Lean-v4.34.0-blue)](https://github.com/leanprover/lean4/releases/tag/v4.34.0) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/leanprover-community/physlib) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/leanprover-community/physlib) [![api_docs](https://img.shields.io/badge/doc-API_docs-blue)](https://physlib.io/docs/) diff --git a/lake-manifest.json b/lake-manifest.json index 0fa0ece1f..a5df238c0 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -5,27 +5,27 @@ "type": "git", "subDir": null, "scope": "", - "rev": "db584cd6d46c92f209a44c0f1c829460d327499d", + "rev": "5ed2965256430c3649e86755f9576b54eca72435", "name": "mathlib", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/leanprover/doc-gen4", "type": "git", "subDir": null, "scope": "", - "rev": "aceca4eeb5a79092eabefaa75fcb72b701d02205", + "rev": "a6521b2d0c93dcdf2d640089f95548df5dd8bf46", "name": "«doc-gen4»", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/leanprover-community/plausible", "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "b7eb3304aeae834b12dda98993a37f6a41f6f0bb", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", "name": "plausible", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -35,7 +35,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "5f4d51b81cbd3f6b32b156bfad9056621a040404", + "rev": "ddf04cf3949fa556442341e87d47f9f6e6074707", "name": "LeanSearchClient", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -45,7 +45,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "16f02aa7642864af59f1ff0e384a015994db9118", + "rev": "e928b72544873815af278d38681b31c0293588e3", "name": "importGraph", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -55,7 +55,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "4be2e3d5087eeb272cf5a8853b8f9dd025ef5957", + "rev": "106ff4fafc74ef4ac99d81dbf3ab399118f497a5", "name": "proofwidgets", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -65,7 +65,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "3448c0bcc5ce01b2d1546e483ec3620e32df3d0e", + "rev": "355695d523e41d0554926416cba2a2b3544fbbc9", "name": "aesop", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -75,7 +75,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "92c15be17b7caf78c2ad767ec40f89052d908d81", + "rev": "6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259", "name": "Qq", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -85,7 +85,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "4488d40d070b9700d4d5a6aa342f0d40c31b2a2d", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", "name": "batteries", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -95,7 +95,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "6168b7549738a19bc837a1625c60c5d1e5dd8aeb", + "rev": "f9cdb9eacb5c8b8ecc02ee9fd9e568d7d28c1416", "name": "leansqlite", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -105,17 +105,17 @@ "type": "git", "subDir": null, "scope": "leanprover", - "rev": "6130a47896ce867c6a4a55373441e59e565bad0f", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "v4.33.0", + "inputRev": "v4.34.0", "inherited": true, "configFile": "lakefile.toml"}, {"url": "https://github.com/fgdorais/lean4-unicode-basic", "type": "git", "subDir": null, "scope": "", - "rev": "37e7d8cb7316a88cd3e91208385c9ec6ae780019", + "rev": "0e569d08b6443ce0908d356884c765397253e2f0", "name": "UnicodeBasic", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -125,7 +125,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "852edafa268eb038a7158551fd580ee8433847b0", + "rev": "4d8616fd4870d0a3453d845770833eac7951fe1c", "name": "BibtexQuery", "manifestFile": "lake-manifest.json", "inputRev": "master", diff --git a/lakefile.toml b/lakefile.toml index b2fdf60c9..d3c52e482 100644 --- a/lakefile.toml +++ b/lakefile.toml @@ -11,12 +11,12 @@ defaultTargets = ["Physlib", "QuantumInfo"] [[require]] name = "«doc-gen4»" git = "https://github.com/leanprover/doc-gen4" -rev = "v4.33.0" +rev = "v4.34.0" [[require]] name = "mathlib" git = "https://github.com/leanprover-community/mathlib4.git" -rev = "v4.33.0" +rev = "v4.34.0" [[lean_lib]] name = "Physlib" diff --git a/lean-toolchain b/lean-toolchain index 025e59548..12359f928 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.33.0 +leanprover/lean4:v4.34.0