File size: 28,035 Bytes
ea76aac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | import Mathlib
import OAI.Computability.DirectedFeedback.Games.KMSAnalyticSmallTransport
namespace OAI
namespace DFVSGames.Inverse.KMSAnalytic
noncomputable section
open scoped BigOperators Classical
section FiniteFibers
variable {A B J : Type*} [Fintype A] [Fintype B] [Fintype J]
theorem sum_comp_eq_fiber_card (p : A → J) (b : J → ℝ) :
(∑ x, b (p x)) =
∑ j, ((Finset.univ.filter fun x => p x = j).card : ℝ) * b j := by
calc
(∑ x, b (p x)) = ∑ x, ∑ j, if p x = j then b j else 0 := by
apply Finset.sum_congr rfl
intro x _
simp
_ = ∑ j, ∑ x, if p x = j then b j else 0 := Finset.sum_comm
_ = _ := by
apply Finset.sum_congr rfl
intro j _
rw [← Finset.sum_filter]
simp
theorem sum_sq_eq_fiber_card (p : A → J) (a : A → ℝ) (b : J → ℝ)
(hab : ∀ x, a x = b (p x)) :
(∑ x, a x ^ 2) =
∑ j, ((Finset.univ.filter fun x => p x = j).card : ℝ) * b j ^ 2 := by
simpa only [hab] using sum_comp_eq_fiber_card p (fun j => b j ^ 2)
theorem sum_sq_eq_uniform_fiber_card (p : A → J) (a : A → ℝ) (b : J → ℝ)
(hab : ∀ x, a x = b (p x)) (n : ℕ)
(hn : ∀ j, (Finset.univ.filter fun x => p x = j).card = n) :
(∑ x, a x ^ 2) = (n : ℝ) * ∑ j, b j ^ 2 := by
rw [sum_sq_eq_fiber_card p a b hab, Finset.mul_sum]
apply Finset.sum_congr rfl
intro j _
rw [hn]
theorem fiber_constant_energy_cross_mul (p : A → J) (q : B → J)
(hp : Function.Surjective p) (hq : Function.Surjective q)
(a : A → ℝ) (b : B → ℝ)
(hab : ∀ x y, p x = q y → a x = b y)
(nA nB : ℕ)
(hA : ∀ j, (Finset.univ.filter fun x => p x = j).card = nA)
(hB : ∀ j, (Finset.univ.filter fun y => q y = j).card = nB) :
(nB : ℝ) * (∑ x, a x ^ 2) = (nA : ℝ) * ∑ y, b y ^ 2 := by
let c : J → ℝ := fun j => b (Classical.choose (hq j))
have ha : ∀ x, a x = c (p x) := by
intro x
exact hab x (Classical.choose (hq (p x)))
(Classical.choose_spec (hq (p x))).symm
have hb : ∀ y, b y = c (q y) := by
intro y
obtain ⟨x, hx⟩ := hp (q y)
exact (hab x y hx).symm.trans (by simpa only [hx] using ha x)
rw [sum_sq_eq_uniform_fiber_card p a c ha nA hA,
sum_sq_eq_uniform_fiber_card q b c hb nB hB]
ring
end FiniteFibers
open DFVSGames.Integration.BinaryLinear (F2)
open DFVSGames.Fourier.MatrixFourier
variable {E F J : Type*}
[AddCommGroup E] [Module F2 E] [AddCommGroup F] [Module F2 F]
[FiniteDimensional F2 E] [FiniteDimensional F2 F]
[Fintype (E →ₗ[F2] F)] [Fintype (F →ₗ[F2] E)] [Fintype J]
theorem synthesis_energy_grouped (p : (F →ₗ[F2] E) → J)
(a : (F →ₗ[F2] E) → ℝ) (b : J → ℝ) (hab : ∀ S, a S = b (p S)) :
(𝔼 X, synthesis a X ^ 2) =
∑ j, ((Finset.univ.filter fun S => p S = j).card : ℝ) * b j ^ 2 := by
rw [synthesis_energy]
exact sum_sq_eq_fiber_card p a b hab
theorem synthesis_energy_by_kernel [Fintype (Submodule F2 F)]
(a : (F →ₗ[F2] E) → ℝ) (b : Submodule F2 F → ℝ)
(hab : ∀ S, a S = b S.ker) :
(𝔼 X, synthesis a X ^ 2) =
∑ K : Submodule F2 F,
((Finset.univ.filter fun S : F →ₗ[F2] E => S.ker = K).card : ℝ) * b K ^ 2 :=
synthesis_energy_grouped (fun S => S.ker) a b hab
end
end DFVSGames.Inverse.KMSAnalytic
namespace DFVSGames.Inverse.KMSKernelFiberCard
noncomputable section
abbrev F2 := ZMod 2
variable (F E I : Type*)
[AddCommGroup F] [Module F2 F]
[AddCommGroup E] [Module F2 E]
[AddCommGroup I] [Module F2 I]
abbrev KernelClass :=
{K : Submodule F2 F // Module.finrank F2 (F ⧸ K) = Module.finrank F2 I}
abbrev RankFrequency :=
{S : F →ₗ[F2] E // Module.finrank F2 S.range = Module.finrank F2 I}
abbrev FullFrequency := {T : F →ₗ[F2] I // Function.Surjective T}
variable {F E I}
def rankKernel (S : RankFrequency F E I) : KernelClass F I :=
⟨S.val.ker, S.val.quotKerEquivRange.finrank_eq.trans S.property⟩
def fullKernel (T : FullFrequency F I) : KernelClass F I :=
⟨T.val.ker, (T.val.quotKerEquivOfSurjective T.property).finrank_eq⟩
@[simp] theorem rankKernel_val (S : RankFrequency F E I) :
(rankKernel S).val = S.val.ker := rfl
@[simp] theorem fullKernel_val (T : FullFrequency F I) :
(fullKernel T).val = T.val.ker := rfl
end
end DFVSGames.Inverse.KMSKernelFiberCard
namespace DFVSGames.Inverse.KMSAnalyticKernelCount
noncomputable section
variable {R E F : Type*} [Ring R]
[AddCommGroup E] [Module R E] [AddCommGroup F] [Module R F]
theorem ker_comp_mkQ (K : Submodule R F) (J : (F ⧸ K) →ₗ[R] E)
(hJ : Function.Injective J) : (J.comp K.mkQ).ker = K := by
rw [LinearMap.ker_comp_of_ker_eq_bot K.mkQ (LinearMap.ker_eq_bot.mpr hJ),
Submodule.ker_mkQ]
def fixedKernelEquivQuotientInjection (K : Submodule R F) :
{S : F →ₗ[R] E // S.ker = K} ≃
{J : (F ⧸ K) →ₗ[R] E // Function.Injective J} where
toFun S := ⟨K.liftQ S.val S.property.symm.le,
LinearMap.ker_eq_bot.mp (K.ker_liftQ_eq_bot S.val _ S.property.le)⟩
invFun J := ⟨J.val.comp K.mkQ, ker_comp_mkQ K J.val J.property⟩
left_inv S := by
apply Subtype.ext
exact K.liftQ_mkQ S.val _
right_inv J := by
apply Subtype.ext
apply LinearMap.ext
intro q
obtain ⟨x, rfl⟩ := K.mkQ_surjective q
rfl
@[simp]
theorem fixedKernelEquiv_apply_mkQ (K : Submodule R F)
(S : {S : F →ₗ[R] E // S.ker = K}) (x : F) :
(fixedKernelEquivQuotientInjection K S).val (K.mkQ x) = S.val x := rfl
@[simp]
theorem fixedKernelEquiv_symm_apply (K : Submodule R F)
(J : {J : (F ⧸ K) →ₗ[R] E // Function.Injective J}) :
((fixedKernelEquivQuotientInjection K).symm J).val = J.val.comp K.mkQ := rfl
theorem range_forward (K : Submodule R F)
(S : {S : F →ₗ[R] E // S.ker = K}) :
(fixedKernelEquivQuotientInjection K S).val.range = S.val.range :=
K.range_liftQ S.val _
theorem finrank_range_forward (K : Submodule R F)
(S : {S : F →ₗ[R] E // S.ker = K}) :
Module.finrank R (fixedKernelEquivQuotientInjection K S).val.range =
Module.finrank R S.val.range := by
rw [range_forward]
theorem fixedKernel_finrank_eq_quotient (K : Submodule R F)
(S : {S : F →ₗ[R] E // S.ker = K}) :
Module.finrank R S.val.range = Module.finrank R (F ⧸ K) := by
rw [← range_forward K S]
exact LinearMap.finrank_range_of_inj (fixedKernelEquivQuotientInjection K S).property
theorem range_comp_mkQ (K : Submodule R F) (J : (F ⧸ K) →ₗ[R] E) :
(J.comp K.mkQ).range = J.range := by
ext y
constructor
· rintro ⟨x, rfl⟩
exact ⟨K.mkQ x, rfl⟩
· rintro ⟨q, rfl⟩
obtain ⟨x, rfl⟩ := K.mkQ_surjective q
exact ⟨x, rfl⟩
theorem quotientInjection_comp_finrank (K : Submodule R F)
(J : (F ⧸ K) →ₗ[R] E) (hJ : Function.Injective J) :
Module.finrank R (J.comp K.mkQ).range = Module.finrank R (F ⧸ K) := by
rw [range_comp_mkQ]
exact LinearMap.finrank_range_of_inj hJ
theorem natCard_fixedKernel_eq_injectiveQuotient (K : Submodule R F) :
Nat.card {S : F →ₗ[R] E // S.ker = K} =
Nat.card {J : (F ⧸ K) →ₗ[R] E // Function.Injective J} :=
Nat.card_congr (fixedKernelEquivQuotientInjection K)
theorem card_fixedKernel_eq_injectiveQuotient (K : Submodule R F)
[Fintype {S : F →ₗ[R] E // S.ker = K}]
[Fintype {J : (F ⧸ K) →ₗ[R] E // Function.Injective J}] :
Fintype.card {S : F →ₗ[R] E // S.ker = K} =
Fintype.card {J : (F ⧸ K) →ₗ[R] E // Function.Injective J} :=
Fintype.card_congr (fixedKernelEquivQuotientInjection K)
end
end DFVSGames.Inverse.KMSAnalyticKernelCount
namespace DFVSGames.Inverse.KMSKernelFiberCard
open KMSAnalyticKernelCount
noncomputable section
variable {F E I : Type*}
[AddCommGroup F] [Module F2 F] [FiniteDimensional F2 F]
[AddCommGroup E] [Module F2 E] [FiniteDimensional F2 E]
[AddCommGroup I] [Module F2 I] [FiniteDimensional F2 I]
def quotientEquiv (K : KernelClass F I) : (F ⧸ K.val) ≃ₗ[F2] I :=
Classical.choice (FiniteDimensional.nonempty_linearEquiv_of_finrank_eq K.property)
theorem rankKernel_surjective
(hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
Function.Surjective (rankKernel (F := F) (E := E) (I := I)) := by
classical
obtain ⟨j, hj⟩ :=
(finrank_le_iff_exists_linearMap (R := F2) (M := I) (M' := E)).mp hdim
intro K
let J : (F ⧸ K.val) →ₗ[F2] E := j.comp (quotientEquiv K).toLinearMap
have hJ : Function.Injective J := hj.comp (quotientEquiv K).injective
refine ⟨⟨J.comp K.val.mkQ, ?_⟩, ?_⟩
· exact (quotientInjection_comp_finrank K.val J hJ).trans K.property
· apply Subtype.ext
exact ker_comp_mkQ K.val J hJ
theorem fullKernel_surjective :
Function.Surjective (fullKernel (F := F) (I := I)) := by
classical
intro K
let T : F →ₗ[F2] I := (quotientEquiv K).toLinearMap.comp K.val.mkQ
have hT : Function.Surjective T :=
(quotientEquiv K).surjective.comp K.val.mkQ_surjective
refine ⟨⟨T, hT⟩, ?_⟩
apply Subtype.ext
exact ker_comp_mkQ K.val (quotientEquiv K).toLinearMap (quotientEquiv K).injective
end
end DFVSGames.Inverse.KMSKernelFiberCard
namespace DFVSGames.Inverse.KMSInjectionCount
open scoped BigOperators
noncomputable section
abbrev F2 := ZMod 2
variable (I E : Type*) [AddCommGroup I] [Module F2 I]
[AddCommGroup E] [Module F2 E]
def beta : ℕ := Nat.card {J : I →ₗ[F2] E // Function.Injective J}
def injectiveEquivIndependent {ι : Type*} (b : Module.Basis ι F2 I) :
{J : I →ₗ[F2] E // Function.Injective J} ≃
{s : ι → E // LinearIndependent F2 s} where
toFun J := ⟨J.val ∘ b, b.linearIndependent.map' J.val (LinearMap.ker_eq_bot.mpr J.property)⟩
invFun s := ⟨b.constr F2 s.val, b.injective_constr_of_linearIndependent s.property⟩
left_inv J := by
apply Subtype.ext
exact b.constr_self F2 J.val
right_inv s := by
apply Subtype.ext
funext i
exact b.constr_basis F2 s.val i
theorem beta_eq_product [FiniteDimensional F2 I] [Finite E]
(hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
beta I E = ∏ j : Fin (Module.finrank F2 I),
(2 ^ Module.finrank F2 E - 2 ^ j.val) := by
unfold beta
rw [Nat.card_congr (injectiveEquivIndependent I E (Module.finBasis F2 I))]
simpa only [F2, ZMod.card] using
(card_linearIndependent (K := F2) (V := E) hdim)
end
end DFVSGames.Inverse.KMSInjectionCount
namespace DFVSGames.Inverse.KMSKernelFiberCard
open KMSAnalyticKernelCount KMSInjectionCount
open scoped Classical
noncomputable section
variable {F E I J : Type*}
[AddCommGroup F] [Module F2 F]
[AddCommGroup E] [Module F2 E]
[AddCommGroup I] [Module F2 I]
[AddCommGroup J] [Module F2 J]
def injectionEquivOfDomainEquiv (e : J ≃ₗ[F2] I) :
{u : J →ₗ[F2] E // Function.Injective u} ≃
{u : I →ₗ[F2] E // Function.Injective u} where
toFun u := ⟨u.val.comp e.symm.toLinearMap, u.property.comp e.symm.injective⟩
invFun u := ⟨u.val.comp e.toLinearMap, u.property.comp e.injective⟩
left_inv u := by
apply Subtype.ext
apply LinearMap.ext
intro x
change u.val (e.symm (e x)) = u.val x
rw [e.symm_apply_apply]
right_inv u := by
apply Subtype.ext
apply LinearMap.ext
intro x
change u.val (e (e.symm x)) = u.val x
rw [e.apply_symm_apply]
variable [FiniteDimensional F2 F] [FiniteDimensional F2 I]
def fixedKernelEquivInjection (K : KernelClass F I) :
{S : F →ₗ[F2] E // S.ker = K.val} ≃
{J : I →ₗ[F2] E // Function.Injective J} :=
(fixedKernelEquivQuotientInjection K.val).trans
(injectionEquivOfDomainEquiv (quotientEquiv K))
theorem natCard_fixedKernel_eq_beta (K : KernelClass F I) :
Nat.card {S : F →ₗ[F2] E // S.ker = K.val} = beta I E :=
Nat.card_congr (fixedKernelEquivInjection K)
def rankFiberEquivFixedKernel (K : KernelClass F I) :
{S : RankFrequency F E I // rankKernel S = K} ≃
{S : F →ₗ[F2] E // S.ker = K.val} where
toFun S := ⟨S.val.val, congrArg Subtype.val S.property⟩
invFun S := ⟨⟨S.val,
(fixedKernel_finrank_eq_quotient K.val S).trans K.property⟩,
Subtype.ext S.property⟩
left_inv S := by
apply Subtype.ext
apply Subtype.ext
rfl
right_inv S := by
apply Subtype.ext
rfl
omit [FiniteDimensional F2 F] in
theorem surjective_of_kernel_class (K : KernelClass F I)
(T : F →ₗ[F2] I) (hT : T.ker = K.val) : Function.Surjective T := by
apply LinearMap.range_eq_top.mp
apply Submodule.eq_top_of_finrank_eq
exact (fixedKernel_finrank_eq_quotient K.val ⟨T, hT⟩).trans K.property
def fullFiberEquivFixedKernel (K : KernelClass F I) :
{T : FullFrequency F I // fullKernel T = K} ≃
{T : F →ₗ[F2] I // T.ker = K.val} where
toFun T := ⟨T.val.val, congrArg Subtype.val T.property⟩
invFun T := ⟨⟨T.val, surjective_of_kernel_class K T.val T.property⟩,
Subtype.ext T.property⟩
left_inv T := by
apply Subtype.ext
apply Subtype.ext
rfl
right_inv T := by
apply Subtype.ext
rfl
theorem rankKernel_fiber_card [Fintype (F →ₗ[F2] E)]
(K : KernelClass F I) :
(Finset.univ.filter (fun S : RankFrequency F E I => rankKernel S = K)).card =
beta I E := by
calc
_ = Fintype.card {S : RankFrequency F E I // rankKernel S = K} :=
(Fintype.card_subtype _).symm
_ = Nat.card {S : RankFrequency F E I // rankKernel S = K} :=
Nat.card_eq_fintype_card.symm
_ = Nat.card {S : F →ₗ[F2] E // S.ker = K.val} :=
Nat.card_congr (rankFiberEquivFixedKernel K)
_ = beta I E := natCard_fixedKernel_eq_beta K
theorem fullKernel_fiber_card [Fintype (F →ₗ[F2] I)]
(K : KernelClass F I) :
(Finset.univ.filter (fun T : FullFrequency F I => fullKernel T = K)).card =
beta I I := by
calc
_ = Fintype.card {T : FullFrequency F I // fullKernel T = K} :=
(Fintype.card_subtype _).symm
_ = Nat.card {T : FullFrequency F I // fullKernel T = K} :=
Nat.card_eq_fintype_card.symm
_ = Nat.card {T : F →ₗ[F2] I // T.ker = K.val} :=
Nat.card_congr (fullFiberEquivFixedKernel K)
_ = beta I I := natCard_fixedKernel_eq_beta K
end
end DFVSGames.Inverse.KMSKernelFiberCard
namespace DFVSGames.Inverse.KMSInjectionCount
open scoped BigOperators
theorem binary_factor_lower {d n j : ℕ} (hj : j < d) (hdn : d ≤ n) :
2 ^ (n - d) ≤ 2 ^ n - 2 ^ j := by
have hn : 0 < n := by omega
have hjn : j ≤ n - 1 := by omega
have hdn' : n - d ≤ n - 1 := by omega
calc
2 ^ (n - d) ≤ 2 ^ (n - 1) := Nat.pow_le_pow_right (by decide) hdn'
_ = 2 ^ n - 2 ^ (n - 1) := (Nat.two_pow_sub_two_pow_pred hn).symm
_ ≤ 2 ^ n - 2 ^ j :=
Nat.sub_le_sub_left (Nat.pow_le_pow_right (by decide) hjn) _
noncomputable section
variable (I E : Type*) [AddCommGroup I] [Module F2 I]
[AddCommGroup E] [Module F2 E] [FiniteDimensional F2 I] [Finite E]
theorem beta_le_pow (hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
beta I E ≤ 2 ^ (Module.finrank F2 E * Module.finrank F2 I) := by
rw [beta_eq_product I E hdim]
calc
_ ≤ ∏ _j : Fin (Module.finrank F2 I), 2 ^ Module.finrank F2 E := by
apply Finset.prod_le_prod
intro j _
exact Nat.sub_le _ _
_ = _ := by simp [← pow_mul]
theorem beta_ge_pow (hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
2 ^ (Module.finrank F2 I * (Module.finrank F2 E - Module.finrank F2 I)) ≤
beta I E := by
rw [beta_eq_product I E hdim]
calc
_ = ∏ _j : Fin (Module.finrank F2 I),
2 ^ (Module.finrank F2 E - Module.finrank F2 I) := by
simp [← pow_mul, Nat.mul_comm]
_ ≤ _ := by
apply Finset.prod_le_prod
intro j _
exact binary_factor_lower j.isLt hdim
theorem beta_positive (hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
0 < beta I E :=
lt_of_lt_of_le (Nat.pow_pos (by decide)) (beta_ge_pow I E hdim)
theorem beta_self_le [Finite I] :
beta I I ≤ 2 ^ (Module.finrank F2 I * Module.finrank F2 I) :=
beta_le_pow I I le_rfl
end
end DFVSGames.Inverse.KMSInjectionCount
namespace DFVSGames.Inverse.KMSAnalytic
noncomputable section
open scoped BigOperators Classical
open DFVSGames.Integration.BinaryLinear (F2)
open DFVSGames.Fourier.MatrixFourier
open DFVSGames.Inverse.KMSBasisInvariant
open DFVSGames.Inverse.KMSKernelOrbitsFourier
open DFVSGames.Inverse.KMSKernelFiberCard (KernelClass FullFrequency RankFrequency
fullKernel rankKernel fullKernel_surjective rankKernel_surjective
fullKernel_fiber_card rankKernel_fiber_card)
open DFVSGames.Inverse.KMSInjectionCount (beta)
variable {E F I : Type*}
[AddCommGroup E] [Module F2 E] [AddCommGroup F] [Module F2 F]
[AddCommGroup I] [Module F2 I]
[FiniteDimensional F2 E] [FiniteDimensional F2 F] [FiniteDimensional F2 I]
[Finite E] [Finite F] [Finite I]
[Fintype (E →ₗ[F2] F)] [Fintype (F →ₗ[F2] E)]
[Fintype (I →ₗ[F2] F)] [Fintype (F →ₗ[F2] I)]
[Fintype (KernelClass F I)]
omit [Finite E] [Finite F] [Finite I] in
theorem smallComponent_energy_cross_mul (ι : I →ₗ[F2] E)
(hι : Function.Injective ι) (f : (E →ₗ[F2] F) → ℝ)
(hf : IsBasisInvariant f) :
(beta I E : ℝ) * (𝔼 X, smallComponent ι f X ^ 2) =
(beta I I : ℝ) * (𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) := by
have hdim : Module.finrank F2 I ≤ Module.finrank F2 E :=
LinearMap.finrank_le_finrank_of_injective hι
have h := fiber_constant_energy_cross_mul
(fullKernel (F := F) (I := I)) (rankKernel (F := F) (E := E) (I := I))
fullKernel_surjective (rankKernel_surjective hdim)
(fun T : FullFrequency F I => linearCoeff f (ι.comp T.val))
(fun S : RankFrequency F E I => linearCoeff f S.val)
(fun T S hTS => coefficient_eq_of_ker_eq f hf _ _
((ker_comp_of_injective ι hι T.val).trans
(congrArg Subtype.val hTS)))
(beta I I) (beta I E)
(fun K => by
have hc := fullKernel_fiber_card (F := F) (I := I) K
convert hc using 1 ; congr 1 ; ext T ; simp)
(fun K => by
have hc := rankKernel_fiber_card (F := F) (E := E) (I := I) K
convert hc using 1 ; congr 1 ; ext T ; simp)
rw [smallComponent_energy, rankComponent_energy]
rw [Finset.sum_subtype (p := fun T : F →ₗ[F2] I => Function.Surjective T) _ (by simp) (fun T : F →ₗ[F2] I => linearCoeff f (ι.comp T) ^ 2),
Finset.sum_subtype (p := fun S : F →ₗ[F2] E => Module.finrank F2 S.range = Module.finrank F2 I) _ (by simp) (fun S : F →ₗ[F2] E => linearCoeff f S ^ 2)]
exact h
omit [Finite F] [Finite I] in
theorem smallComponent_energy_ratio (ι : I →ₗ[F2] E)
(hι : Function.Injective ι) (f : (E →ₗ[F2] F) → ℝ)
(hf : IsBasisInvariant f) :
(𝔼 X, smallComponent ι f X ^ 2) =
(beta I I : ℝ) / (beta I E : ℝ) *
(𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) := by
have hdim : Module.finrank F2 I ≤ Module.finrank F2 E :=
LinearMap.finrank_le_finrank_of_injective hι
have hb : (beta I E : ℝ) ≠ 0 := by
exact_mod_cast (ne_of_gt (KMSInjectionCount.beta_positive I E hdim))
apply (mul_left_cancel₀ hb)
calc
_ = (beta I I : ℝ) * (𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) :=
smallComponent_energy_cross_mul ι hι f hf
_ = _ := by field_simp
omit [Finite F] in
theorem smallComponent_energy_pow_bound (ι : I →ₗ[F2] E)
(hι : Function.Injective ι) (f : (E →ₗ[F2] F) → ℝ)
(hf : IsBasisInvariant f) :
(2 : ℝ) ^ (Module.finrank F2 I * (Module.finrank F2 E - Module.finrank F2 I)) *
(𝔼 X, smallComponent ι f X ^ 2) ≤
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) *
(𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) := by
have hdim : Module.finrank F2 I ≤ Module.finrank F2 E :=
LinearMap.finrank_le_finrank_of_injective hι
have hlo : (2 : ℝ) ^
(Module.finrank F2 I * (Module.finrank F2 E - Module.finrank F2 I)) ≤
(beta I E : ℝ) := by
exact_mod_cast KMSInjectionCount.beta_ge_pow I E hdim
have hhi : (beta I I : ℝ) ≤
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) := by
exact_mod_cast KMSInjectionCount.beta_self_le I
calc
_ ≤ (beta I E : ℝ) * (𝔼 X, smallComponent ι f X ^ 2) :=
mul_le_mul_of_nonneg_right hlo (Finset.expect_nonneg (fun _ _ => sq_nonneg _))
_ = (beta I I : ℝ) *
(𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) :=
smallComponent_energy_cross_mul ι hι f hf
_ ≤ _ := mul_le_mul_of_nonneg_right hhi
(Finset.expect_nonneg (fun _ _ => sq_nonneg _))
omit [Finite F] in
theorem smallComponent_energy_le_of_energy_le (ι : I →ₗ[F2] E)
(hι : Function.Injective ι) (f : (E →ₗ[F2] F) → ℝ)
(hf : IsBasisInvariant f) (ε : ℝ) (hε : (𝔼 X, f X ^ 2) ≤ ε) :
(2 : ℝ) ^ (Module.finrank F2 I * (Module.finrank F2 E - Module.finrank F2 I)) *
(𝔼 X, smallComponent ι f X ^ 2) ≤
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) * ε := by
exact (smallComponent_energy_pow_bound ι hι f hf).trans
(mul_le_mul_of_nonneg_left
((component_energy_le (fun T : F →ₗ[F2] E =>
Module.finrank F2 T.range = Module.finrank F2 I) f).trans hε)
(pow_nonneg (by norm_num) _))
end
end DFVSGames.Inverse.KMSAnalytic
namespace DFVSGames.Inverse.KMSInjectionCount
noncomputable section
variable (I E : Type*) [AddCommGroup I] [Module F2 I]
[AddCommGroup E] [Module F2 E] [FiniteDimensional F2 I] [Finite E]
theorem pow_dim_mul_le_pow_sq_mul_beta
(hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 E) ≤
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) * (beta I E : ℝ) := by
have hexp : Module.finrank F2 I * Module.finrank F2 I +
Module.finrank F2 I * (Module.finrank F2 E - Module.finrank F2 I) =
Module.finrank F2 I * Module.finrank F2 E := by
rw [← Nat.mul_add, Nat.add_sub_of_le hdim]
have hnat : 2 ^ (Module.finrank F2 I * Module.finrank F2 E) ≤
2 ^ (Module.finrank F2 I * Module.finrank F2 I) * beta I E := by
calc
_ = 2 ^ (Module.finrank F2 I * Module.finrank F2 I) *
2 ^ (Module.finrank F2 I * (Module.finrank F2 E - Module.finrank F2 I)) := by
rw [← pow_add, hexp]
_ ≤ _ := Nat.mul_le_mul_left _ (beta_ge_pow I E hdim)
exact_mod_cast hnat
theorem beta_ratio_le_pow [Finite I]
(hdim : Module.finrank F2 I ≤ Module.finrank F2 E) :
(beta I I : ℝ) / (beta I E : ℝ) ≤
(2 : ℝ) ^ (2 * (Module.finrank F2 I * Module.finrank F2 I)) /
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 E) := by
have hb : 0 < (beta I E : ℝ) := by exact_mod_cast beta_positive I E hdim
have hp : 0 < (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 E) :=
pow_pos (by norm_num) _
have hq : 0 ≤ (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) :=
pow_nonneg (by norm_num) _
have hself : (beta I I : ℝ) ≤
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) := by
exact_mod_cast beta_self_le I
apply (div_le_div_iff₀ hb hp).mpr
calc
_ ≤ (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) *
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 E) :=
mul_le_mul_of_nonneg_right hself hp.le
_ ≤ (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) *
((2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) * (beta I E : ℝ)) :=
mul_le_mul_of_nonneg_left (pow_dim_mul_le_pow_sq_mul_beta I E hdim) hq
_ = _ := by
rw [← mul_assoc, ← pow_add]
congr 2
omega
theorem pow_mul_le_of_beta_cross_mul [Finite I]
(hdim : Module.finrank F2 I ≤ Module.finrank F2 E)
{x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y)
(hcross : (beta I E : ℝ) * x = (beta I I : ℝ) * y) :
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 E) * x ≤
(2 : ℝ) ^ (2 * (Module.finrank F2 I * Module.finrank F2 I)) * y := by
have hq : 0 ≤ (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) :=
pow_nonneg (by norm_num) _
have hself : (beta I I : ℝ) ≤
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) := by
exact_mod_cast beta_self_le I
calc
_ ≤ ((2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) * (beta I E : ℝ)) * x :=
mul_le_mul_of_nonneg_right (pow_dim_mul_le_pow_sq_mul_beta I E hdim) hx
_ = (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) * ((beta I I : ℝ) * y) := by
rw [mul_assoc, hcross]
_ ≤ (2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) *
((2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 I) * y) :=
mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hself hy) hq
_ = _ := by
rw [← mul_assoc, ← pow_add]
congr 2
omega
end
end DFVSGames.Inverse.KMSInjectionCount
namespace DFVSGames.Inverse.KMSAnalytic
noncomputable section
open scoped BigOperators Classical
open DFVSGames.Integration.BinaryLinear (F2)
open DFVSGames.Inverse.KMSBasisInvariant
universe u v w x
variable {E : Type u} {F : Type v} {I : Type w} {J : Type x}
[AddCommGroup E] [Module F2 E] [AddCommGroup F] [Module F2 F]
[AddCommGroup I] [Module F2 I] [AddCommGroup J] [Module F2 J]
[FiniteDimensional F2 E] [FiniteDimensional F2 F]
[FiniteDimensional F2 I] [FiniteDimensional F2 J]
[Finite E] [Finite F] [Finite I]
[Fintype (E →ₗ[F2] F)] [Fintype (F →ₗ[F2] E)]
[Fintype (I →ₗ[F2] F)] [Fintype (F →ₗ[F2] I)]
[Fintype (KMSKernelFiberCard.KernelClass F I)]
omit [Finite F] in
theorem smallComponent_energy_base_bound (ι : I →ₗ[F2] E)
(hι : Function.Injective ι) (f : (E →ₗ[F2] F) → ℝ)
(hf : IsBasisInvariant f) (ε : ℝ)
(hg : HomogeneousRestrictionBound (Module.finrank F2 I) ε f) :
(2 : ℝ) ^ (Module.finrank F2 I * Module.finrank F2 E) *
(𝔼 X, smallComponent ι f X ^ 2) ≤
(2 : ℝ) ^ (4 * Module.finrank F2 I * Module.finrank F2 I) * ε := by
have hdim : Module.finrank F2 I ≤ Module.finrank F2 E :=
LinearMap.finrank_le_finrank_of_injective hι
have henergy : (𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) ≤ ε :=
(component_energy_le (fun T : F →ₗ[F2] E =>
Module.finrank F2 T.range = Module.finrank F2 I) f).trans (hg.energy_le _ _ _)
have hε : 0 ≤ ε := (Finset.expect_nonneg (fun _ _ => sq_nonneg _)).trans henergy
have hbase := KMSInjectionCount.pow_mul_le_of_beta_cross_mul I E hdim
(Finset.expect_nonneg (fun _ _ => sq_nonneg (smallComponent ι f _)))
(Finset.expect_nonneg (fun _ _ => sq_nonneg (rankComponent (Module.finrank F2 I) f _)))
(smallComponent_energy_cross_mul ι hι f hf)
calc
_ ≤ (2 : ℝ) ^ (2 * (Module.finrank F2 I * Module.finrank F2 I)) *
(𝔼 X, rankComponent (Module.finrank F2 I) f X ^ 2) := hbase
_ ≤ (2 : ℝ) ^ (2 * (Module.finrank F2 I * Module.finrank F2 I)) * ε :=
mul_le_mul_of_nonneg_left henergy (by positivity)
_ ≤ _ := mul_le_mul_of_nonneg_right
(pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) (by nlinarith)) hε
omit [Finite F] in
theorem fixedFrequencyEnergy_zero_dim_bound (ι : I →ₗ[F2] E)
(hι : Function.Injective ι) (f : (E →ₗ[F2] F) → ℝ)
(hf : IsBasisInvariant f) (ε : ℝ)
(hg : HomogeneousRestrictionBound (Module.finrank F2 I) ε f)
(π : I →ₗ[F2] J) (A : F →ₗ[F2] J) (hJ : Module.finrank F2 J = 0) :
(2 : ℝ) ^ ((Module.finrank F2 I + Module.finrank F2 J) * Module.finrank F2 E) *
fixedFrequencyEnergy ι f π A ≤
(2 : ℝ) ^ (4 * Module.finrank F2 I * Module.finrank F2 I) * ε := by
let : Subsingleton J := Module.finrank_zero_iff.mp hJ
have hπ : π = 0 := Subsingleton.elim _ _
have hA : A = 0 := Subsingleton.elim _ _
rw [hπ, hA, fixedFrequencyEnergy_zero, hJ, Nat.add_zero]
exact smallComponent_energy_base_bound ι hι f hf ε hg
end
end DFVSGames.Inverse.KMSAnalytic
end OAI
|