ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
File: Mathlib/Combinatorics/SimpleGraph/Init.lean

full_name: initFn._@.Mathlib.Combinatorics.SimpleGraph.Init._hyg.5
code: declare_aesop_rule_sets [SimpleGraph]
goal: IO Unit
File: Mathlib/Combinatorics/SimpleGraph/Regularity/Energy.lean

full_name: Finpartition.energy
code: /-- The energy of a partition, also known as index. Auxiliary quantity for Szemerédi's regularity
lemma.  -/
def energy : ℚ 
goal: ℚ

full_name: Finpartition.energy_nonneg
code: theorem energy_nonneg : 0 ≤ P.energy G 
goal: 0 ≤ P.energy G

full_name: Finpartition.energy_le_one
code: theorem energy_le_one : P.energy G ≤ 1 
goal: P.energy G ≤ 1

full_name: Finpartition.coe_energy
code: @[simp, norm_cast]
theorem coe_energy {𝕜 : Type*} [LinearOrderedField 𝕜] : (P.energy G : 𝕜) =
    (∑ uv ∈ P.parts.offDiag, (G.edgeDensity uv.1 uv.2 : 𝕜) ^ 2) / (P.parts.card : 𝕜) ^ 2 
goal: ↑(P.energy G) = (∑ uv ∈ P.parts.offDiag, ↑(G.edgeDensity uv.1 uv.2) ^ 2) / ↑P.parts.card ^ 2
File: Mathlib/Combinatorics/SimpleGraph/Regularity/Lemma.lean

full_name: szemeredi_regularity
code: /-- Effective **Szemerédi Regularity Lemma**: For any sufficiently large graph, there is an
`ε`-uniform equipartition of bounded size (where the bound does not depend on the graph). -/
theorem szemeredi_regularity (hε : 0 < ε) (hl : l ≤ card α) :
    ∃ P : Finpartition univ,
      P.IsEquipartition ∧ l ≤ P.parts.card ∧ P.parts.card ≤ bound ε l ∧ P.IsUniform G ε 
goal: ∃ P, P.IsEquipartition ∧ l ≤ P.parts.card ∧ P.parts.card ≤ SzemerediRegularity.bound ε l ∧ P.IsUniform G ε
File: Mathlib/Combinatorics/SimpleGraph/Hasse.lean

full_name: SimpleGraph.hasse
code: /-- The Hasse diagram of an order as a simple graph. The graph of the covering relation. -/
def hasse : SimpleGraph α 
goal: SimpleGraph α

full_name: SimpleGraph.hasse_adj
code: @[simp]
theorem hasse_adj : (hasse α).Adj a b ↔ a ⋖ b ∨ b ⋖ a 
goal: (SimpleGraph.hasse α).Adj a b ↔ a ⋖ b ∨ b ⋖ a

full_name: SimpleGraph.hasseDualIso
code: /-- `αᵒᵈ` and `α` have the same Hasse diagram. -/
def hasseDualIso : hasse αᵒᵈ ≃g hasse α 
goal: SimpleGraph.hasse αᵒᵈ ≃g SimpleGraph.hasse α

full_name: SimpleGraph.hasseDualIso_apply
code: @[simp]
theorem hasseDualIso_apply (a : αᵒᵈ) : hasseDualIso a = ofDual a 
goal: SimpleGraph.hasseDualIso a = OrderDual.ofDual a

full_name: SimpleGraph.hasseDualIso_symm_apply
code: @[simp]
theorem hasseDualIso_symm_apply (a : α) : hasseDualIso.symm a = toDual a 
goal: SimpleGraph.hasseDualIso.symm a = OrderDual.toDual a

full_name: SimpleGraph.hasse_prod
code: @[simp]
theorem hasse_prod : hasse (α × β) = hasse α □ hasse β 
goal: SimpleGraph.hasse (α × β) = SimpleGraph.hasse α □ SimpleGraph.hasse β

full_name: SimpleGraph.hasse_preconnected_of_succ
code: theorem hasse_preconnected_of_succ [SuccOrder α] [IsSuccArchimedean α] : (hasse α).Preconnected 
goal: (SimpleGraph.hasse α).Preconnected

full_name: SimpleGraph.hasse_preconnected_of_pred
code: theorem hasse_preconnected_of_pred [PredOrder α] [IsPredArchimedean α] : (hasse α).Preconnected 
goal: (SimpleGraph.hasse α).Preconnected

full_name: SimpleGraph.pathGraph
code: /-- The path graph on `n` vertices. -/
def pathGraph (n : ℕ) : SimpleGraph (Fin n) 
goal: SimpleGraph (Fin n)

full_name: SimpleGraph.pathGraph_adj
code: theorem pathGraph_adj {n : ℕ} {u v : Fin n} :
    (pathGraph n).Adj u v ↔ u.val + 1 = v.val ∨ v.val + 1 = u.val 
goal: (SimpleGraph.pathGraph n).Adj u v ↔ ↑u + 1 = ↑v ∨ ↑v + 1 = ↑u

full_name: SimpleGraph.pathGraph_preconnected
code: theorem pathGraph_preconnected (n : ℕ) : (pathGraph n).Preconnected 
goal: (SimpleGraph.pathGraph n).Preconnected

full_name: SimpleGraph.pathGraph_connected
code: theorem pathGraph_connected (n : ℕ) : (pathGraph (n + 1)).Connected 
goal: (SimpleGraph.pathGraph (n + 1)).Connected

full_name: SimpleGraph.pathGraph_two_eq_top
code: theorem pathGraph_two_eq_top : pathGraph 2 = ⊤ 
goal: SimpleGraph.pathGraph 2 = ⊤
File: Mathlib/Combinatorics/SimpleGraph/ConcreteColorings.lean

full_name: SimpleGraph.pathGraph.bicoloring
code: /-- Bicoloring of a path graph -/
def pathGraph.bicoloring (n : ℕ) :
    Coloring (pathGraph n) Bool 
goal: (SimpleGraph.pathGraph n).Coloring Bool

full_name: SimpleGraph.pathGraph_two_embedding
code: /-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n 
goal: SimpleGraph.pathGraph 2 ↪g SimpleGraph.pathGraph n

full_name: SimpleGraph.chromaticNumber_pathGraph
code: theorem chromaticNumber_pathGraph (n : ℕ) (h : 2 ≤ n) :
    (pathGraph n).chromaticNumber = 2 
goal: (SimpleGraph.pathGraph n).chromaticNumber = 2

full_name: SimpleGraph.Coloring.even_length_iff_congr
code: theorem Coloring.even_length_iff_congr {α} {G : SimpleGraph α}
    (c : G.Coloring Bool) {u v : α} (p : G.Walk u v) :
    Even p.length ↔ (c u ↔ c v) 
goal: Even p.length ↔ (c u = true ↔ c v = true)

full_name: SimpleGraph.Coloring.odd_length_iff_not_congr
code: theorem Coloring.odd_length_iff_not_congr {α} {G : SimpleGraph α}
    (c : G.Coloring Bool) {u v : α} (p : G.Walk u v) :
    Odd p.length ↔ (¬c u ↔ c v) 
goal: Odd p.length ↔ (¬c u = true ↔ c v = true)

full_name: SimpleGraph.Walk.three_le_chromaticNumber_of_odd_loop
code: theorem Walk.three_le_chromaticNumber_of_odd_loop {α} {G : SimpleGraph α} {u : α} (p : G.Walk u u)
    (hOdd : Odd p.length) : 3 ≤ G.chromaticNumber 
goal: 3 ≤ G.chromaticNumber
File: Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean

full_name: SimpleGraph.dart_fst_fiber
code: theorem dart_fst_fiber [DecidableEq V] (v : V) :
    (univ.filter fun d : G.Dart => d.fst = v) = univ.image (G.dartOfNeighborSet v) 
goal: Finset.filter (fun d => d.toProd.1 = v) Finset.univ = Finset.image (G.dartOfNeighborSet v) Finset.univ

full_name: SimpleGraph.dart_fst_fiber_card_eq_degree
code: theorem dart_fst_fiber_card_eq_degree [DecidableEq V] (v : V) :
    (univ.filter fun d : G.Dart => d.fst = v).card = G.degree v 
goal: (Finset.filter (fun d => d.toProd.1 = v) Finset.univ).card = G.degree v

full_name: SimpleGraph.dart_card_eq_sum_degrees
code: theorem dart_card_eq_sum_degrees : Fintype.card G.Dart = ∑ v, G.degree v 
goal: Fintype.card G.Dart = ∑ v : V, G.degree v

full_name: SimpleGraph.Dart.edge_fiber
code: theorem Dart.edge_fiber [DecidableEq V] (d : G.Dart) :
    (univ.filter fun d' : G.Dart => d'.edge = d.edge) = {d, d.symm} 
goal: Finset.filter (fun d' => d'.edge = d.edge) Finset.univ = {d, d.symm}

full_name: SimpleGraph.dart_edge_fiber_card
code: theorem dart_edge_fiber_card [DecidableEq V] (e : Sym2 V) (h : e ∈ G.edgeSet) :
    (univ.filter fun d : G.Dart => d.edge = e).card = 2 
goal: (Finset.filter (fun d => d.edge = e) Finset.univ).card = 2

full_name: SimpleGraph.dart_card_eq_twice_card_edges
code: theorem dart_card_eq_twice_card_edges : Fintype.card G.Dart = 2 * G.edgeFinset.card 
goal: Fintype.card G.Dart = 2 * G.edgeFinset.card

full_name: SimpleGraph.sum_degrees_eq_twice_card_edges
code: /-- The degree-sum formula.  This is also known as the handshaking lemma, which might
more specifically refer to `SimpleGraph.even_card_odd_degree_vertices`. -/
theorem sum_degrees_eq_twice_card_edges : ∑ v, G.degree v = 2 * G.edgeFinset.card 
goal: ∑ v : V, G.degree v = 2 * G.edgeFinset.card

full_name: SimpleGraph.two_mul_card_edgeFinset
code: lemma two_mul_card_edgeFinset :
    2 * G.edgeFinset.card = (univ.filter fun (x, y) ↦ G.Adj x y).card 
goal: 2 * G.edgeFinset.card =
  (Finset.filter
      (fun x =>
        match x with
        | (x, y) => G.Adj x y)
      Finset.univ).card

full_name: SimpleGraph.even_card_odd_degree_vertices
code: /-- The handshaking lemma.  See also `SimpleGraph.sum_degrees_eq_twice_card_edges`. -/
theorem even_card_odd_degree_vertices [Fintype V] [DecidableRel G.Adj] :
    Even (univ.filter fun v => Odd (G.degree v)).card 
goal: Even (Finset.filter (fun v => Odd (G.degree v)) Finset.univ).card

full_name: SimpleGraph.odd_card_odd_degree_vertices_ne
code: theorem odd_card_odd_degree_vertices_ne [Fintype V] [DecidableEq V] [DecidableRel G.Adj] (v : V)
    (h : Odd (G.degree v)) : Odd (univ.filter fun w => w ≠ v ∧ Odd (G.degree w)).card 
goal: Odd (Finset.filter (fun w => w ≠ v ∧ Odd (G.degree w)) Finset.univ).card

full_name: SimpleGraph.exists_ne_odd_degree_of_exists_odd_degree
code: theorem exists_ne_odd_degree_of_exists_odd_degree [Fintype V] [DecidableRel G.Adj] (v : V)
    (h : Odd (G.degree v)) : ∃ w : V, w ≠ v ∧ Odd (G.degree w) 
goal: ∃ w, w ≠ v ∧ Odd (G.degree w)
File: Mathlib/Combinatorics/SimpleGraph/Ends/Properties.lean

full_name: SimpleGraph.instIsEmptyElemForallObjOppositeFinsetComponentComplFunctorEndOfFinite
code: instance [Finite V] : IsEmpty G.end 
goal: IsEmpty ↑G.end

full_name: SimpleGraph.end_componentCompl_infinite
code: /-- The `componentCompl`s chosen by an end are all infinite. -/
lemma end_componentCompl_infinite (e : G.end) (K : (Finset V)ᵒᵖ) :
    ((e : (j : (Finset V)ᵒᵖ) → G.componentComplFunctor.obj j) K).supp.Infinite 
goal: (SimpleGraph.ComponentCompl.supp (↑e K)).Infinite

full_name: SimpleGraph.compononentComplFunctor_nonempty_of_infinite
code: instance compononentComplFunctor_nonempty_of_infinite [Infinite V] (K : (Finset V)ᵒᵖ) :
    Nonempty (G.componentComplFunctor.obj K) 
goal: Nonempty (G.componentComplFunctor.obj K)

full_name: SimpleGraph.componentComplFunctor_finite
code: instance componentComplFunctor_finite [LocallyFinite G] [Fact G.Preconnected]
    (K : (Finset V)ᵒᵖ) : Finite (G.componentComplFunctor.obj K) 
goal: Finite (G.componentComplFunctor.obj K)

full_name: SimpleGraph.nonempty_ends_of_infinite
code: /-- A locally finite preconnected infinite graph has at least one end. -/
lemma nonempty_ends_of_infinite [LocallyFinite G] [Fact G.Preconnected] [Infinite V] :
    G.end.Nonempty 
goal: G.end.Nonempty
File: Mathlib/Combinatorics/SimpleGraph/Acyclic.lean

full_name: SimpleGraph.IsAcyclic
code: /-- A graph is *acyclic* (or a *forest*) if it has no cycles. -/
def IsAcyclic : Prop 
goal: Prop

full_name: SimpleGraph.isTree_iff
code: /-- A *tree* is a connected acyclic graph. -/
@[mk_iff]
structure IsTree : Prop where
  /-- Graph is connected. -/
  protected isConnected : G.Connected
  /-- Graph is acyclic. -/
  protected IsAcyclic : G.IsAcyclic
goal: G.IsTree ↔ G.Connected ∧ G.IsAcyclic

full_name: SimpleGraph.IsTree.isConnected
code: /-- A *tree* is a connected acyclic graph. -/
@[mk_iff]
structure IsTree : Prop where
  /-- Graph is connected. -/
  protected isConnected : G.Connected
  /-- Graph is acyclic. -/
  protected IsAcyclic : G.IsAcyclic
goal: G.Connected

full_name: SimpleGraph.IsTree.IsAcyclic
code: /-- A *tree* is a connected acyclic graph. -/
@[mk_iff]
structure IsTree : Prop where
  /-- Graph is connected. -/
  protected isConnected : G.Connected
  /-- Graph is acyclic. -/
  protected IsAcyclic : G.IsAcyclic
goal: G.IsAcyclic

full_name: SimpleGraph.IsTree
code: /-- A *tree* is a connected acyclic graph. -/
@[mk_iff]
structure IsTree : Prop where
  /-- Graph is connected. -/
  protected isConnected : G.Connected
  /-- Graph is acyclic. -/
  protected IsAcyclic : G.IsAcyclic
goal: Prop

full_name: SimpleGraph.isAcyclic_bot
code: @[simp] lemma isAcyclic_bot : IsAcyclic (⊥ : SimpleGraph V) 
goal: ⊥.IsAcyclic

full_name: SimpleGraph.isAcyclic_iff_forall_adj_isBridge
code: theorem isAcyclic_iff_forall_adj_isBridge :
    G.IsAcyclic ↔ ∀ ⦃v w : V⦄, G.Adj v w → G.IsBridge s(v, w) 
goal: G.IsAcyclic ↔ ∀ ⦃v w : V⦄, G.Adj v w → G.IsBridge s(v, w)

full_name: SimpleGraph.isAcyclic_iff_forall_edge_isBridge
code: theorem isAcyclic_iff_forall_edge_isBridge :
    G.IsAcyclic ↔ ∀ ⦃e⦄, e ∈ (G.edgeSet) → G.IsBridge e 
goal: G.IsAcyclic ↔ ∀ ⦃e : Sym2 V⦄, e ∈ G.edgeSet → G.IsBridge e

full_name: SimpleGraph.IsAcyclic.path_unique
code: theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q 
goal: p = q

full_name: SimpleGraph.isAcyclic_of_path_unique
code: theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic 
goal: G.IsAcyclic

full_name: SimpleGraph.isAcyclic_iff_path_unique
code: theorem isAcyclic_iff_path_unique : G.IsAcyclic ↔ ∀ ⦃v w : V⦄ (p q : G.Path v w), p = q 
goal: G.IsAcyclic ↔ ∀ ⦃v w : V⦄ (p q : G.Path v w), p = q

full_name: SimpleGraph.isTree_iff_existsUnique_path
code: theorem isTree_iff_existsUnique_path :
    G.IsTree ↔ Nonempty V ∧ ∀ v w : V, ∃! p : G.Walk v w, p.IsPath 
goal: G.IsTree ↔ Nonempty V ∧ ∀ (v w : V), ∃! p, p.IsPath

full_name: SimpleGraph.IsTree.existsUnique_path
code: lemma IsTree.existsUnique_path (hG : G.IsTree) : ∀ v w, ∃! p : G.Walk v w, p.IsPath 
goal: ∃! p, p.IsPath

full_name: SimpleGraph.IsTree.card_edgeFinset
code: lemma IsTree.card_edgeFinset [Fintype V] [Fintype G.edgeSet] (hG : G.IsTree) :
    Finset.card G.edgeFinset + 1 = Fintype.card V 
goal: G.edgeFinset.card + 1 = Fintype.card V
File: Mathlib/Combinatorics/SimpleGraph/Girth.lean

full_name: SimpleGraph.egirth
code: /--
The extended girth of a simple graph is the length of its smallest cycle, or `∞` if the graph is
acyclic.
-/
noncomputable def egirth (G : SimpleGraph α) : ℕ∞ 
goal: ℕ∞

full_name: SimpleGraph.le_egirth
code: @[simp]
lemma le_egirth {n : ℕ∞} : n ≤ G.egirth ↔ ∀ a (w : G.Walk a a), w.IsCycle → n ≤ w.length 
goal: n ≤ G.egirth ↔ ∀ (a : α) (w : G.Walk a a), w.IsCycle → n ≤ ↑w.length

full_name: SimpleGraph.egirth_eq_top
code: @[simp]
lemma egirth_eq_top : G.egirth = ⊤ ↔ G.IsAcyclic 
goal: G.egirth = ⊤ ↔ G.IsAcyclic

full_name: SimpleGraph.egirth_anti
code: lemma egirth_anti : Antitone (egirth : SimpleGraph α → ℕ∞) 
goal: Antitone SimpleGraph.egirth

full_name: SimpleGraph.exists_egirth_eq_length
code: lemma exists_egirth_eq_length :
    (∃ (a : α) (w : G.Walk a a), w.IsCycle ∧ G.egirth = w.length) ↔ ¬ G.IsAcyclic 
goal: (∃ a w, w.IsCycle ∧ G.egirth = ↑w.length) ↔ ¬G.IsAcyclic

full_name: SimpleGraph.three_le_egirth
code: lemma three_le_egirth : 3 ≤ G.egirth 
goal: 3 ≤ G.egirth

full_name: SimpleGraph.egirth_bot
code: @[simp] lemma egirth_bot : egirth (⊥ : SimpleGraph α) = ⊤ 
goal: ⊥.egirth = ⊤

full_name: SimpleGraph.girth
code: /--
The girth of a simple graph is the length of its smallest cycle, or junk value `0` if the graph is
acyclic.
-/
noncomputable def girth (G : SimpleGraph α) : ℕ 
goal: ℕ

full_name: SimpleGraph.three_le_girth
code: lemma three_le_girth (hG : ¬ G.IsAcyclic) : 3 ≤ G.girth 
goal: 3 ≤ G.girth

full_name: SimpleGraph.girth_eq_zero
code: lemma girth_eq_zero : G.girth = 0 ↔ G.IsAcyclic 
goal: G.girth = 0 ↔ G.IsAcyclic

full_name: SimpleGraph.girth_anti
code: lemma girth_anti {G' : SimpleGraph α} (hab : G ≤ G') (h : ¬ G.IsAcyclic) : G'.girth ≤ G.girth 
goal: G'.girth ≤ G.girth

full_name: SimpleGraph.exists_girth_eq_length
code: lemma exists_girth_eq_length :
    (∃ (a : α) (w : G.Walk a a), w.IsCycle ∧ G.girth = w.length) ↔ ¬ G.IsAcyclic 
goal: (∃ a w, w.IsCycle ∧ G.girth = w.length) ↔ ¬G.IsAcyclic

full_name: SimpleGraph.girth_bot
code: @[simp] lemma girth_bot : girth (⊥ : SimpleGraph α) = 0 
goal: ⊥.girth = 0
File: Mathlib/Tactic/NthRewrite.lean

full_name: Mathlib.Tactic.nthRewriteSeq
code: /-- `nth_rewrite` is a variant of `rewrite` that only changes the `n`ᵗʰ _occurrence_ of the
expression to be rewritten. `nth_rewrite n [eq₁, eq₂,..., eqₘ]` will rewrite the `n`ᵗʰ _occurrence_
of each of the `m` equalities `eqᵢ`in that order. Occurrences are counted beginning with `1` in
order of precedence.

For example,
```lean
example (h : a = 1) : a + a + a + a + a = 5 := by
  nth_rewrite 2 [h]
/-
a: ℕ
h: a = 1
⊢ a + 1 + a + a + a = 5
-/
```
Notice that the second occurrence of `a` from the left has been rewritten by `nth_rewrite`.

To understand the importance of order of precedence, consider the example below
```lean
example (a b c : Nat) : (a + b) + c = (b + a) + c := by
  nth_rewrite 2 [Nat.add_comm] -- ⊢ (b + a) + c = (b + a) + c
```
Here, although the occurrence parameter is `2`, `(a + b)` is rewritten to `(b + a)`. This happens
because in order of precedence, the first occurrence of `_ + _` is the one that adds `a + b` to `c`.
The occurrence in `a + b` counts as the second occurrence.

If a term `t` is introduced by rewriting with `eqᵢ`, then this instance of `t` will be counted as an
_occurrence_ of `t` for all subsequent rewrites of `t` with `eqⱼ` for `j > i`. This behaviour is
illustrated by the example below
```lean
example (h : a = a + b) : a + a + a + a + a = 0 := by
  nth_rewrite 3 [h, h]
/-
a b: ℕ
h: a = a + b
⊢ a + a + (a + b + b) + a + a = 0
-/
```
Here, the first `nth_rewrite` with `h` introduces an additional occurrence of `a` in the goal.
That is, the goal state after the first rewrite looks like below
```lean
/-
a b: ℕ
h: a = a + b
⊢ a + a + (a + b) + a + a = 0
-/
```
This new instance of `a` also turns out to be the third _occurrence_ of `a`.  Therefore,
the next `nth_rewrite` with `h` rewrites this `a`.
-/
syntax (name := nthRewriteSeq) "nth_rewrite" (config)? ppSpace num rwRuleSeq (location)? : tactic
goal: Lean.ParserDescr

full_name: Mathlib.Tactic.evalNthRewriteSeq
code: @[inherit_doc nthRewriteSeq, tactic nthRewriteSeq] def evalNthRewriteSeq : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Mathlib.Tactic.nthRwSeq
code: macro (name := nthRwSeq) "nth_rw" c:(config)? ppSpace n:num s:rwRuleSeq l:(location)? : tactic =>
  -- Note: This is a direct copy of `nth_rw` from core.
  match s with
  | `(rwRuleSeq| [$rs,*]%$rbrak) =>
    -- We show the `rfl` state on `]`
    `(tactic| (nth_rewrite $(c)? $n [$rs,*] $(l)?; with_annotate_state $rbrak
      (try (with_reducible rfl))))
  | _ => Macro.throwUnsupported
goal: Lean.ParserDescr

full_name: Mathlib.Tactic._aux_Mathlib_Tactic_NthRewrite___macroRules_Mathlib_Tactic_nthRwSeq_1
code: macro (name := nthRwSeq) "nth_rw" c:(config)? ppSpace n:num s:rwRuleSeq l:(location)? : tactic =>
  -- Note: This is a direct copy of `nth_rw` from core.
  match s with
  | `(rwRuleSeq| [$rs,*]%$rbrak) =>
    -- We show the `rfl` state on `]`
    `(tactic| (nth_rewrite $(c)? $n [$rs,*] $(l)?; with_annotate_state $rbrak
      (try (with_reducible rfl))))
  | _ => Macro.throwUnsupported
goal: Lean.Macro
File: Mathlib/Combinatorics/Derangements/Exponential.lean

full_name: numDerangements_tendsto_inv_e
code: theorem numDerangements_tendsto_inv_e :
    Tendsto (fun n => (numDerangements n : ℝ) / n.factorial) atTop (𝓝 (Real.exp (-1))) 
goal: Filter.Tendsto (fun n => ↑(numDerangements n) / ↑n.factorial) Filter.atTop (𝓝 (Real.exp (-1)))
File: Mathlib/Combinatorics/Derangements/Finite.lean

full_name: instDecidablePredPermDerangements
code: instance : DecidablePred (derangements α) 
goal: DecidablePred (derangements α)

full_name: instFintypeElemPermDerangements
code: instance : Fintype (derangements α) 
goal: Fintype ↑(derangements α)

full_name: card_derangements_invariant
code: theorem card_derangements_invariant {α β : Type*} [Fintype α] [DecidableEq α] [Fintype β]
    [DecidableEq β] (h : card α = card β) : card (derangements α) = card (derangements β) 
goal: Fintype.card ↑(derangements α) = Fintype.card ↑(derangements β)

full_name: card_derangements_fin_add_two
code: theorem card_derangements_fin_add_two (n : ℕ) :
    card (derangements (Fin (n + 2))) =
      (n + 1) * card (derangements (Fin n)) + (n + 1) * card (derangements (Fin (n + 1))) 
goal: Fintype.card ↑(derangements (Fin (n + 2))) =
  (n + 1) * Fintype.card ↑(derangements (Fin n)) + (n + 1) * Fintype.card ↑(derangements (Fin (n + 1)))

full_name: numDerangements
code: /-- The number of derangements of an `n`-element set. -/
def numDerangements : ℕ → ℕ
  
goal: ℕ → ℕ

full_name: numDerangements_zero
code: @[simp]
theorem numDerangements_zero : numDerangements 0 = 1 
goal: numDerangements 0 = 1

full_name: numDerangements_one
code: @[simp]
theorem numDerangements_one : numDerangements 1 = 0 
goal: numDerangements 1 = 0

full_name: numDerangements_add_two
code: theorem numDerangements_add_two (n : ℕ) :
    numDerangements (n + 2) = (n + 1) * (numDerangements n + numDerangements (n + 1)) 
goal: numDerangements (n + 2) = (n + 1) * (numDerangements n + numDerangements (n + 1))

full_name: numDerangements_succ
code: theorem numDerangements_succ (n : ℕ) :
    (numDerangements (n + 1) : ℤ) = (n + 1) * (numDerangements n : ℤ) - (-1) ^ n 
goal: ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n

full_name: card_derangements_fin_eq_numDerangements
code: theorem card_derangements_fin_eq_numDerangements {n : ℕ} :
    card (derangements (Fin n)) = numDerangements n 
goal: Fintype.card ↑(derangements (Fin n)) = numDerangements n

full_name: card_derangements_eq_numDerangements
code: theorem card_derangements_eq_numDerangements (α : Type*) [Fintype α] [DecidableEq α] :
    card (derangements α) = numDerangements (card α) 
goal: Fintype.card ↑(derangements α) = numDerangements (Fintype.card α)

full_name: numDerangements_sum
code: theorem numDerangements_sum (n : ℕ) :
    (numDerangements n : ℤ) =
      ∑ k ∈ Finset.range (n + 1), (-1 : ℤ) ^ k * Nat.ascFactorial (k + 1) (n - k) 
goal: ↑(numDerangements n) = ∑ k ∈ Finset.range (n + 1), (-1) ^ k * ↑((k + 1).ascFactorial (n - k))
File: Mathlib/Combinatorics/Additive/RuzsaCovering.lean

full_name: Finset.exists_subset_add_sub
code: /-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t 
goal: ∃ u, u.card * t.card ≤ (s + t).card ∧ s ⊆ u + t - t

full_name: Finset.exists_subset_mul_div
code: /-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t 
goal: ∃ u, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t

full_name: Set.exists_subset_add_sub
code: /-- **Ruzsa's covering lemma** for sets. See also `Finset.exists_subset_mul_div`. -/
@[to_additive "**Ruzsa's covering lemma**. Version for sets. For finsets,
see `Finset.exists_subset_add_sub`."]
lemma exists_subset_mul_div (hs : s.Finite) (ht' : t.Finite) (ht : t.Nonempty) :
    ∃ u : Set α, Nat.card u * Nat.card t ≤ Nat.card (s * t) ∧ s ⊆ u * t / t ∧ u.Finite 
goal: ∃ u, Nat.card ↑u * Nat.card ↑t ≤ Nat.card ↑(s + t) ∧ s ⊆ u + t - t ∧ u.Finite

full_name: Set.exists_subset_mul_div
code: /-- **Ruzsa's covering lemma** for sets. See also `Finset.exists_subset_mul_div`. -/
@[to_additive "**Ruzsa's covering lemma**. Version for sets. For finsets,
see `Finset.exists_subset_add_sub`."]
lemma exists_subset_mul_div (hs : s.Finite) (ht' : t.Finite) (ht : t.Nonempty) :
    ∃ u : Set α, Nat.card u * Nat.card t ≤ Nat.card (s * t) ∧ s ⊆ u * t / t ∧ u.Finite 
goal: ∃ u, Nat.card ↑u * Nat.card ↑t ≤ Nat.card ↑(s * t) ∧ s ⊆ u * t / t ∧ u.Finite
File: Mathlib/Tactic/Generalize.lean

full_name: «tacticGeneralize'_:_=_»
code: /-- Backwards compatibility shim for `generalize`. -/
elab "generalize'" h:ident " : " t:term:51 " = " x:ident : tactic => do
  withMainContext do
      let mut xIdents := #[]
      let mut hIdents := #[]
      let mut args := #[]
      hIdents := hIdents.push h
      let expr ← elabTerm t none
      xIdents := xIdents.push x
      args := args.push { hName? := h.getId, expr, xName? := x.getId : GeneralizeArg }
      let hyps := #[]
      let mvarId ← getMainGoal
      mvarId.withContext do
        let (_, newVars, mvarId) ← mvarId.generalizeHyp args hyps (transparency := default)
        mvarId.withContext do
          for v in newVars, id in xIdents ++ hIdents do
            Term.addLocalVarInfo id (.fvar v)
          replaceMainGoal [mvarId]
goal: Lean.ParserDescr

full_name: «_aux_Mathlib_Tactic_Generalize___elabRules_tacticGeneralize'_:_=__1»
code: /-- Backwards compatibility shim for `generalize`. -/
elab "generalize'" h:ident " : " t:term:51 " = " x:ident : tactic => do
  withMainContext do
      let mut xIdents := #[]
      let mut hIdents := #[]
      let mut args := #[]
      hIdents := hIdents.push h
      let expr ← elabTerm t none
      xIdents := xIdents.push x
      args := args.push { hName? := h.getId, expr, xName? := x.getId : GeneralizeArg }
      let hyps := #[]
      let mvarId ← getMainGoal
      mvarId.withContext do
        let (_, newVars, mvarId) ← mvarId.generalizeHyp args hyps (transparency := default)
        mvarId.withContext do
          for v in newVars, id in xIdents ++ hIdents do
            Term.addLocalVarInfo id (.fvar v)
          replaceMainGoal [mvarId]
goal: Lean.Elab.Tactic.Tactic