Compfiles/Usa1995P5.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned compfiles documentation, Pinned compfiles corpus index

5 declarations, 0 contain sorry, 0 declared as axioms

USA Mathematical Olympiad 1995, Problem 5

A graph with n points and k edges has no triangles. Show that it has a point P such that there are at most k(1 - 4k/n²) edges between points not joined to P (by an edge).

Imports (4)
Imported by 1 file
  1. lemma Usa1995P5.not_adj_and_adj_of_mem_edgeFinset In a triangle-free graph, no edge can have two distinct endpoints that are both adjacent to P: together with P they would form a triangle line 36 source

    Source documentation

    In a triangle-free graph, no edge can have two distinct endpoints that are both adjacent to P: together with P they would form a triangle.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, SimpleGraph, Fin, DecidableRel, SimpleGraph.Adj, SimpleGraph.CliqueFree, OfNat.ofNat, Ne, Sym2, Membership.mem, Finset, SimpleGraph.edgeFinset, False

    Proof uses: Sym2.ind, Sym2.mk, Eq, Or, Eq.mp, congrArg, propext, Sym2.mem_iff, absurd, rfl, Set, SimpleGraph.edgeSet, SimpleGraph.mem_edgeSet, SimpleGraph.mem_edgeFinset, SimpleGraph.Adj.symm, Insert.insert, Singleton.singleton, Iff.mpr, SimpleGraph.IsNClique, And and 2 more

    20 instances, coercions and auxiliary constants left out.

    Tactic trace: 15 steps

    Open to load the checked before-and-after goal states.

    lemma not_adj_and_adj_of_mem_edgeFinset (hG : G.CliqueFree 3) {P Q₁ Q₂ : Fin n}
        (hPQ₁ : G.Adj P Q₁) (hPQ₂ : G.Adj P Q₂) (hne : Q₁ ≠ Q₂)
        {e : Sym2 (Fin n)} (he : e ∈ G.edgeFinset) (h₁ : Q₁ ∈ e) (h₂ : Q₂ ∈ e) :
        False := by
    …

    Mentions: P

  2. lemma Usa1995P5.sum_degree_neighborFinset_eq_card Double counting: the sum of the degrees of the neighbors of P equals the number of edges of G having an endpoint adjacent to P line 56 source

    Source documentation

    Double counting: the sum of the degrees of the neighbors of P equals the number of edges of G having an endpoint adjacent to P. Indeed, every edge incident to a neighbor Q of P has Q as its unique endpoint adjacent to P, since the graph is triangle-free.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, SimpleGraph, Fin, DecidableRel, SimpleGraph.Adj, SimpleGraph.CliqueFree, OfNat.ofNat, Eq, Finset.sum, SimpleGraph.neighborFinset, Membership.mem, Set, SimpleGraph.neighborSet, SimpleGraph.degree, Finset.card, Sym2, Finset.filter, Exists, And, SimpleGraph.edgeFinset

    Proof uses: Eq.mpr, SimpleGraph.incidenceFinset, id, congrArg, Eq.symm, SimpleGraph.card_incidenceFinset_eq_degree, Finset, SimpleGraph.incidenceFinset_eq_filter, Eq.refl, congrFun', Finset.sum_congr, Set.PairwiseDisjoint, Ne, Function.onFun, Disjoint, Not, propext, Finset.disjoint_left, Usa1995P5.not_adj_and_adj_of_mem_edgeFinset, Iff.mp and 17 more

    39 instances, coercions and auxiliary constants left out.

    Tactic trace: 22 steps

    Open to load the checked before-and-after goal states.

    lemma sum_degree_neighborFinset_eq_card (hG : G.CliqueFree 3) (P : Fin n) :
        ∑ Q ∈ G.neighborFinset P, G.degree Q
          = #(G.edgeFinset.filter fun e => ∃ v ∈ e, G.Adj P v) := by
    …

    Mentions: P

  3. lemma Usa1995P5.card_far_add_sum_degree The edges of G split into those with no endpoint adjacent to P and those with a (unique) endpoint adjacent to P, counted in sum_degree_neighborFinset_eq_card line 86 source

    Source documentation

    The edges of G split into those with no endpoint adjacent to P and those with a (unique) endpoint adjacent to P, counted in sum_degree_neighborFinset_eq_card.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, SimpleGraph, Fin, DecidableRel, SimpleGraph.Adj, SimpleGraph.CliqueFree, OfNat.ofNat, Eq, HAdd.hAdd, Finset.card, Sym2, Finset.filter, Membership.mem, Not, SimpleGraph.edgeFinset, Finset.sum, SimpleGraph.neighborFinset, Set, SimpleGraph.neighborSet, SimpleGraph.degree

    Proof uses: Finset, Exists, And, Finset.filter_congr, of_eq_true, Iff, Eq.trans, True, congrArg, forall_congr, iff_self, Finset.card_filter_add_card_filter_not, Eq.mpr, id, Usa1995P5.sum_degree_neighborFinset_eq_card, add_comm

    42 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

    Open to load the checked before-and-after goal states.

    lemma card_far_add_sum_degree (hG : G.CliqueFree 3) (P : Fin n) :
        #(G.edgeFinset.filter fun e => ∀ v ∈ e, ¬G.Adj P v)
          + ∑ Q ∈ G.neighborFinset P, G.degree Q = #G.edgeFinset := by
    …

    Mentions: P

  4. lemma Usa1995P5.sum_sum_degree_neighborFinset Summing ∑ Q ∈ N(P), deg Q over all vertices P counts deg Q once for each neighbor of Q, giving the sum of the squares of the degrees line 99 source

    Source documentation

    Summing ∑ Q ∈ N(P), deg Q over all vertices P counts deg Q once for each neighbor of Q, giving the sum of the squares of the degrees.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, SimpleGraph, Fin, DecidableRel, SimpleGraph.Adj, Eq, Finset.sum, Finset.univ, SimpleGraph.neighborFinset, Membership.mem, Set, SimpleGraph.neighborSet, SimpleGraph.degree, HPow.hPow, OfNat.ofNat

    Proof uses: ite, Finset, Finset.filter, Finset.ext, Eq.mpr, Iff, id, congr, congrArg, Eq.trans, And, True, congrFun', true_and, SimpleGraph.adj_comm, Eq.symm, Finset.sum_filter, HSMul.hSMul, Finset.card, Finset.sum_const and 10 more

    47 instances, coercions and auxiliary constants left out.

    Tactic trace: 10 steps

    Open to load the checked before-and-after goal states.

    lemma sum_sum_degree_neighborFinset :
        ∑ P : Fin n, ∑ Q ∈ G.neighborFinset P, G.degree Q
          = ∑ Q : Fin n, (G.degree Q) ^ 2 := by
    …

    Mentions: P

  5. problem Usa1995P5.usa1995_p5 line 117 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, NeZero, SimpleGraph, Fin, DecidableRel, SimpleGraph.Adj, SimpleGraph.CliqueFree, OfNat.ofNat, Exists, LE.le, Real, Finset.card, Sym2, Finset.filter, Membership.mem, Not, SimpleGraph.edgeFinset, HMul.hMul, HSub.hSub, HDiv.hDiv and 1 more

    Proof uses: Ne, Iff.mpr, Nat.cast_ne_zero, NeZero.ne, LT.lt, Nat.cast_pos, NeZero.pos, Eq.mpr, id, Eq, congrArg, rfl, Finset.sum, Finset.univ, SimpleGraph.neighborFinset, Set, SimpleGraph.neighborSet, SimpleGraph.degree, cast, Eq.symm and 152 more

    203 instances, coercions and auxiliary constants left out.

    Tactic trace: 33 steps

    Open to load the checked before-and-after goal states.