File size: 6,430 Bytes
4a56cd6 | 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 | import OAI.Combinatorics.MatchingPSD.SpectralMultiplicity
namespace OAI
universe u_1 u_2 u_3
namespace MatchingSmoothing
namespace Pairing
variable {V : Type u_1} [Fintype V] [DecidableEq V]
noncomputable instance : Fintype (Pairing V) := Fintype.ofFinite _
instance relabelMulAction : MulAction (Equiv.Perm V) (Pairing V) where
smul := relabel
one_smul := relabel_one
mul_smul := relabel_mul
omit [Fintype V] [DecidableEq V] in
lemma smul_eq_relabel (p : Equiv.Perm V) (M : Pairing V) : p β’ M = relabel p M := rfl
noncomputable def table (M : Pairing V) (f : V β Fin 3) (t : Fin 6) : β :=
histogram (fun v => threeEdgeType (f v, f (M.1 v))) t / 2
omit [DecidableEq V] in
lemma table_relabel (p : Equiv.Perm V) (M : Pairing V) (f : V β Fin 3) :
(relabel p M).table f = M.table (f β p) := by
funext t
unfold table
congr 1
have he : (fun v => threeEdgeType (f v, f ((relabel p M).1 v))) β p =
(fun v => threeEdgeType ((f β p) v, (f β p) (M.1 v))) := by
funext v
simp only [Function.comp_apply, relabel_apply]
rw [Equiv.Perm.inv_def, p.symm_apply_apply]
rw [β he, histogram_comp_perm]
end Pairing
section StandardTable
variable {H : Type u_2} [Fintype H] [DecidableEq H]
def standardPairing : Pairing (H Γ Bool) :=
β¨Equiv.prodCongr (Equiv.refl H) Equiv.boolNot,
by rintro β¨i,bβ©; cases b <;> rfl,
by rintro β¨i,bβ© h; have he := congrArg Prod.snd h; cases b <;> contradictionβ©
omit [DecidableEq H] in
lemma standardPairing_table (f : H Γ Bool β Fin 3) :
(standardPairing (H := H)).table f = threeTable f := by
funext t
have he : histogram (fun v => threeEdgeType (f v, f ((standardPairing (H := H)).1 v))) t =
2 * threeTable f t := by
have hr : (histogram (fun v => threeEdgeType (f v,
f ((standardPairing (H := H)).1 v))) t : β) = 2 * threeTable f t := by
simp only [histogram_cast_sum, Fintype.sum_prod_type, Fintype.sum_bool,
standardPairing, Equiv.prodCongr_apply]
change (β i, ((if threeEdgeType (f (i,true),f (i,false)) = t then (1 : β) else 0) +
(if threeEdgeType (f (i,false),f (i,true)) = t then 1 else 0))) = _
simp_rw [threeEdgeType_symm (f (_,true)) (f (_,false))]
rw [Finset.sum_add_distrib]
change (β i, if threeEdgeType (f (i,false),f (i,true)) = t then (1 : β) else 0) +
(β i, if threeEdgeType (f (i,false),f (i,true)) = t then (1 : β) else 0) = _
rw [show (threeTable f t : β) =
β i, if threeEdgeType (f (i,false),f (i,true)) = t then 1 else 0 from
histogram_cast_sum (threeEdgeType β pairColorEquiv f) t]
ring
exact_mod_cast hr
change _ / 2 = _
rw [he, Nat.mul_div_right _ (by decide : 0 < 2)]
end StandardTable
section MatchingIncidence
variable {H : Type u_3} [Fintype H] [DecidableEq H]
noncomputable def tableRelation (fβ : H Γ Bool β Fin 3) :
Pairing (H Γ Bool) β Colorings (H Γ Bool) (Fin 3) (histogram fβ) β Prop :=
fun M z => M.table z.1 = threeTable fβ
noncomputable def coloringPerm (s : Fin 3 β β) (p : Equiv.Perm (H Γ Bool)) :
Equiv.Perm (Colorings (H Γ Bool) (Fin 3) s) where
toFun z := β¨z.1 β p, (histogram_comp_perm z.1 p).trans z.2β©
invFun z := β¨z.1 β p.symm, (histogram_comp_perm z.1 p.symm).trans z.2β©
left_inv z := by apply Subtype.ext; funext v; simp
right_inv z := by apply Subtype.ext; funext v; simp
omit [DecidableEq H] in
lemma commonIncidence_table_relabel (fβ : H Γ Bool β Fin 3)
(p : Equiv.Perm (H Γ Bool)) (M N : Pairing (H Γ Bool)) :
commonIncidence (tableRelation fβ) (Pairing.relabel p M) (Pairing.relabel p N) =
commonIncidence (tableRelation fβ) M N := by
classical
unfold commonIncidence
congr 1
apply Fintype.card_congr
apply (coloringPerm (histogram fβ) p).subtypeEquiv
intro z
change ((Pairing.relabel p M).table z.1 = _ β§ (Pairing.relabel p N).table z.1 = _) β
(M.table (z.1 β p) = _ β§ N.table (z.1 β p) = _)
simp only [Pairing.table_relabel]
lemma commonIncidence_standard (fβ : H Γ Bool β Fin 3) (hH : 0 < Fintype.card H)
(p : Equiv.Perm (H Γ Bool)) :
commonIncidence (tableRelation fβ) standardPairing (Pairing.relabel p standardPairing) =
(Fintype.card {f : H Γ Bool β Fin 3 //
threeTable f = threeTable fβ β§ threeTable (f β p) = threeTable fβ} : β) := by
classical
unfold commonIncidence
congr 1
apply Fintype.card_congr
refine { toFun := fun z => β¨z.1.1, ?_β©
invFun := fun f => β¨β¨f.1, threeTable_histogram_eq hH f.2.1β©, ?_β©
left_inv := fun _ => rfl
right_inv := fun _ => rfl }
Β· simpa only [tableRelation, Pairing.table_relabel, standardPairing_table] using z.2
Β· simpa only [tableRelation, Pairing.table_relabel, standardPairing_table] using f.2
lemma matching_table_trace_square (fβ : H Γ Bool β Fin 3) (hH : 0 < Fintype.card H)
(hfβ : β i, 0 < histogram fβ i) :
let D : β := Fintype.card {f : H Γ Bool β Fin 3 // threeTable f = threeTable fβ}
Matrix.trace (incidenceOperator (tableRelation fβ) D *
incidenceOperator (tableRelation fβ) D) β€ (Fintype.card H + 1 : β) ^ 33 := by
classical
dsimp only
let D : β := Fintype.card {f : H Γ Bool β Fin 3 // threeTable f = threeTable fβ}
change Matrix.trace (incidenceOperator (tableRelation fβ) D *
incidenceOperator (tableRelation fβ) D) β€ _
have he := trace_normalized_invariant_kernel_sq (G := Equiv.Perm (H Γ Bool))
(standardPairing (H := H)) (fun M => Pairing.exists_relabel _ M)
(incidenceKernel (tableRelation fβ) D)
(incidenceKernel_symm (tableRelation fβ) D)
(fun p M N => by
change (Fintype.card _ : β) / D ^ 2 * commonIncidence _ (Pairing.relabel p M)
(Pairing.relabel p N) = (Fintype.card _ : β) / D ^ 2 * commonIncidence _ M N
rw [commonIncidence_table_relabel])
change Matrix.trace (incidenceOperator (tableRelation fβ) D *
incidenceOperator (tableRelation fβ) D) = _ at he
rw [he]
have hp : (0 : β) < Fintype.card (Equiv.Perm (H Γ Bool)) := Nat.cast_pos.mpr Fintype.card_pos
apply (div_le_iffβ hp).mpr
simp only [incidenceKernel, Pairing.smul_eq_relabel,
commonIncidence_standard fβ hH]
exact (three_table_kernel_moment fβ hH hfβ).trans_eq (mul_comm _ _)
end MatchingIncidence
end MatchingSmoothing
end OAI
|