cfahlgren1's picture
download
raw
1.91 kB
11
def emptyPartialMatching (n : ℕ) : PartialMatching n :=
body · 3 lines
  ⟨∅, by
    intro v e he
    simp at he⟩
16
@[simp] theorem loopVertices_emptyPartialMatching (n : ℕ) :
    loopVertices (emptyPartialMatching n) = Finset.univ := by
proof · 3 lines
  classical
  ext v
  simp [loopVertices, emptyPartialMatching]
22
theorem partialMatching_eq_empty_of_le_one {n : ℕ} (hn : n ≤ 1)
    (M : PartialMatching n) : M = emptyPartialMatching n := by
proof · 7 lines
  apply Subtype.ext
  ext e
  have hleft := e.val.1.isLt
  have hright := e.val.2.isLt
  have horder := e.property
  change e.val.1.val < e.val.2.val at horder
  omega
32
theorem count_eq_loop_product_of_le_one (G : Input) (hn : G.n ≤ 1) :
    count G = ∏ v : Fin G.n, loopMultiplicity G v := by
proof · 8 lines
  classical
  unfold count
  rw [Finset.sum_eq_single (emptyPartialMatching G.n)]
  · simp [weight, emptyPartialMatching, loopVertices]
  · intro M _ hne
    exact (hne (partialMatching_eq_empty_of_le_one hn M)).elim
  · intro hnot
    exact (hnot (Finset.mem_univ _)).elim
43
theorem count_order_zero (G : Input) (hn : G.n = 0) : count G = 1 := by
proof · 5 lines
  rw [count_eq_loop_product_of_le_one G (by omega)]
  apply Finset.prod_eq_one
  intro v _
  have hv := v.isLt
  omega
50
theorem count_order_one (G : Input) (hn : G.n = 1) :
    count G = loopMultiplicity G ⟨0, by omega⟩ := by
proof · 12 lines
  classical
  rw [count_eq_loop_product_of_le_one G (by omega)]
  apply Finset.prod_eq_single (⟨0, by omega⟩ : Fin G.n)
  · intro v _ hne
    have hv := v.isLt
    have heq : v = (⟨0, by omega⟩ : Fin G.n) := by
      apply Fin.ext
      change v.val = 0
      omega
    exact (hne heq).elim
  · intro hnot
    exact (hnot (Finset.mem_univ _)).elim

Xet Storage Details

Size:
1.91 kB
·
Xet hash:
e2dc1b8174663320146f1d95f2d28997dcda8426248f5317ef2d8364fb735839

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.