Skip to content
Merged
Show file tree
Hide file tree
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
46 changes: 23 additions & 23 deletions FormalBook/Chapter_01.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ Copyright 2022 Moritz Firsching. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching, Ralf Stephan
-/
import Mathlib.Algebra.Order.Ring.Star
import Mathlib.Data.Int.Lemmas
import Mathlib.Data.Int.Star
import Mathlib.NumberTheory.LucasLehmer
import Mathlib.NumberTheory.PrimeCounting
import Mathlib.NumberTheory.Fermat
import Mathlib.Analysis.SpecialFunctions.Pow.Real

open Finset Nat
open BigOperators
Expand All @@ -27,7 +28,7 @@ open BigOperators
-/
theorem infinity_of_primes₁ (S : Finset ℕ) (h : ∀ q ∈ S, Nat.Prime q):
∃ (p : ℕ), Nat.Prime p ∧ p ∉ S := by
let n := 1 + ∏ q in S, q
let n := 1 + ∏ q S, q
/- "This `n` has a prime divisor":
we pick the minimal one, the argument works with any prime divisor -/
let p := n.minFac
Expand All @@ -36,8 +37,8 @@ theorem infinity_of_primes₁ (S : Finset ℕ) (h : ∀ q ∈ S, Nat.Prime q):
(Finset.prod_pos fun q hq ↦ Prime.pos <| h q hq)
refine ⟨hp, ?_⟩
by_contra a
have h_p_div_prod : p ∣ ∏ q in S, q := dvd_prod_of_mem (fun (i : ℕ) ↦ i) a
have h_p_div_diff : p ∣ n - ∏ q in S, q := dvd_sub' (minFac_dvd n) h_p_div_prod
have h_p_div_prod : p ∣ ∏ q S, q := dvd_prod_of_mem (fun (i : ℕ) ↦ i) a
have h_p_div_diff : p ∣ n - ∏ q S, q := dvd_sub (minFac_dvd n) h_p_div_prod
have h_p_div_one : p ∣ 1 := by aesop
exact Nat.Prime.not_dvd_one hp h_p_div_one

Expand All @@ -52,7 +53,7 @@ local notation "F" => fermatNumber
-- We actually prove something slighly stronger that what is in the book:
-- also for n = 0, the statement is true.
-- This is in mathlib as `fermatNumber_product`
lemma fermatProduct (n : ℕ) : ∏ k in range n, F k = F n - 2 := by
lemma fermatProduct (n : ℕ) : ∏ k range n, F k = F n - 2 := by
induction' n with n hn
· trivial
· rw [prod_range_succ, hn]
Expand All @@ -67,9 +68,9 @@ theorem infinity_of_primes₂ (k n : ℕ) (h : k < n) : Coprime (F n) (F k) :=
have h_n : m ∣ F n := (F n).gcd_dvd_left (F k)
have h_k : m ∣ F k := (F n).gcd_dvd_right (F k)
have h_m : m ∣ 2 := by
have h_m_prod : m ∣ (∏ k in range n, F k) :=
have h_m_prod : m ∣ (∏ k range n, F k) :=
dvd_trans h_k (dvd_prod_of_mem F (mem_range.mpr h))
have h_prod : (∏ k in range n, F k) + 2 = F n := by
have h_prod : (∏ k range n, F k) + 2 = F n := by
rw [fermatProduct, Nat.sub_add_cancel]
refine' le_of_lt _
simp [two_lt_fermatNumber]
Expand Down Expand Up @@ -116,8 +117,7 @@ theorem infinity_of_primes₃:
rw [modEq_iff_dvd, dvd_iff_exists_eq_mul_left] at *
obtain ⟨c, hc⟩ := this
use c
simp only [CharP.cast_eq_zero, ge_iff_le, gt_iff_lt, pow_pos, cast_pred, cast_pow, cast_ofNat,
zero_sub, neg_sub] at hc
simp only [CharP.cast_eq_zero, zero_sub] at hc
simp [cast_one, cast_pow, cast_ofNat, hc.symm]
have h_mod_q' : (2 : (ZMod q)) ^ p = 1 := by
have := (ZMod.natCast_eq_natCast_iff _ _ _).mpr h_mod_q
Expand Down Expand Up @@ -154,9 +154,9 @@ theorem infinity_of_primes₃:
exact (totient_prime hq).symm
refine ⟨q, minFac_prime <| Nat.ne_of_gt ?_, ?_⟩
· calc 1 < 2^2 - 1 := one_lt_succ_succ 1
_ ≤ 2^p - 1 := sub_one_le_sub_one <| pow_le_pow_of_le_right (succ_pos 1) (Prime.two_le hp)
_ ≤ 2^p - 1 := sub_one_le_sub_one <| Nat.pow_le_pow_right (succ_pos 1) (Prime.two_le hp)
· have h2q : 2 ≤ q := Prime.two_le <| minFac_prime <| Nat.ne_of_gt <| lt_of_succ_lt <|
Nat.sub_le_sub_right ((pow_le_pow_of_le_right (succ_pos 1) (Prime.two_le hp))) 1
Nat.sub_le_sub_right ((Nat.pow_le_pow_right (succ_pos 1) (Prime.two_le hp))) 1
exact lt_of_le_of_lt (Nat.le_of_dvd (Nat.sub_pos_of_lt <| h2q) h_piv_div_q_sub_one)
<| pred_lt <| Nat.ne_of_gt <| Nat.le_of_lt h2q

Expand All @@ -181,11 +181,11 @@ theorem infinity_of_primes₄ : Tendsto π atTop atTop := by
have H_log_le_primeCountingReal_add_one (n : ℕ) (x : ℝ) (hxge : x ≥ n) (hxlt : x < n + 1) :
Real.log x ≤ primeCountingReal x + 1 :=
calc
Real.log x ≤ ∑ k in Icc 1 n, (k : ℝ)⁻¹ := by sorry
Real.log x ≤ ∑ k Icc 1 n, (k : ℝ)⁻¹ := by sorry
_ ≤ (∑' m : (S₁ x), (m : ℝ)⁻¹) := by sorry
_ ≤ (∏ p in primesBelow ⌊x⌋.natAbs, (∑' k : ℕ, (p ^ k : ℝ)⁻¹)) := by sorry
_ ≤ (∏ k in Icc 1 (primeCountingReal x), (nth Nat.Prime k) / ((nth Nat.Prime k) - 1)) := by sorry
_ ≤ (∏ k in Icc 1 (primeCountingReal x), (k + 1) / k) := by sorry
_ ≤ (∏ p primesBelow ⌊x⌋.natAbs, (∑' k : ℕ, (p ^ k : ℝ)⁻¹)) := by sorry
_ ≤ (∏ k Icc 1 (primeCountingReal x), (nth Nat.Prime k) / ((nth Nat.Prime k) - 1)) := by sorry
_ ≤ (∏ k Icc 1 (primeCountingReal x), (k + 1) / k) := by sorry
_ ≤ primeCountingReal x + 1 := by sorry
sorry

Expand All @@ -212,23 +212,23 @@ lemma H_P4_1 {k p: ℝ} (hk: k > 0) (hp: p ≥ k + 1): p / (p - 1) ≤ (k + 1) /
@le_sub_iff_add_le]
exact hp

lemma prod_Icc_succ_div (n : ℕ) (hn : 2 ≤ n) : (∏ x in Icc 1 n, ((x + 1) : ℝ) / x) = n + 1 := by
rw [← Nat.Ico_succ_right]
lemma prod_Icc_succ_div (n : ℕ) (hn : 2 ≤ n) : (∏ x Icc 1 n, ((x + 1) : ℝ) / x) = n + 1 := by
rw [← Finset.Ico_succ_right_eq_Icc]
induction' n with n h
· simp
· rw [Finset.prod_Ico_succ_top <| Nat.le_add_left 1 n]
norm_num
· simp only [succ_eq_succ, succ_eq_add_one] at h ⊢
rw [Finset.prod_Ico_succ_top <| Nat.le_add_left 1 n]
cases' lt_or_ge n 2 with _ h2
· interval_cases n
· tauto
· norm_num
field_simp [Finset.prod_eq_zero_iff] at h ⊢
rw [h h2]
ring
norm_num

-- Removed unnecessary assumption `(hpi3 : (π 3) = 2)`
lemma H_P4_2 (x : ℕ) (hx : x ≥ 3) :
(∏ x in Icc 1 (π x), ((x + 1) : ℝ) / x) = (π x) + 1 := by
(∏ x Icc 1 (π x), ((x + 1) : ℝ) / x) = (π x) + 1 := by
rw [prod_Icc_succ_div]
exact Monotone.imp monotone_primeCounting hx

Expand Down Expand Up @@ -334,7 +334,7 @@ using the sum of inverses of primes
-/
-- see Archive.Wiedijk100Theorems.SumOfPrimeReciprocalsDiverges
theorem infinity_of_primes₆ :
Tendsto (fun n ↦ ∑ p in Finset.filter (fun p ↦ Nat.Prime p) (range n), 1 / (p : ℝ))
Tendsto (fun n ↦ ∑ p Finset.filter (fun p ↦ Nat.Prime p) (range n), 1 / (p : ℝ))
atTop atTop := by
sorry

Expand Down
10 changes: 5 additions & 5 deletions FormalBook/Chapter_02.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ theorem real_main_inequality {x : ℝ} (n_large : (512 : ℝ) ≤ x) :
have h5 : 0 < x := lt_of_lt_of_le (by norm_num1) n_large
rw [← div_le_one (rpow_pos_of_pos four_pos x), ← div_div_eq_mul_div, ← rpow_sub four_pos, ←
mul_div 2 x, mul_div_left_comm, ← mul_one_sub, (by norm_num1 : (1 : ℝ) - 2 / 3 = 1 / 3),
mul_one_div, ← log_nonpos_iff (hf' x h5), ← hf x h5]
mul_one_div, ← log_nonpos_iff (hf' x h5).le, ← hf x h5]
have h : ConcaveOn ℝ (Set.Ioi 0.5) f := by
apply ConcaveOn.sub
apply ConcaveOn.add
Expand All @@ -76,7 +76,7 @@ theorem real_main_inequality {x : ℝ} (n_large : (512 : ℝ) ≤ x) :
norm_num1
· have : sqrt (2 * 512) = 32 :=
(sqrt_eq_iff_mul_self_eq_of_pos (by norm_num1)).mpr (by norm_num1)
rw [hf _ (by norm_num1), log_nonpos_iff (hf' _ (by norm_num1)), this,
rw [hf _ (by norm_num1), log_nonpos_iff (hf' _ (by norm_num1)).le, this,
div_le_one (by positivity)]
conv in 512 => equals 2 ^ 9 => norm_num1
conv in 2 * 512 => equals 2 ^ 10 => norm_num1
Expand All @@ -96,7 +96,7 @@ open Nat
theorem bertrand_main_inequality {n : ℕ} (n_large : 512 ≤ n) :
n * (2 * n) ^ Nat.sqrt (2 * n) * 4 ^ (2 * n / 3) ≤ 4 ^ n := by
rw [← @cast_le ℝ]
simp only [cast_add, cast_one, cast_mul, cast_pow, ← Real.rpow_natCast]
simp only [cast_mul, cast_pow, cast_ofNat, ← rpow_natCast]
refine' _root_.trans ?_ (Bertrand.real_main_inequality (by exact_mod_cast n_large))
gcongr
· have n2_pos : 0 < 2 * n := by positivity
Expand All @@ -110,7 +110,7 @@ factorization of the central binomial coefficient only has factors at most `2 *
-/
theorem centralBinom_factorization_small (n : ℕ) (n_large : 2 < n)
(no_prime : ¬∃ p : ℕ, p.Prime ∧ n < p ∧ p ≤ 2 * n) :
centralBinom n = ∏ p in Finset.range (2 * n / 3 + 1), p ^ (centralBinom n).factorization p := by
centralBinom n = ∏ p Finset.range (2 * n / 3 + 1), p ^ (centralBinom n).factorization p := by
refine' (Eq.trans _ n.prod_pow_factorization_centralBinom).symm
apply Finset.prod_subset
· exact Finset.range_subset.2 (add_le_add_right (Nat.div_le_self _ _) _)
Expand Down Expand Up @@ -138,7 +138,7 @@ theorem centralBinom_le_of_no_bertrand_prime (n : ℕ) (n_big : 2 < n)
have n2_pos : 1 ≤ 2 * n := mul_pos (zero_lt_two' ℕ) n_pos
let S := (Finset.range (2 * n / 3 + 1)).filter Nat.Prime
let f x := x ^ n.centralBinom.factorization x
have : ∏ x : ℕ in S, f x = ∏ x : ℕ in Finset.range (2 * n / 3 + 1), f x := by
have : ∏ x S, f x = ∏ x Finset.range (2 * n / 3 + 1), f x := by
refine' Finset.prod_filter_of_ne fun p _ h => _
contrapose! h
dsimp [f]
Expand Down
13 changes: 6 additions & 7 deletions FormalBook/Chapter_03.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ Copyright 2022 Moritz Firsching. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching, Christopher Schmidt
-/
import Mathlib.Algebra.Order.Star.Basic
import Mathlib.Analysis.Normed.Field.Lemmas
import Mathlib.Data.Int.Star
import Mathlib.Data.Rat.Star
import Mathlib.Data.Nat.Prime.Basic
import Mathlib.Tactic.Qify
--import data.nat.sqrt
--set_option trace.simp_lemmas true


Expand Down Expand Up @@ -71,9 +70,10 @@ theorem prime_div_descFactorial (n k m l p : ℕ) (h_klen : k ≤ n)
have h_fraction: (n.factorial / (k.factorial * (n - k).factorial)) =
(n.factorial / (n - k).factorial) / k.factorial := by
qify
field_simp
simp
rw [mul_comm]
exact Or.inl rfl
norm_cast
exact (Nat.div_div_eq_div_mul n ! (n - k)! k !).symm
rw [h_fraction] at h_pl_div_fac
have h_pl_div_fac_part: p^l ∣ (n.factorial / (n - k).factorial) := by
have h_eq_pl_with_k := exists_eq_mul_right_of_dvd h_pl_div_fac
Expand All @@ -82,8 +82,7 @@ theorem prime_div_descFactorial (n k m l p : ℕ) (h_klen : k ≤ n)
use (j * k.factorial)
rw [(mul_rotate _ _ _).symm, ← h_eq]
qify
field_simp
rw [mul_comm ((n - k)! : ℚ) _, mul_assoc]
aesop
cases' h_eq_pl with j h_eq
refine' Dvd.intro j _
rw [mul_comm]
Expand Down
6 changes: 3 additions & 3 deletions FormalBook/Chapter_05.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Copyright 2022 Moritz Firsching. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching, Nikolas Kuhn
-/
import Mathlib.Algebra.Polynomial.Basic
import Mathlib.Data.ZMod.Basic
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.RingTheory.LittleWedderburn

open ZMod Finset
open Polynomial (X)
Expand Down Expand Up @@ -108,7 +108,7 @@ decomposition`X^p - 1 = (X - ζ) * (X - ζ ^ 2) * ... * (X - ζ ^ p)`.
-/
lemma fact_B (p : ℕ) [Fact (Prime p)] (K : Type _) [Field K] (ζ : Kˣ) (h_1 : ζ ^ p = 1)
(h_2 : ζ ≠ 1) :
X ^ (p - 1) - 1 = ∏ i in Icc 1 p, (X - (Polynomial.C (ζ : K)) ^ i) := by
X ^ (p - 1) - 1 = ∏ i Icc 1 p, (X - (Polynomial.C (ζ : K)) ^ i) := by
sorry

theorem quadratic_reciprocity_2 (p q : ℕ) (hp : p ≠ 2) (hq : q ≠ 2)
Expand Down
23 changes: 13 additions & 10 deletions FormalBook/Chapter_06.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ Copyright 2022 Moritz Firsching. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching, Nick Kuhn
-/
import Mathlib.RingTheory.Henselian
import Mathlib.RingTheory.HopfAlgebra
import Mathlib.RingTheory.LittleWedderburn
import Mathlib.Algebra.Lie.OfAssociative
import Mathlib.Algebra.Order.Ring.Star
import Mathlib.Data.Int.Star
import Mathlib.Data.Real.StarOrdered
import Mathlib.Deprecated.Order
import Mathlib.RingTheory.LittleWedderburn
import Mathlib.RingTheory.SimpleRing.Principal

open Finset Subring Polynomial Complex BigOperators Nat
/-!
Expand Down Expand Up @@ -71,8 +74,8 @@ theorem h_lamb_gt_q_sub_one (q n : ℕ) (lamb : ℂ):
have h_ineq :
‖((X - C lamb).eval (q : ℂ))‖^2 > ((q : ℝ) - 1)^2 := by
calc
_ = ‖q - lamb‖^2 := by
simp only [eval_sub, eval_X, eval_C, norm_eq_abs]
_ = ‖q - lamb‖^2 := by sorry
--simp only [eval_sub, eval_X, eval_C, norm_eq_abs]
_ = ‖(q : ℂ) - a - I*b‖^2 := by sorry
_ = ‖(q : ℂ) - a‖^2 + ‖b‖^2 := by sorry
_ = (q : ℝ)^2 - 2*‖a‖*q + ‖a‖^2 + ‖b‖^2 := by sorry
Expand All @@ -81,9 +84,9 @@ theorem h_lamb_gt_q_sub_one (q n : ℕ) (lamb : ℂ):
have : 0 ≤ ((q : ℝ) - 1)^2 := sq_nonneg ((q : ℝ) - 1)
have g := (Real.sqrt_lt_sqrt_iff (sq_nonneg ((q : ℝ) - 1))).mpr (h_ineq)
have : Real.sqrt (((q:ℝ) - 1) ^ 2) = ((q : ℝ) - 1) := by sorry
rw [this, norm_eq_abs, Real.sqrt_sq] at g
rw [this, Real.sqrt_sq] at g
· exact g
· exact AbsoluteValue.nonneg Complex.abs (eval (↑q) (X - C lamb))
· sorry

lemma div_of_qpoly_div (k n q : ℕ) (hq : 1 < q) (hk : 0 < k) (hn : 0 < n)
(H : q ^ k - 1 ∣ q ^ n - 1) : k ∣ n := by
Expand Down Expand Up @@ -189,8 +192,8 @@ theorem wedderburn (h: Fintype R): IsField R := by
have finclassa: ∀ (A : ConjClasses Rˣ), Fintype ↑(ConjClasses.carrier A) :=
fun _ ↦ ConjClasses.instFintypeElemCarrier

have : ∀ (A : ConjClasses Rˣ), Fintype ↑(Set.centralizer {Quotient.out' A}) :=
fun _ ↦ setFintype (Set.centralizer {Quotient.out' _})
have : ∀ (A : ConjClasses Rˣ), Fintype ↑(Set.centralizer {Quotient.out A}) :=
fun _ ↦ setFintype (Set.centralizer {Quotient.out _})

letI fintypea : ∀ (A : ConjClasses Rˣ), Fintype ↑{A |
have := finclassa A; Fintype.card ↑(ConjClasses.carrier A) > 1} :=
Expand Down Expand Up @@ -278,7 +281,7 @@ theorem wedderburn (h: Fintype R): IsField R := by
by_contra

have g : Polynomial.map (Int.castRingHom ℂ) (phi n) =
∏ lamb in (primitiveRoots n ℂ), (X - C lamb) := by
∏ lamb (primitiveRoots n ℂ), (X - C lamb) := by
dsimp only [phi]
simp only [map_cyclotomic]
have := isPrimitiveRoot_exp n h_n
Expand Down
11 changes: 5 additions & 6 deletions FormalBook/Chapter_08.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching
-/
import Mathlib.Tactic
import Mathlib.Data.Real.Basic
import Mathlib.Data.Complex.Exponential
-- import Mathlib.Analysis.Calculus.IteratedDeriv
-- import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
-- import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse
import Mathlib.Analysis.Calculus.IteratedDeriv.Defs
import Mathlib.Analysis.InnerProductSpace.Basic
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse


open Real (exp )--pi crccos)

Expand Down Expand Up @@ -94,7 +93,7 @@ Let `n : ℕ`, `n ≥ 1` be fixed, and consider `f_aux n x = x ^ n * (1 - x) ^ n

noncomputable def f_aux (n : ℕ) (x : ℝ) := x ^ n * (1 - x) ^ n / n.factorial

lemma lem_aux_i (n : ℕ) (x : ℝ) : ∃ c : ℕ → ℤ, f_aux n x = ∑ i in Icc n (2 * n), (c i) * x ^ i := by
lemma lem_aux_i (n : ℕ) (x : ℝ) : ∃ c : ℕ → ℤ, f_aux n x = ∑ i Icc n (2 * n), (c i) * x ^ i := by
sorry

lemma lem_aux_ii (n : ℕ) (x : ℝ) (h_1 : 0 < x) (h_2 : x < 0) :
Expand Down
3 changes: 1 addition & 2 deletions FormalBook/Chapter_20.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Combinatorics.Enumerative.DoubleCounting
import Mathlib.Combinatorics.SimpleGraph.Clique
import Mathlib.Combinatorics.SimpleGraph.DegreeSum
import Mathlib.Data.Real.StarOrdered

open Real
open RealInnerProductSpace
Expand Down Expand Up @@ -82,7 +81,7 @@ theorem cauchy_schwarz_inequality (a b : V) : ⟪ a, b ⟫ ^ 2 ≤ ‖a‖ ^ 2 *
have ha_sq : ‖a‖ ^ 2 ≠ 0 := by aesop
have := discrim_lt_zero ha_sq this
unfold discrim at this
have : (2 * inner a b) ^ 2 < 4 * ‖a‖ ^ 2 * ‖b‖ ^ 2 := by linarith
have : (2 * inner _ a b) ^ 2 < 4 * ‖a‖ ^ 2 * ‖b‖ ^ 2 := by linarith
linarith


Expand Down
4 changes: 2 additions & 2 deletions FormalBook/Chapter_24.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Copyright 2022 Moritz Firsching. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching
-/
import Mathlib.Data.Matrix.DoublyStochastic
import Mathlib.Data.Real.Basic
import Mathlib.Analysis.Convex.DoublyStochasticMatrix
import Mathlib.LinearAlgebra.Matrix.Permanent

/-!
# Van der Waerden's permanent conjecture

Expand Down
3 changes: 2 additions & 1 deletion FormalBook/Chapter_28.lean
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ lemma handshaking : ∑ v, d(v) = 2 * #E := by
_ = ∑ v, #I(v) := by simp [G.card_incidenceFinset_eq_degree]
_ = ∑ v, #{e ∈ E | v ∈ e} := by simp [G.incidenceFinset_eq_filter]
_ = ∑ e ∈ E, #{v | v ∈ e} := Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow _
_ = ∑ e ∈ E, 2 := Finset.sum_congr rfl (λ e he ↦ (G.card_filter_mem_of_mem_edgeFinset e he))
-- FIXME: was (G.card_filter_mem_of_mem_edgeFinset e he)) but is commented out currently in Mathlib.EdgeFinset
_ = ∑ e ∈ E, 2 := Finset.sum_congr rfl (λ e he ↦ sorry)
_ = 2 * ∑ e ∈ E, 1 := (Finset.mul_sum E (λ _ ↦ 1) 2).symm
_ = 2 * #E := by rw [Finset.card_eq_sum_ones E]

Expand Down
Loading