thurston-lean / Thurston /Core /IterateMatrix.lean
system's picture
system HF Staff
Sync Lean + ledger from GitHub (6d6513147f03fcdca5249ee06cbaf74ba025e4b0)
55a3af4 verified
Raw History Blame Contribute Delete
12.7 kB

The Thurston pullback matrix of a finite 1-step covering-lift system: (thurstonMatrix src tgt deg) δ γ = ∑_{src l = δ, tgt l = γ} 1 / deg l.

32
noncomputable def thurstonMatrix (src tgt : L → Λ) (deg : L → ℕ) : Matrix Λ Λ ℝ :=
body · 2 lines
  fun δ γ =>
    ∑ l ∈ Finset.univ.filter (fun l : L => src l = δ ∧ tgt l = γ), (1 : ℝ) / (deg l : ℝ)
37
lemma thurstonMatrix_apply (src tgt : L → Λ) (deg : L → ℕ) (δ γ : Λ) :
    thurstonMatrix src tgt deg δ γ =
      ∑ l ∈ Finset.univ.filter (fun l : L => src l = δ ∧ tgt l = γ), (1 : ℝ) / (deg l : ℝ) :=
proof · 1 line
  rfl

Every entry of the Thurston pullback matrix is nonnegative.

43
lemma thurstonMatrix_nonneg (src tgt : L → Λ) (deg : L → ℕ) (δ γ : Λ) :
    0 ≤ thurstonMatrix src tgt deg δ γ :=
proof · 1 line
  Finset.sum_nonneg fun _ _ => by positivity
47
private lemma sum_subtype_tgt_eq_thurstonMatrix (src tgt : L → Λ) (deg : L → ℕ) (δ κ : Λ) :
    (∑ l : { l : L // tgt l = κ },
      if src l.1 = δ then (1 : ℝ) / (deg l.1 : ℝ) else 0) =
      thurstonMatrix src tgt deg δ κ := by
proof · 7 lines
  rw [← Finset.sum_filter, thurstonMatrix_apply]
  refine Finset.sum_bij (fun l _ => l.1) (fun l hl => ?_) (fun _ _ _ _ h => Subtype.ext h)
    (fun l hl => ?_) (fun _ _ => rfl)
  · simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hl ⊢
    exact ⟨hl, l.2⟩
  · simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hl
    exact ⟨⟨l, hl.2⟩, by simp [hl.1], rfl⟩

A composable chain of m 1-step lifts starting at δ and ending at γ. For m = 0, it is a lifted proof that δ = γ; for m + 1, it consists of a first lift l with src l = δ followed by an m-step chain from tgt l to γ.

70
def LiftChain (src tgt : L → Λ) : ℕ → Λ → Λ → Type u
body · 2 lines
  | 0, δ, γ => ULift.{u} (PLift (δ = γ))
  | m + 1, δ, γ => Σ l : { l : L // src l = δ }, LiftChain src tgt m (tgt l.1) γ

Total covering degree of a lift chain: the product of the degrees of its steps.

75
def chainDeg {src tgt : L → Λ} (deg : L → ℕ) :
    {m : ℕ} → {δ γ : Λ} → LiftChain src tgt m δ γ → ℕ
body · 2 lines
  | 0, _, _, _ => 1
  | _ + 1, _, _, ⟨l, c⟩ => deg l.1 * chainDeg deg c
80
instance instFintypeLiftChain [Fintype L] [DecidableEq Λ]
    (src tgt : L → Λ) : ∀ (m : ℕ) (δ γ : Λ), Fintype (LiftChain src tgt m δ γ)
body · 5 lines
  | 0, δ, γ => by dsimp [LiftChain]; infer_instance
  | m + 1, δ, γ => by
    dsimp [LiftChain]
    letI := instFintypeLiftChain src tgt m
    infer_instance

Concrete `m`-step lift-chain formula: for every m : ℕ and δ, γ : Λ, (M ^ m) δ γ equals the sum of 1 / chainDeg c over all composable m-step lift chains c from δ to γ.

91
theorem pow_thurstonMatrix_eq_sum_chains [Fintype Λ] [Fintype L] [DecidableEq Λ]
    (src tgt : L → Λ) (deg : L → ℕ) :
    ∀ (m : ℕ) (δ γ : Λ),
      (thurstonMatrix src tgt deg ^ m) δ γ =
        ∑ c : LiftChain src tgt m δ γ, (1 : ℝ) / (chainDeg deg c : ℝ)
proof · 41 lines
  | 0, δ, γ => by
    simp only [pow_zero, Matrix.one_apply, LiftChain, chainDeg, Nat.cast_one, div_one]
    by_cases h : δ = γ
    · subst h
      have : Unique (ULift.{u} (PLift (δ = δ))) := ⟨⟨⟨⟨rfl⟩⟩⟩, fun ⟨⟨_⟩⟩ => rfl⟩
      simp
    · have : IsEmpty (ULift.{u} (PLift (δ = γ))) := ⟨fun ⟨⟨heq⟩⟩ => h heq⟩
      simp [h]
  | m + 1, δ, γ => by
    have ih := pow_thurstonMatrix_eq_sum_chains src tgt deg m
    have hrhs :
        (∑ c : LiftChain src tgt (m + 1) δ γ, (1 : ℝ) / (chainDeg deg c : ℝ)) =
          ∑ l : { l : L // src l = δ },
            ((1 : ℝ) / (deg l.1 : ℝ)) * (thurstonMatrix src tgt deg ^ m) (tgt l.1) γ := by
      change (∑ p : Σ l : { l : L // src l = δ }, LiftChain src tgt m (tgt l.1) γ,
        (1 : ℝ) / ((deg p.1.1 * chainDeg deg p.2 : ℕ) : ℝ)) = _
      rw [Fintype.sum_sigma]
      refine Finset.sum_congr rfl fun l _ => ?_
      rw [ih (tgt l.1) γ, Finset.mul_sum]
      refine Finset.sum_congr rfl fun c _ => by push_cast; rw [one_div_mul_one_div]
    rw [hrhs, pow_succ', Matrix.mul_apply]
    symm
    rw [← Finset.sum_fiberwise_of_maps_to (t := Finset.univ)
      (g := fun l : { l : L // src l = δ } => tgt l.1) (fun _ _ => Finset.mem_univ _)]
    refine Finset.sum_congr rfl fun κ _ => ?_
    have hinner :
        (∑ l ∈ Finset.univ.filter (fun l : { l : L // src l = δ } => tgt l.1 = κ),
          ((1 : ℝ) / (deg l.1 : ℝ)) * (thurstonMatrix src tgt deg ^ m) (tgt l.1) γ) =
          (∑ l ∈ Finset.univ.filter (fun l : { l : L // src l = δ } => tgt l.1 = κ),
            (1 : ℝ) / (deg l.1 : ℝ)) * (thurstonMatrix src tgt deg ^ m) κ γ := by
      rw [Finset.sum_mul]
      refine Finset.sum_congr rfl fun l hl => by
        simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hl; rw [hl]
    rw [hinner, thurstonMatrix_apply]
    congr 1
    refine Finset.sum_bij (fun l _ => l.1) (fun l hl => ?_) (fun _ _ _ _ h => Subtype.ext h)
      (fun l hl => ?_) (fun _ _ => rfl)
    · simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hl ⊢
      exact ⟨l.2, hl⟩
    · simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hl
      exact ⟨⟨l, hl.1⟩, by simp [hl.2], rfl⟩

Lemma 4.1 (`lem:iterate`, Matrices of iterates): Given a finite family Comp m γ of essential m-step closed lifts over γ ∈ Λ with homotopy class cls and covering degree compDeg, satisfying: - base correspondence Comp 1 γ ≃ { l : L // tgt l = γ } preserving class and degree; - inductive factorization Comp (m + 1) γ ≃ Σ β : Comp m γ, { l : L // tgt l = cls β } (stability + isotopy lifting) with multiplicative covering degrees;

we have for every m ≥ 1 and δ, γ : Λ: (thurstonMatrix src tgt deg ^ m) δ γ = ∑_{α ∈ Comp m γ, cls α = δ} 1 / compDeg α.

153
theorem iterate_matrix_eq_sum_lifts
    (src tgt : L → Λ) (deg : L → ℕ)
    (Comp : ℕ → Λ → Type*) [∀ m γ, Fintype (Comp m γ)]
    (cls : ∀ {m γ}, Comp m γ → Λ)
    (compDeg : ∀ {m γ}, Comp m γ → ℕ)
    (e_one : ∀ γ, Comp 1 γ ≃ { l : L // tgt l = γ })
    (hcls_one : ∀ {γ} (α : Comp 1 γ), cls α = src (e_one γ α).1)
    (hdeg_one : ∀ {γ} (α : Comp 1 γ), compDeg α = deg (e_one γ α).1)
    (e_succ : ∀ m, 1 ≤ m → ∀ γ,
      Comp (m + 1) γ ≃ Σ β : Comp m γ, { l : L // tgt l = cls β })
    (hcls_succ : ∀ m (hm : 1 ≤ m) γ (β : Comp m γ) (l : { l : L // tgt l = cls β }),
      cls ((e_succ m hm γ).symm ⟨β, l⟩) = src l.1)
    (hdeg_succ : ∀ m (hm : 1 ≤ m) γ (β : Comp m γ) (l : { l : L // tgt l = cls β }),
      compDeg ((e_succ m hm γ).symm ⟨β, l⟩) = deg l.1 * compDeg β) :
    ∀ m : ℕ, 1 ≤ m → ∀ δ γ : Λ,
      (thurstonMatrix src tgt deg ^ m) δ γ =
        ∑ α ∈ Finset.univ.filter (fun α : Comp m γ => cls α = δ),
          (1 : ℝ) / (compDeg α : ℝ) := by
proof · 38 lines
  intro m hm
  induction m, hm using Nat.le_induction with
  | base =>
    intro δ γ
    rw [pow_one, thurstonMatrix_apply]
    symm
    refine Finset.sum_bij (fun α _ => (e_one γ α).1) (fun α hα => ?_)
      (fun _ _ _ _ h => (e_one γ).injective (Subtype.ext h)) (fun l hl => ?_)
      (fun α _ => by rw [hdeg_one α])
    · simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hα ⊢
      exact ⟨(hcls_one α).symm.trans hα, (e_one γ α).2⟩
    · simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hl
      exact ⟨(e_one γ).symm ⟨l, hl.2⟩, by simp [hcls_one, hl.1], by simp⟩
  | succ m hm ih =>
    intro δ γ
    symm
    rw [Finset.sum_filter, ← Equiv.sum_comp (e_succ m hm γ).symm, Fintype.sum_sigma]
    have hinner :
        (∑ β : Comp m γ, ∑ l : { l : L // tgt l = cls β },
          if cls ((e_succ m hm γ).symm ⟨β, l⟩) = δ then
            (1 : ℝ) / (compDeg ((e_succ m hm γ).symm ⟨β, l⟩) : ℝ)
          else 0) =
          ∑ β : Comp m γ,
            thurstonMatrix src tgt deg δ (cls β) * ((1 : ℝ) / (compDeg β : ℝ)) := by
      refine Finset.sum_congr rfl fun β _ => ?_
      rw [← sum_subtype_tgt_eq_thurstonMatrix, Finset.sum_mul]
      refine Finset.sum_congr rfl fun l _ => ?_
      rw [hcls_succ m hm γ β l, hdeg_succ m hm γ β l]
      split_ifs
      · push_cast; rw [one_div_mul_one_div]
      · simp
    rw [hinner, ← Finset.sum_fiberwise_of_maps_to (t := Finset.univ)
      (g := fun β : Comp m γ => cls β) (fun _ _ => Finset.mem_univ _),
      pow_succ', Matrix.mul_apply]
    refine Finset.sum_congr rfl fun κ _ => ?_
    rw [ih κ γ, Finset.mul_sum]
    refine Finset.sum_congr rfl fun β hβ => by
      simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hβ; rw [hβ]
221
private def exSrc : Fin 3 → Fin 2 | 0 => 0 | 1 => 0 | 2 => 1
222
private def exTgt : Fin 3 → Fin 2 | 0 => 0 | 1 => 1 | 2 => 0
223
private def exDeg : Fin 3 → ℕ | 0 => 2 | 1 => 1 | 2 => 2
225
private abbrev ExComp (m : ℕ) (γ : Fin 2) : Type :=
body · 1 line
  Σ δ : Fin 2, LiftChain exSrc exTgt m δ γ
228
private def exEquivOne (γ : Fin 2) : ExComp 1 γ ≃ { l : Fin 3 // exTgt l = γ } where
body · 4 lines
  toFun p := ⟨p.2.1.1, p.2.2.down.down⟩
  invFun l := ⟨exSrc l.1, ⟨⟨l.1, rfl⟩, ⟨⟨l.2⟩⟩⟩⟩
  left_inv := by rintro ⟨δ, ⟨⟨l, rfl⟩, ⟨⟨rfl⟩⟩⟩⟩; rfl
  right_inv := by rintro ⟨l, rfl⟩; rfl
234
private def exEquivSucc (m : ℕ) (γ : Fin 2) :
    ExComp (m + 1) γ ≃ Σ β : ExComp m γ, { l : Fin 3 // exTgt l = β.1 } where
body · 4 lines
  toFun p := ⟨⟨exTgt p.2.1.1, p.2.2⟩, ⟨p.2.1.1, rfl⟩⟩
  invFun := fun ⟨⟨_, c⟩, ⟨l, htgt⟩⟩ => ⟨exSrc l, ⟨⟨l, rfl⟩, htgt ▸ c⟩⟩
  left_inv := by rintro ⟨δ, ⟨⟨l, rfl⟩, c⟩⟩; rfl
  right_inv := by rintro ⟨⟨κ, c⟩, ⟨l, htgt⟩⟩; dsimp only at htgt; subst htgt; rfl
241
example :
    (thurstonMatrix exSrc exTgt exDeg ^ 2) 0 0 =
      ∑ α ∈ Finset.univ.filter (fun α : ExComp 2 0 => α.1 = 0),
        (1 : ℝ) / (chainDeg exDeg α.2 : ℝ) ∧
    (thurstonMatrix exSrc exTgt exDeg ^ 2) 0 0 =
      ∑ c : LiftChain exSrc exTgt 2 0 0, (1 : ℝ) / (chainDeg exDeg c : ℝ) ∧
    (thurstonMatrix exSrc exTgt exDeg ^ 2) 0 0 = (3 : ℝ) / 4 := by
proof · 13 lines
  have h1 := iterate_matrix_eq_sum_lifts exSrc exTgt exDeg
    ExComp (fun p => p.1) (fun p => chainDeg exDeg p.2)
    exEquivOne (fun p => p.2.1.2.symm)
    (fun ⟨_, ⟨_, _⟩⟩ => mul_one _)
    (fun m _ γ => exEquivSucc m γ) (fun _ _ _ _ _ => rfl)
    (fun _ _ _ β l => by
      rcases β with ⟨κ, c⟩; rcases l with ⟨l, htgt⟩; dsimp only at htgt; subst htgt; rfl)
    2 (by norm_num) 0 0
  have h2 := pow_thurstonMatrix_eq_sum_chains exSrc exTgt exDeg 2 0 0
  refine ⟨h1, h2, ?_⟩
  rw [pow_two, Matrix.mul_apply, Fin.sum_univ_two]
  simp_rw [thurstonMatrix_apply, Finset.sum_filter, Fin.sum_univ_three]
  norm_num [exSrc, exTgt, exDeg]