Get M option eq some iff
Matrix.getM_option_eq_some_iff
Plain-language statement
getM at Option succeeds exactly when every component does. This is what turns the func branch of ofNat into a statement about each argument separately.
Exact Lean statement
lemma getM_option_eq_some_iff {n : ℕ} {β : Type*} {f : Fin n → Option β} {v : Fin n → β} :
Matrix.getM f = some v ↔ ∀ i, f i = some (v i)Formal artifact
Lean source
lemma getM_option_eq_some_iff {n : ℕ} {β : Type*} {f : Fin n → Option β} {v : Fin n → β} : Matrix.getM f = some v ↔ ∀ i, f i = some (v i) := by induction n with | zero => refine ⟨fun _ i ↦ i.elim0, fun _ ↦ ?_⟩ rw [Matrix.getM] exact congrArg some (funext fun i ↦ i.elim0) | succ n ih => rw [getM_option_succ] constructor · intro h rw [Option.bind_eq_some_iff] at h obtain ⟨a, ha, hm⟩ := h rw [Option.map_eq_some_iff] at hm obtain ⟨w, hw, rfl⟩ := hm intro i exact i.cases (by simpa using ha) (by simpa using ih.mp hw) · intro h refine Option.bind_eq_some_iff.mpr ⟨v 0, by simpa using h 0, ?_⟩ refine Option.map_eq_some_iff.mpr ⟨fun j ↦ v j.succ, ih.mpr fun j ↦ by simpa using h j.succ, ?_⟩ exact funext fun i ↦ i.cases (by simp) (by simp)- Project
- Foundation
- License
- Apache-2.0
- Commit
- 8dcdb3196454
- Source
- Foundation/FirstOrder/Basic/PrimrecCoding.lean:46-67
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
Computable Pred iff decoded pred
ComputablePred.iff_decoded_pred
Plain-language statement
Computability of a predicate on a Primcodable type is equivalent to the computability of the corresponding predicate on ℕ obtained by decoding.
Source project: Foundation
Person-level attribution pending.
Bv quote fixitr
LO.FirstOrder.Arithmetic.Bootstrapping.bv_quote_fixitr
Plain-language statement
bv-pin bridge (over ℕ): bv ⌜fixitr 0 (fvSup χ) ▹ χ⌝ = fvSup χ. - ≤ is immediate from quote_univCl_eq + bv_qqAlls (closing fvSup quantifiers reaches a sentence, whose bv is 0). - ≥ is by level-factoring: were the body an IsSemiformula j for some j < fvSup, IsSemiformula.sound + castLE-invariance would re-express χ as `γ ⇜ ![...
Source project: Foundation
Person-level attribution pending.
Conj
LO.FirstOrder.Arithmetic.Bootstrapping.Derivable.conj
Plain-language statement
Crucial inducion for formalized -completeness.
Source project: Foundation
Person-level attribution pending.