Contr two rotate
TensorSpecies.Tensor.IsReindexing.contr_two_rotate
Plain-language statement
Contracting the i-th index of a tensor with the first index of an appended metric tensor is, up to a cycle permutation, a reindexing to the color list where the i-th index is replaced by its dual.
Exact Lean statement
lemma contr_two_rotate {c : Fin n → C} (i : Fin n) : IsReindexing
((Fin.append c ![S.τ (c i), S.τ (c i)] ∘
(Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i)))
(Function.update c i (S.τ (c i)))
(Fin.cycleIcc i ⟨n - 1, by have := i.prop; omega⟩).symmFormal artifact
Lean source
lemma contr_two_rotate {c : Fin n → C} (i : Fin n) : IsReindexing ((Fin.append c ![S.τ (c i), S.τ (c i)] ∘ (Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i))) (Function.update c i (S.τ (c i))) (Fin.cycleIcc i ⟨n - 1, by have := i.prop; omega⟩).symm := by haveI : NeZero n := ⟨by have := i.prop; omega⟩ set j : Fin n := ⟨n - 1, by have := i.prop; omega⟩ with hj have key : ∀ y : Fin n, Fin.append c ![S.τ (c i), S.τ (c i)] ((Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i) y) = Function.update c i (S.τ (c i)) (Fin.cycleIcc i j y) := by intro y have hval := Fin.succSuccAbove_val (Fin.natAdd n (0 : Fin 2)) (Fin.castAdd 2 i) y simp only [Fin.val_natAdd, Fin.val_castAdd, Fin.val_zero, Nat.add_zero] at hval rcases lt_or_ge y.val i.val with hy | hy · -- y < i rw [Fin.cycleIcc_of_lt (Fin.lt_def.mpr hy), Function.update_of_ne (Fin.ne_of_val_ne (by omega)), Fin.succSuccAbove_apply_lt_lt _ _ _ (by simp) (by simpa using hy), show y.castSucc.castSucc = Fin.castAdd 2 y from by ext; simp, Fin.append_left] · rcases eq_or_lt_of_le (show y.val ≤ n - 1 from by have := y.isLt; omega) with hyj | hyj · -- y = j (the last index) have hyj' : y = j := Fin.ext (by rw [hj]; exact hyj) subst hyj' have hval' : ((Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i) j).val = n + 1 := by rw [hval]; split_ifs <;> omega rw [Fin.cycleIcc_of_last (Fin.le_def.mpr (by rw [hj]; omega)), Function.update_self, show (Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i) j = Fin.natAdd n (1 : Fin 2) from Fin.ext (by rw [hval']; simp [Fin.val_natAdd]), Fin.append_right] simp · -- i ≤ y < j have hy1 : (y + 1).val = y.val + 1 := by rw [Fin.val_add, Fin.val_one', Nat.mod_eq_of_lt (show 1 < n by omega), Nat.mod_eq_of_lt (show y.val + 1 < n by omega)] have hval' : ((Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i) y).val = y.val + 1 := by rw [hval]; split_ifs <;> omega rw [Fin.cycleIcc_of_ge_of_lt (Fin.le_def.mpr hy) (Fin.lt_def.mpr hyj), Function.update_of_ne (Fin.ne_of_val_ne (by omega)), show (Fin.natAdd n (0 : Fin 2)).succSuccAbove (Fin.castAdd 2 i) y = Fin.castAdd 2 (y + 1) from Fin.ext (by rw [hval', Fin.val_castAdd, hy1]), Fin.append_left] refine ⟨(Equiv.symm _).bijective, fun x => ?_⟩ rw [Function.comp_apply, key, Equiv.apply_symm_apply]- Project
- Physlib
- License
- Apache-2.0
- Commit
- dd43e9e65791
- Source
- Physlib/Relativity/Tensors/Reindexing.lean:498-539
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Adiabatic relation log
adiabatic_relation_log
Plain-language statement
Adiabatic relation in logarithmic form: If S(Ua,Va,N) = S(Ub,Vb,N) with N fixed, then c * log (Ua/Ub) + log (Va/Vb) = 0.
Source project: Physlib
Person-level attribution pending.
Adiabatic relation Ua Ub Va Vb
adiabatic_relation_UaUbVaVb
Plain-language statement
Adiabatic relation in product form: If S(Ua,Va,N) = S(Ub,Vb,N) with N fixed, then (Ua/Ub)^c * (Va/Vb) = 1.
Source project: Physlib
Person-level attribution pending.
Deriv Within mean Energy Beta eq neg variance
CanonicalEnsemble.derivWithin_meanEnergy_Beta_eq_neg_variance
Plain-language statement
(∂U/∂β) = -Var(E) for finite systems.
Source project: Physlib
Person-level attribution pending.