Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift abstraction #25

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions SampCert/Util/Shift.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@ Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jean-Baptiste Tristan
-/
import Mathlib.Topology.Algebra.InfiniteSum.Defs
import Mathlib.Topology.Algebra.InfiniteSum.Basic
import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable
import Mathlib.Topology.Algebra.InfiniteSum.NatInt

/-!
# Shift Util

This file contains lemmas about invariance of sums under integer shifts.
-/

variable {M : Type*} {m m' : M}

open Summable

section A

variable [AddCommGroup M] [UniformSpace M] [T2Space M] [UniformAddGroup M]

/--
A series is right-ℕ-shift-invariant provided its shifted positive and negative parts are summable.
-/
theorem tsum_shift₁ (f : ℤ → ) (μ : ℕ)
theorem tsum_shift₁ (f : ℤ → M) (μ : ℕ)
(h2 : ∀ μ : ℕ, Summable fun x : ℕ => f (x + μ))
(h3 : ∀ μ : ℕ, Summable fun x : ℕ => f (-(x + 1) + μ))
:
Expand All @@ -36,7 +43,7 @@ theorem tsum_shift₁ (f : ℤ → ℝ) (μ : ℕ)
rw [add_comm]
conv =>
right
rw [@tsum_of_nat_of_neg_add_one _ _ _ _ (fun x : ℤ => f (x + μ)) (h2 μ) (h3 μ)]
rw [@tsum_of_nat_of_neg_add_one M _ _ _ _ (fun x : ℤ => f (x + μ)) (h2 μ) (h3 μ)]
congr 1
conv =>
right
Expand Down Expand Up @@ -70,7 +77,7 @@ theorem tsum_shift₁ (f : ℤ → ℝ) (μ : ℕ)
/--
A series is left-ℕ-shift-invariant provided its shifted positive and negative parts are summable.
-/
theorem tsum_shift₂ (f : ℤ → ) (μ : ℕ)
theorem tsum_shift₂ (f : ℤ → M) (μ : ℕ)
(h2 : ∀ μ : ℕ, Summable fun x : ℕ => f (x - μ))
(h3 : ∀ μ : ℕ, Summable fun x : ℕ => f (-(x + 1) - μ)) :
∑' x : ℤ, f (x - μ) = (∑' x : ℤ, f x) := by
Expand Down Expand Up @@ -113,22 +120,28 @@ theorem tsum_shift₂ (f : ℤ → ℝ) (μ : ℕ)
. exact (h2 μ)
. exact (h3 μ)

end A

section B

variable [AddCommGroup M] [UniformSpace M] [T2Space M] [UniformAddGroup M] [CompleteSpace M]

/--
A series is invariant under integer shifts provided its shifted positive and negative parts are summable.
-/
theorem tsum_shift (f : ℤ → ) (μ : ℤ)
theorem tsum_shift (f : ℤ → M) (μ : ℤ)
(h₀ : ∀ μ : ℤ, Summable fun x : ℤ => f (x + μ)) :
∑' x : ℤ, f (x + μ) = (∑' x : ℤ, f x) := by
have h : ∀ μ : ℤ, Summable fun x : ℕ => f (x + μ) := by
intro μ
have A := @summable_int_iff_summable_nat_and_neg_add_zero _ _ _ _ (fun x => f (x + μ))
have A := @summable_int_iff_summable_nat_and_neg_add_zero M _ _ _ _ (fun x => f (x + μ))
replace A := A.1 (h₀ μ)
cases A
rename_i X Y
exact X
have h' : ∀ μ : ℤ, Summable fun x : ℕ => f (-(x + 1) + μ) := by
intro μ
have A := @summable_int_iff_summable_nat_and_neg_add_zero _ _ _ _ (fun x => f (x + μ))
have A := @summable_int_iff_summable_nat_and_neg_add_zero M _ _ _ _ (fun x => f (x + μ))
replace A := A.1 (h₀ μ)
cases A
rename_i X Y
Expand All @@ -154,3 +167,5 @@ theorem tsum_shift (f : ℤ → ℝ) (μ : ℤ)
apply tsum_congr
intro b
congr

end B