Skip to content

Commit

Permalink
chore: tidy various files (#7132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben-VandeVelde committed Sep 13, 2023
1 parent 07916a0 commit 7eb2743
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Archive/Imo/Imo2008Q4.lean
Expand Up @@ -83,7 +83,7 @@ theorem imo2008_q4 (f : ℝ → ℝ) (H₁ : ∀ x > 0, f x > 0) :
specialize h₃ (a * b) hab
cases' h₃ with hab₁ hab₂
-- f(ab) = ab → b^4 = 1 → b = 1 → f(b) = b → false
· rw [ hab₁, div_left_inj' h2ab_ne_0 ] at H₂
· rw [hab₁, div_left_inj' h2ab_ne_0] at H₂
field_simp at H₂
have hb₁ : b ^ 4 = 1 := by linear_combination -H₂
obtain hb₂ := abs_eq_one_of_pow_eq_one b 4 (show 40 by norm_num) hb₁
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Category/ModuleCat/Presheaf.lean
Expand Up @@ -123,7 +123,7 @@ lemma comp_app (f : P ⟶ Q) (g : Q ⟶ T) (X : Cᵒᵖ) :

@[ext]
theorem ext {f g : P ⟶ Q} (w : ∀ X, f.app X = g.app X) : f = g := by
cases f; cases g;
cases f; cases g
congr
ext X x
exact LinearMap.congr_fun (w X) x
Expand Down
63 changes: 30 additions & 33 deletions Mathlib/Algebra/Module/LocalizedModule.lean
Expand Up @@ -147,8 +147,8 @@ theorem zero_mk (s : S) : mk (0 : M) s = 0 :=
mk_eq.mpr ⟨1, by rw [one_smul, smul_zero, smul_zero, one_smul]⟩
#align localized_module.zero_mk LocalizedModule.zero_mk

instance : Add (LocalizedModule S M)
where add p1 p2 :=
instance : Add (LocalizedModule S M) where
add p1 p2 :=
liftOn₂ p1 p2 (fun x y => mk (y.2 • x.1 + x.2 • y.1) (x.2 * y.2)) <|
fun ⟨m1, s1⟩ ⟨m2, s2⟩ ⟨m1', s1'⟩ ⟨m2', s2'⟩ ⟨u1, hu1⟩ ⟨u2, hu2⟩ =>
mk_eq.mpr
Expand Down Expand Up @@ -196,8 +196,8 @@ private theorem add_zero' (x : LocalizedModule S M) : x + 0 = x :=
exact ⟨1, by rw [one_smul, mul_smul, one_smul]⟩)
x

instance hasNatSmul : SMul ℕ (LocalizedModule S M) where smul n := nsmulRec n
#align localized_module.has_nat_smul LocalizedModule.hasNatSmul
instance hasNatSMul : SMul ℕ (LocalizedModule S M) where smul n := nsmulRec n
#align localized_module.has_nat_smul LocalizedModule.hasNatSMul

private theorem nsmul_zero' (x : LocalizedModule S M) : (0 : ℕ) • x = 0 :=
LocalizedModule.induction_on (fun _ _ => rfl) x
Expand Down Expand Up @@ -294,8 +294,8 @@ instance {A : Type*} [CommSemiring A] [Algebra R A] {S : Submonoid R} :

instance {A : Type} [Ring A] [Algebra R A] {S : Submonoid R} :
Ring (LocalizedModule S A) :=
{ inferInstanceAs (AddCommGroup (LocalizedModule S A)),
inferInstanceAs (Semiring (LocalizedModule S A)) with }
{ inferInstanceAs (AddCommGroup (LocalizedModule S A)),
inferInstanceAs (Semiring (LocalizedModule S A)) with }

instance {A : Type _} [CommRing A] [Algebra R A] {S : Submonoid R} :
CommRing (LocalizedModule S A) :=
Expand All @@ -309,8 +309,8 @@ theorem mk_mul_mk {A : Type*} [Semiring A] [Algebra R A] {a₁ a₂ : A} {s₁ s
rfl
#align localized_module.mk_mul_mk LocalizedModule.mk_mul_mk

instance : SMul (Localization S) (LocalizedModule S M)
where smul f x :=
instance : SMul (Localization S) (LocalizedModule S M) where
smul f x :=
(Localization.liftOn f
(fun r s =>
(liftOn x (fun p => (mk (r • p.1) (s * p.2)))
Expand Down Expand Up @@ -450,8 +450,7 @@ instance : IsScalarTower R (Localization S) (LocalizedModule S M) :=

instance algebra' {A : Type*} [Semiring A] [Algebra R A] : Algebra R (LocalizedModule S A) :=
{ (algebraMap (Localization S) (LocalizedModule S A)).comp (algebraMap R <| Localization S),
show Module R (LocalizedModule S A) by
infer_instance with
show Module R (LocalizedModule S A) by infer_instance with
commutes' := by
intro r x
obtain ⟨⟨a, s⟩, rfl : mk a s = x⟩ := Quotient.exists_rep x
Expand Down Expand Up @@ -577,13 +576,12 @@ noncomputable def lift' (g : M →ₗ[R] M'')
fun m =>
m.liftOn (fun p => (h p.2).unit⁻¹.val <| g p.1) fun ⟨m, s⟩ ⟨m', s'⟩ ⟨c, eq1⟩ => by
-- Porting note: We remove `generalize_proofs h1 h2`. This does nothing here.
erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← map_smul]
symm
erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff]
dsimp
dsimp only
simp only [Submonoid.smul_def] at eq1
rw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← map_smul, eq_comm,
Module.End_algebraMap_isUnit_inv_apply_eq_iff]
have : c • s • g m' = c • s' • g m := by
erw [← g.map_smul, ← g.map_smul, ← g.map_smul, ← g.map_smul, eq1]
rfl
simp only [Submonoid.smul_def, ← g.map_smul, eq1]
have : Function.Injective (h c).unit.inv := by
rw [Function.injective_iff_hasLeftInverse]
refine' ⟨(h c).unit, _⟩
Expand All @@ -594,9 +592,8 @@ noncomputable def lift' (g : M →ₗ[R] M'')
erw [Units.inv_eq_val_inv, Module.End_algebraMap_isUnit_inv_apply_eq_iff, ←
(h c).unit⁻¹.val.map_smul]
symm
erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← g.map_smul, ← g.map_smul, ← g.map_smul, ←
rw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← g.map_smul, ← g.map_smul, ← g.map_smul, ←
g.map_smul, eq1]
rfl
#align localized_module.lift' LocalizedModule.lift'

theorem lift'_mk (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x))
Expand Down Expand Up @@ -659,7 +656,7 @@ theorem lift_mk

/--
If `g` is a linear map `M → M''` such that all scalar multiplication by `s : S` is invertible, then
there is a linear map `lift g ∘ mk_linear_map = g`.
there is a linear map `lift g ∘ mkLinearMap = g`.
-/
theorem lift_comp (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x)) :
(lift S g h).comp (mkLinearMap S M) = g := by
Expand All @@ -669,18 +666,18 @@ theorem lift_comp (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (M

/--
If `g` is a linear map `M → M''` such that all scalar multiplication by `s : S` is invertible and
`l` is another linear map `LocalizedModule S M ⟶ M''` such that `l ∘ mk_linear_map = g` then
`l` is another linear map `LocalizedModule S M ⟶ M''` such that `l ∘ mkLinearMap = g` then
`l = lift g`
-/
theorem lift_unique (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x))
(l : LocalizedModule S M →ₗ[R] M'') (hl : l.comp (LocalizedModule.mkLinearMap S M) = g) :
LocalizedModule.lift S g h = l := by
ext x; induction' x using LocalizedModule.induction_on with m s
rw [LocalizedModule.lift_mk]
erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← hl, LinearMap.coe_comp,
rw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← hl, LinearMap.coe_comp,
Function.comp_apply, LocalizedModule.mkLinearMap_apply, ← l.map_smul, LocalizedModule.smul'_mk]
congr 1; rw [LocalizedModule.mk_eq]
refine' ⟨1, _⟩; simp only [one_smul]; rfl
refine' ⟨1, _⟩; simp only [one_smul, Submonoid.smul_def]
#align localized_module.lift_unique LocalizedModule.lift_unique

end LocalizedModule
Expand Down Expand Up @@ -743,7 +740,7 @@ theorem fromLocalizedModule'_add (x y : LocalizedModule S M) :
erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, smul_add, ←map_smul, ←map_smul,
←map_smul, map_add]
congr 1
all_goals erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff']
all_goals rw [Module.End_algebraMap_isUnit_inv_apply_eq_iff']
· erw [mul_smul, f.map_smul]
rfl
· erw [mul_comm, f.map_smul, mul_smul]
Expand Down Expand Up @@ -782,18 +779,18 @@ theorem fromLocalizedModule.inj : Function.Injective <| fromLocalizedModule S f
induction' y using LocalizedModule.induction_on with a' b'
simp only [fromLocalizedModule_mk] at eq1
-- Porting note: We remove `generalize_proofs h1 h2`.
erw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← LinearMap.map_smul,
rw [Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← LinearMap.map_smul,
Module.End_algebraMap_isUnit_inv_apply_eq_iff'] at eq1
erw [LocalizedModule.mk_eq, ← IsLocalizedModule.eq_iff_exists S f,
f.map_smul, f.map_smul, eq1]
rfl
rw [Submonoid.coe_subtype]
#align is_localized_module.from_localized_module.inj IsLocalizedModule.fromLocalizedModule.inj

theorem fromLocalizedModule.surj : Function.Surjective <| fromLocalizedModule S f := fun x =>
let ⟨⟨m, s⟩, eq1⟩ := IsLocalizedModule.surj S f x
⟨LocalizedModule.mk m s, by
rw [fromLocalizedModule_mk, Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← eq1]
rfl
rw [fromLocalizedModule_mk, Module.End_algebraMap_isUnit_inv_apply_eq_iff, ← eq1,
Submonoid.smul_def]
#align is_localized_module.from_localized_module.surj IsLocalizedModule.fromLocalizedModule.surj

theorem fromLocalizedModule.bij : Function.Bijective <| fromLocalizedModule S f :=
Expand Down Expand Up @@ -853,9 +850,7 @@ noncomputable def lift (g : M →ₗ[R] M'')
theorem lift_comp (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x)) :
(lift S f g h).comp f = g := by
dsimp only [IsLocalizedModule.lift]
rw [LinearMap.comp_assoc]
convert LocalizedModule.lift_comp S g h
exact iso_symm_comp _ _
rw [LinearMap.comp_assoc, iso_symm_comp, LocalizedModule.lift_comp S g h]
#align is_localized_module.lift_comp IsLocalizedModule.lift_comp

theorem lift_unique (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x))
Expand All @@ -868,7 +863,9 @@ theorem lift_unique (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R
· rw [LinearMap.comp_assoc, ← hl]
congr 1
ext x
erw [fromLocalizedModule_mk, Module.End_algebraMap_isUnit_inv_apply_eq_iff, one_smul]
rw [LinearMap.comp_apply, LocalizedModule.mkLinearMap_apply, LinearEquiv.coe_coe, iso_apply,
fromLocalizedModule'_mk, Module.End_algebraMap_isUnit_inv_apply_eq_iff, OneMemClass.coe_one,
one_smul]
#align is_localized_module.lift_unique IsLocalizedModule.lift_unique

/-- Universal property from localized module:
Expand Down Expand Up @@ -948,8 +945,8 @@ variable {S}
@[simp]
theorem mk'_cancel (m : M) (s : S) : mk' f (s • m) s = f m := by
delta mk'
rw [LocalizedModule.mk_cancel, ← mk'_one S f]
rfl
rw [LocalizedModule.mk_cancel, ← mk'_one S f, fromLocalizedModule_mk,
Module.End_algebraMap_isUnit_inv_apply_eq_iff, OneMemClass.coe_one, mk'_one, one_smul]
#align is_localized_module.mk'_cancel IsLocalizedModule.mk'_cancel

@[simp]
Expand Down
13 changes: 6 additions & 7 deletions Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean
Expand Up @@ -34,7 +34,7 @@ namespace AlgebraicGeometry
variable {X Y : Scheme.{u}} (f : X ⟶ Y)

/--
A morphism is `quasi-compact` if the underlying map of topological spaces is, i.e. if the preimages
A morphism is "quasi-compact" if the underlying map of topological spaces is, i.e. if the preimages
of quasi-compact open sets are quasi-compact.
-/
@[mk_iff]
Expand All @@ -47,7 +47,7 @@ theorem quasiCompact_iff_spectral : QuasiCompact f ↔ IsSpectralMap f.1.base :=
fun ⟨h⟩ => ⟨by continuity, h⟩, fun h => ⟨h.2⟩⟩
#align algebraic_geometry.quasi_compact_iff_spectral AlgebraicGeometry.quasiCompact_iff_spectral

/-- The `affine_target_morphism_property` corresponding to `quasi_compact`, asserting that the
/-- The `AffineTargetMorphismProperty` corresponding to `QuasiCompact`, asserting that the
domain is a quasi-compact scheme. -/
def QuasiCompact.affineProperty : AffineTargetMorphismProperty := fun X _ _ _ =>
CompactSpace X.carrier
Expand Down Expand Up @@ -181,7 +181,7 @@ theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).
topIsAffineOpen _]
#align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affineProperty_isLocal

theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
theorem QuasiCompact.affine_openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
List.TFAE
[QuasiCompact f,
∃ (𝒰 : Scheme.OpenCover.{u} Y) (_ : ∀ i, IsAffine (𝒰.obj i)),
Expand All @@ -193,14 +193,14 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤) (_ : ∀ i, IsAffineOpen (U i)),
∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_TFAE f
#align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
#align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tfae

theorem QuasiCompact.is_local_at_target : PropertyIsLocalAtTarget @QuasiCompact :=
quasiCompact_eq_affineProperty.symm ▸
QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal
#align algebraic_geometry.quasi_compact.is_local_at_target AlgebraicGeometry.QuasiCompact.is_local_at_target

theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
theorem QuasiCompact.openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
List.TFAE
[QuasiCompact f,
∃ 𝒰 : Scheme.OpenCover.{u} Y,
Expand All @@ -213,7 +213,7 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
quasiCompact_eq_affineProperty.symm ▸
QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_TFAE f
#align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
#align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tfae

theorem quasiCompact_over_affine_iff {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] :
QuasiCompact f ↔ CompactSpace X.carrier :=
Expand Down Expand Up @@ -250,7 +250,6 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
QuasiCompact.affineProperty.StableUnderBaseChange := by
intro X Y S _ _ f g h
rw [QuasiCompact.affineProperty] at h ⊢
skip
let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
have : Finite 𝒰.J := by dsimp; infer_instance
have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/Calculus/Taylor.lean
Expand Up @@ -285,7 +285,7 @@ theorem taylor_mean_remainder_lagrange {f : ℝ → ℝ} {x x₀ : ℝ} {n : ℕ
use y, hy
simp only [sub_self, zero_pow', Ne.def, Nat.succ_ne_zero, not_false_iff, zero_sub, mul_neg] at h
rw [h, neg_div, ← div_neg, neg_mul, neg_neg]
field_simp [xy_ne y hy]; ring
field_simp [xy_ne y hy]; ring
#align taylor_mean_remainder_lagrange taylor_mean_remainder_lagrange

/-- **Taylor's theorem** with the Cauchy form of the remainder.
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Analysis/Convex/Normed.lean
Expand Up @@ -120,14 +120,14 @@ theorem bounded_convexHull {s : Set E} : Metric.Bounded (convexHull ℝ s) ↔ M
simp only [Metric.bounded_iff_ediam_ne_top, convexHull_ediam]
#align bounded_convex_hull bounded_convexHull

instance (priority := 100) NormedSpace.path_connected : PathConnectedSpace E :=
instance (priority := 100) NormedSpace.instPathConnectedSpace : PathConnectedSpace E :=
TopologicalAddGroup.pathConnectedSpace
#align normed_space.path_connected NormedSpace.path_connected
#align normed_space.path_connected NormedSpace.instPathConnectedSpace

instance (priority := 100) NormedSpace.loc_path_connected : LocPathConnectedSpace E :=
instance (priority := 100) NormedSpace.instLocPathConnectedSpace : LocPathConnectedSpace E :=
locPathConnected_of_bases (fun x => Metric.nhds_basis_ball) fun x r r_pos =>
(convex_ball x r).isPathConnected <| by simp [r_pos]
#align normed_space.loc_path_connected NormedSpace.loc_path_connected
#align normed_space.loc_path_connected NormedSpace.instLocPathConnectedSpace

theorem dist_add_dist_of_mem_segment {x y z : E} (h : y ∈ [x -[ℝ] z]) :
dist x y + dist y z = dist x z := by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/LocallyConvex/Barrelled.lean
Expand Up @@ -173,7 +173,7 @@ protected theorem banach_steinhaus (H : ∀ k x, BddAbove (range fun i ↦ q k (
domain is barrelled, the Banach-Steinhaus theorem is used to guarantee that the limit map
is a *continuous* linear map as well.
This actually works for any *countably generated* filter instead of `AtTop : Filter ℕ`,
This actually works for any *countably generated* filter instead of `atTop : Filter ℕ`,
but the proof ultimately goes back to sequences. -/
protected def continuousLinearMapOfTendsto [T2Space F] {l : Filter α} [l.IsCountablyGenerated]
[l.NeBot] (g : α → E →SL[σ₁₂] F) {f : E → F} (h : Tendsto (fun n x ↦ g n x) l (𝓝 f)) :
Expand All @@ -182,7 +182,7 @@ protected def continuousLinearMapOfTendsto [T2Space F] {l : Filter α} [l.IsCoun
cont := by
-- Since the filter `l` is countably generated and nontrivial, we can find a sequence
-- `u : ℕ → α` that tends to `l`. By considering `g ∘ u` instead of `g`, we can thus assume
-- that `α = ℕ` and `l = AtTop`
-- that `α = ℕ` and `l = atTop`
rcases l.exists_seq_tendsto with ⟨u, hu⟩
-- We claim that the limit is continuous because it's a limit of an equicontinuous family.
-- By the Banach-Steinhaus theorem, this equicontinuity will follow from pointwise boundedness.
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Abelian/Pseudoelements.lean
Expand Up @@ -460,7 +460,7 @@ variable [Limits.HasPullbacks C]
that `f p = g q`, then there is some `s : pullback f g` such that `fst s = p` and `snd s = q`.
Remark: Borceux claims that `s` is unique, but this is false. See
`Counterexamples/Pseudoelement` for details. -/
`Counterexamples/Pseudoelement.lean` for details. -/
theorem pseudo_pullback {P Q R : C} {f : P ⟶ R} {g : Q ⟶ R} {p : P} {q : Q} :
f p = g q →
∃ s, (pullback.fst : pullback f g ⟶ P) s = p ∧ (pullback.snd : pullback f g ⟶ Q) s = q :=
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/CategoryTheory/Bicategory/Adjunction.lean
Expand Up @@ -77,9 +77,9 @@ def rightZigzag (η : 𝟙 a ⟶ f ≫ g) (ε : g ≫ f ⟶ 𝟙 b) :=

/-- Adjunction between two 1-morphisms. -/
structure Adjunction (f : a ⟶ b) (g : b ⟶ a) where
/-- The unit of an adjuntion. -/
/-- The unit of an adjunction. -/
unit : 𝟙 a ⟶ f ≫ g
/-- The counit of an adjuntion. -/
/-- The counit of an adjunction. -/
counit : g ≫ f ⟶ 𝟙 b
/-- The composition of the unit and the counit is equal to the identity up to unitors. -/
left_triangle : leftZigzag unit counit = (λ_ _).hom ≫ (ρ_ _).inv := by aesop_cat
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Combinatorics/SimpleGraph/Connectivity/Subgraph.lean
Expand Up @@ -111,9 +111,8 @@ lemma _root_.SimpleGraph.Walk.toSubgraph_connected {u v : V} (p : G.Walk u v) :
p.toSubgraph.Connected := by
induction p with
| nil => apply singletonSubgraph_connected
| cons h p ih =>
| @cons _ w _ h p ih =>
apply (subgraphOfAdj_connected h).sup ih
rename_i w _
exists w
simp

Expand Down Expand Up @@ -148,8 +147,9 @@ lemma preconnected_iff_forall_exists_walk_subgraph (H : G.Subgraph) :
(p.toSubgraph_connected ⟨_, p.start_mem_verts_toSubgraph⟩ ⟨_, p.end_mem_verts_toSubgraph⟩)

lemma connected_iff_forall_exists_walk_subgraph (H : G.Subgraph) :
H.Connected ↔ H.verts.Nonempty ∧ ∀ {u v}, u ∈ H.verts → v ∈ H.verts →
∃ p : G.Walk u v, p.toSubgraph ≤ H := by
H.Connected ↔
H.verts.Nonempty ∧
∀ {u v}, u ∈ H.verts → v ∈ H.verts → ∃ p : G.Walk u v, p.toSubgraph ≤ H := by
rw [H.connected_iff, preconnected_iff_forall_exists_walk_subgraph, and_comm]

end Subgraph
Expand Down

0 comments on commit 7eb2743

Please sign in to comment.