Compfiles/Usa1995P5.lean
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
- lemma
Usa1995P5.not_adj_and_adj_of_mem_edgeFinsetIn a triangle-free graph, no edge can have two distinct endpoints that are both adjacent toP: together withPthey would form a triangle line 36 sourceSource documentation
In a triangle-free graph, no edge can have two distinct endpoints that are both adjacent to
P: together withPthey 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,FalseProof 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,Andand 2 more20 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
- lemma
Usa1995P5.sum_degree_neighborFinset_eq_cardDouble counting: the sum of the degrees of the neighbors ofPequals the number of edges ofGhaving an endpoint adjacent toPline 56 sourceSource documentation
Double counting: the sum of the degrees of the neighbors of
Pequals the number of edges ofGhaving an endpoint adjacent toP. Indeed, every edge incident to a neighborQofPhasQas its unique endpoint adjacent toP, 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.edgeFinsetProof 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.mpand 17 more39 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
- lemma
Usa1995P5.card_far_add_sum_degreeThe edges ofGsplit into those with no endpoint adjacent toPand those with a (unique) endpoint adjacent toP, counted insum_degree_neighborFinset_eq_cardline 86 sourceSource documentation
The edges of
Gsplit into those with no endpoint adjacent toPand those with a (unique) endpoint adjacent toP, counted insum_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.degreeProof 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_comm42 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
- lemma
Usa1995P5.sum_sum_degree_neighborFinsetSumming∑ Q ∈ N(P), deg Qover all verticesPcountsdeg Qonce for each neighbor ofQ, giving the sum of the squares of the degrees line 99 sourceSource documentation
Summing
∑ Q ∈ N(P), deg Qover all verticesPcountsdeg Qonce for each neighbor ofQ, 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.ofNatProof 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_constand 10 more47 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
- problem
Usa1995P5.usa1995_p5line 117 sourcestandard 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.hDivand 1 moreProof 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.symmand 152 more203 instances, coercions and auxiliary constants left out.
Tactic trace: 33 steps
Open to load the checked before-and-after goal states.