Segment' eq segment
Nat.segment'_eq_segment
Plain-language statement
For a strictly monotonic function f : ℕ → ℕ, segment' f and segment f are actually equal.
Exact Lean statement
theorem segment'_eq_segment (hm : StrictMono f) :
segment' f = segment fFormal artifact
Lean source
theorem segment'_eq_segment (hm : StrictMono f) : segment' f = segment f := by classical ext k; unfold segment' rcases (show k < f 0 ∨ k ≥ f 0 by omega) with h_k | h_k · grind unfold segment; congr 1 simp only [count_eq_card_filter_range] suffices h : ∃ g, BijOn g ({x ∈ Finset.range (k - f 0 + 1) | x ∈ range fun x => f x - f 0}) ({x ∈ Finset.range (k + 1) | x ∈ range f}) by grind [BijOn.finsetCard_eq, Finset.coe_filter] refine ⟨fun n ↦ n + f 0, ?_, ?_, ?_⟩ · intro n; simp only [mem_range, Finset.mem_range] rintro ⟨h_n, i, rfl⟩ have := StrictMono.monotone hm <| zero_le i refine ⟨?_, i, ?_⟩ <;> omega · grind [injOn_of_injective, Injective] · intro n; simp only [mem_range, Finset.mem_range, mem_ofPred_eq, mem_image] rintro ⟨h_n, i, rfl⟩ have := StrictMono.monotone hm <| zero_le i grind- Project
- Lean Computer Science Library
- License
- Apache-2.0
- Commit
- f36649cff2c9
- Source
- Cslib/Foundations/Data/Nat/Segment.lean:212-233
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Unique minimal
Cslib.Automata.DA.FinAcc.unique_minimal
Plain-language statement
The minimal DFA M accepting the language l is unique up to unique isomorphism.
Source project: Lean Computer Science Library
Person-level attribution pending.
Buchi Family cover
Cslib.Automata.NA.Buchi.buchiFamily_cover
Project documentation
na.buchiFamily is a cover if na has only finitely many states. This theorem uses the Ramsey theorem for infinite graphs and does not depend on any details of na.BuchiCongruence other than that it is of finite index.
Source project: Lean Computer Science Library
Person-level attribution pending.
Buchi Family saturation
Cslib.Automata.NA.Buchi.buchiFamily_saturation
Plain-language statement
na.buchiFamily saturates the ω-language accepted by na.
Source project: Lean Computer Science Library
Person-level attribution pending.